diff --git a/src/V3AstNodeStmt.h b/src/V3AstNodeStmt.h index 6d87eabd0..c153fd551 100644 --- a/src/V3AstNodeStmt.h +++ b/src/V3AstNodeStmt.h @@ -972,6 +972,7 @@ public: AstRandCase(FileLine* fl, AstCaseItem* itemsp) : ASTGEN_SUPER_RandCase(fl) { addItemsp(itemsp); + v3Global.useRandomizeMethods(true); } ASTGEN_MEMBERS_AstRandCase; int instrCount() const override { return INSTR_COUNT_BRANCH; } diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 0b226803f..b63a7eef7 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -5500,7 +5500,6 @@ class WidthVisitor final : public VNVisitor { // IEEE says each item is a int (32-bits), and sizes are based on natural sizing, // but we'll sum to a 64-bit number then math is faster. assertAtStatement(nodep); - v3Global.useRandomizeMethods(true); AstNodeDType* const itemDTypep = nodep->findUInt32DType(); for (AstCaseItem *nextip, *itemp = nodep->itemsp(); itemp; itemp = nextip) { nextip = VN_AS(itemp->nextp(), CaseItem); // Prelim may cause the node to get replaced