mirror of
https://github.com/verilator/verilator.git
synced 2026-09-02 10:48:27 +02:00
Fix randomize missing simple class rand members.
This commit is contained in:
@@ -47,6 +47,7 @@ private:
|
||||
using BaseToDerivedMap = std::unordered_map<AstClass*, DerivedSet>;
|
||||
|
||||
BaseToDerivedMap m_baseToDerivedMap; // Mapping from base classes to classes that extend them
|
||||
AstClass* m_classp = nullptr; // Current class
|
||||
|
||||
// METHODS
|
||||
void markMembers(AstClass* nodep) {
|
||||
@@ -87,6 +88,8 @@ private:
|
||||
|
||||
// VISITORS
|
||||
void visit(AstClass* nodep) override {
|
||||
VL_RESTORER(m_classp);
|
||||
m_classp = nodep;
|
||||
iterateChildrenConst(nodep);
|
||||
if (nodep->extendsp()) {
|
||||
// Save pointer to derived class
|
||||
@@ -104,6 +107,11 @@ private:
|
||||
markMembers(classp);
|
||||
}
|
||||
}
|
||||
void visit(AstNodeFTaskRef* nodep) override {
|
||||
iterateChildrenConst(nodep);
|
||||
if (nodep->name() != "randomize") return;
|
||||
if (m_classp) m_classp->user1(true);
|
||||
}
|
||||
|
||||
void visit(AstNode* nodep) override { iterateChildrenConst(nodep); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user