mirror of
https://github.com/verilator/verilator.git
synced 2026-08-31 18:14:33 +02:00
Support dynamic array elements in std::randomize (#6896)
This commit is contained in:
@@ -184,6 +184,8 @@ class RandomizeMarkVisitor final : public VNVisitor {
|
||||
exprp = arrselp->fromp();
|
||||
} else if (const AstStructSel* const strselp = VN_CAST(exprp, StructSel)) {
|
||||
exprp = strselp->fromp();
|
||||
} else if (const AstCMethodHard* const methodp = VN_CAST(exprp, CMethodHard)) {
|
||||
exprp = methodp->fromp();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -359,6 +361,9 @@ class RandomizeMarkVisitor final : public VNVisitor {
|
||||
} else if (AstStructSel* const structSelp = VN_CAST(exprp, StructSel)) {
|
||||
exprp = structSelp->fromp();
|
||||
continue; // Skip StructSel, continue traversing
|
||||
} else if (AstCMethodHard* const methodp = VN_CAST(exprp, CMethodHard)) {
|
||||
exprp = methodp->fromp();
|
||||
continue;
|
||||
} else if (AstVarRef* const varrefp = VN_CAST(exprp, VarRef)) {
|
||||
randVarp = varrefp->varp();
|
||||
varrefp->user1(true);
|
||||
|
||||
Reference in New Issue
Block a user