mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 16:28:53 +02:00
Support reduction or in constraints (#6840)
This commit is contained in:
@@ -1050,6 +1050,18 @@ class ConstraintExprVisitor final : public VNVisitor {
|
||||
VL_DO_DANGLING(nodep->deleteTree(), nodep);
|
||||
iterate(sump);
|
||||
}
|
||||
void visit(AstRedOr* nodep) override {
|
||||
if (editFormat(nodep)) return;
|
||||
// Convert to (x != 0)
|
||||
FileLine* const fl = nodep->fileline();
|
||||
AstNodeExpr* const argp = nodep->lhsp()->unlinkFrBack();
|
||||
V3Number numZero{fl, argp->width(), 0};
|
||||
AstNodeExpr* const neqp = new AstNeq{fl, argp, new AstConst{fl, numZero}};
|
||||
neqp->user1(true);
|
||||
nodep->replaceWith(neqp);
|
||||
VL_DO_DANGLING(nodep->deleteTree(), nodep);
|
||||
iterate(neqp);
|
||||
}
|
||||
void visit(AstNodeBiop* nodep) override {
|
||||
if (editFormat(nodep)) return;
|
||||
editSMT(nodep, nodep->lhsp(), nodep->rhsp());
|
||||
|
||||
Reference in New Issue
Block a user