Add warning on dist in constraints (#5264)

This commit is contained in:
Arkadiusz Kozdra
2024-07-15 21:01:33 -04:00
committed by GitHub
parent 34e37d7bd0
commit 0a9b31bb30
8 changed files with 99 additions and 32 deletions
+5
View File
@@ -328,6 +328,11 @@ class ConstraintExprVisitor final : public VNVisitor {
// Fall back to "(ite cond then else)"
visit(static_cast<AstNodeTriop*>(nodep));
}
void visit(AstDist* nodep) override {
nodep->v3warn(CONSTRAINTIGN, "Constraint expression ignored (unsupported)");
nodep->replaceWith(new AstSFormatF{nodep->fileline(), "true", false, nullptr});
VL_DO_DANGLING(nodep->deleteTree(), nodep);
}
void visit(AstReplicate* nodep) override {
// Biop, but RHS is harmful
if (editFormat(nodep)) return;