Fix rand_mode()/constraint_mode() when used as function arguments (#7051) (#7055)

This commit is contained in:
Yilou Wang
2026-02-11 09:33:09 -08:00
committed by GitHub
parent 996a4b6e1a
commit 554fcef627
3 changed files with 72 additions and 1 deletions
+6 -1
View File
@@ -3264,7 +3264,12 @@ class RandomizeVisitor final : public VNVisitor {
return;
}
if (nodep->name() != "randomize") return;
if (nodep->name() != "randomize") {
// Iterate children so nested rand_mode/constraint_mode/randomize calls
// inside function arguments are still visited and transformed
iterateChildren(nodep);
return;
}
if (nodep->classOrPackagep() && nodep->classOrPackagep()->name() == "std") {
// Handle std::randomize; create wrapper function that calls basicStdRandomization on