Add error on solve before of randc variable.

This commit is contained in:
Wilson Snyder
2024-11-09 12:26:48 -05:00
parent 3fae11595a
commit d230ccd716
5 changed files with 46 additions and 0 deletions
+9
View File
@@ -401,6 +401,15 @@ class RandomizeMarkVisitor final : public VNVisitor {
}
}
}
void visit(AstConstraintBefore* nodep) override {
nodep->foreach([&](AstVarRef* const refp) {
if (refp->varp() && refp->varp()->isRandC()) {
nodep->v3error(
"Randc variables not allowed in 'solve before' (IEEE 1800-2023 18.5.9)");
}
});
iterateChildrenConst(nodep);
}
void visit(AstConstraintExpr* nodep) override {
VL_RESTORER(m_constraintExprp);
m_constraintExprp = nodep;