mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
+5
-3
@@ -3652,6 +3652,7 @@ class RandomizeVisitor final : public VNVisitor {
|
||||
|
||||
// STATE
|
||||
V3UniqueNames m_inlineUniqueNames; // For generating unique function names
|
||||
V3UniqueNames m_randArrayUniqueNames{"__Vrandarr"}; // Random array loop indices
|
||||
V3UniqueNames m_modeUniqueNames{"__Vmode"}; // For generating unique rand/constraint
|
||||
// mode state var names
|
||||
V3UniqueNames m_inlineUniqueStdName{"__VStdrand"};
|
||||
@@ -4234,15 +4235,14 @@ class RandomizeVisitor final : public VNVisitor {
|
||||
}
|
||||
AstNodeStmt* createArrayForeachLoop(FileLine* const fl, AstNodeDType* const dtypep,
|
||||
AstNodeExpr* exprp, AstVar* const outputVarp) {
|
||||
V3UniqueNames uniqueNames{"__Vrandarr"};
|
||||
AstNodeDType* tempDTypep = dtypep;
|
||||
AstVar* randLoopIndxp = nullptr;
|
||||
auto createLoopIndex = [&](AstNodeDType* tempDTypep) {
|
||||
if (VN_IS(tempDTypep, AssocArrayDType)) {
|
||||
return new AstVar{fl, VVarType::VAR, uniqueNames.get(""),
|
||||
return new AstVar{fl, VVarType::VAR, m_randArrayUniqueNames.get(""),
|
||||
VN_AS(tempDTypep, AssocArrayDType)->keyDTypep()};
|
||||
}
|
||||
return new AstVar{fl, VVarType::VAR, uniqueNames.get(""),
|
||||
return new AstVar{fl, VVarType::VAR, m_randArrayUniqueNames.get(""),
|
||||
dtypep->findBasicDType(VBasicDTypeKwd::UINT32)};
|
||||
};
|
||||
AstNodeExpr* tempElementp = nullptr;
|
||||
@@ -5675,8 +5675,10 @@ class RandomizeVisitor final : public VNVisitor {
|
||||
void visit(AstNodeModule* nodep) override {
|
||||
VL_RESTORER(m_modp);
|
||||
VL_RESTORER(m_randCaseNum);
|
||||
VL_RESTORER_COPY(m_randArrayUniqueNames);
|
||||
m_modp = nodep;
|
||||
m_randCaseNum = 0;
|
||||
m_randArrayUniqueNames.reset();
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
void visit(AstNodeFTask* nodep) override {
|
||||
|
||||
Reference in New Issue
Block a user