mirror of
https://github.com/verilator/verilator.git
synced 2026-09-01 18:36:28 +02:00
Call pre/post_randomize on randomize() with (#5412)
Signed-off-by: Krzysztof Bieganski <[email protected]>
This commit is contained in:
@@ -1918,6 +1918,8 @@ class RandomizeVisitor final : public VNVisitor {
|
||||
AstFunc* const randomizeFuncp = V3Randomize::newRandomizeFunc(
|
||||
m_memberMap, classp, m_inlineUniqueNames.get(nodep), false);
|
||||
|
||||
addPrePostCall(classp, randomizeFuncp, "pre_randomize");
|
||||
|
||||
// Detach the expression and prepare variable copies
|
||||
const CaptureVisitor captured{withp->exprp(), m_modp, classp};
|
||||
|
||||
@@ -1975,6 +1977,8 @@ class RandomizeVisitor final : public VNVisitor {
|
||||
new AstVarRef{nodep->fileline(), VN_AS(randomizeFuncp->fvarp(), Var), VAccess::WRITE},
|
||||
new AstAnd{nodep->fileline(), basicRandomizeFuncCallp, solverCallp}});
|
||||
|
||||
addPrePostCall(classp, randomizeFuncp, "post_randomize");
|
||||
|
||||
// Replace the node with a call to that function
|
||||
nodep->name(randomizeFuncp->name());
|
||||
nodep->addPinsp(captured.getArgs());
|
||||
|
||||
Reference in New Issue
Block a user