mirror of
https://github.com/verilator/verilator.git
synced 2026-09-01 18:36:28 +02:00
Fix randomize with foreach constraints (#5492)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
This commit is contained in:
@@ -913,7 +913,11 @@ class CaptureVisitor final : public VNVisitor {
|
||||
const bool varHasAutomaticLifetime = varRefp->varp()->lifetime().isAutomatic();
|
||||
const bool varIsFieldOfCaller = AstClass::isClassExtendedFrom(callerClassp, varClassp);
|
||||
const bool varIsParam = varRefp->varp()->isParam();
|
||||
const bool varIsConstraintIterator
|
||||
= VN_IS(varRefp->varp()->firstAbovep(), SelLoopVars)
|
||||
&& VN_IS(varRefp->varp()->firstAbovep()->firstAbovep(), ConstraintForeach);
|
||||
if (refIsXref) return CaptureMode::CAP_VALUE | CaptureMode::CAP_F_XREF;
|
||||
if (varIsConstraintIterator) return CaptureMode::CAP_NO;
|
||||
if (varIsFuncLocal && varHasAutomaticLifetime) return CaptureMode::CAP_VALUE;
|
||||
if (varIsParam) return CaptureMode::CAP_VALUE;
|
||||
// Static var in function (will not be inlined, because it's in class)
|
||||
|
||||
Reference in New Issue
Block a user