mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 08:24:31 +02:00
Support cross-module clockvars access (#5184)
This commit is contained in:
+1
-13
@@ -51,7 +51,6 @@ class ScopeVisitor final : public VNVisitor {
|
||||
// STATE, for passing down one level of hierarchy (may need save/restore)
|
||||
AstCell* m_aboveCellp = nullptr; // Cell that instantiates this module
|
||||
AstScope* m_aboveScopep = nullptr; // Scope that instantiates this scope
|
||||
AstClocking* m_clockingp = nullptr; // Current clocking block
|
||||
|
||||
std::unordered_map<AstNodeModule*, AstScope*> m_packageScopes; // Scopes for each package
|
||||
VarScopeMap m_varScopes; // Varscopes created for each scope and var
|
||||
@@ -243,15 +242,6 @@ class ScopeVisitor final : public VNVisitor {
|
||||
// We iterate under the *clone*
|
||||
iterateChildren(clonep);
|
||||
}
|
||||
void visit(AstClocking* nodep) override {
|
||||
VL_RESTORER(m_clockingp);
|
||||
m_clockingp = nodep;
|
||||
UINFO(4, " CLOCKING " << nodep << endl);
|
||||
iterateChildren(nodep);
|
||||
if (nodep->varsp()) m_scopep->modp()->addStmtsp(nodep->varsp()->unlinkFrBackWithNext());
|
||||
if (nodep->eventp()) m_scopep->modp()->addStmtsp(nodep->eventp()->unlinkFrBack());
|
||||
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
|
||||
}
|
||||
void visit(AstNodeFTask* nodep) override {
|
||||
// Add to list of blocks under this scope
|
||||
UINFO(4, " FTASK " << nodep << endl);
|
||||
@@ -270,9 +260,7 @@ class ScopeVisitor final : public VNVisitor {
|
||||
}
|
||||
void visit(AstVar* nodep) override {
|
||||
// Make new scope variable
|
||||
if (m_clockingp) {
|
||||
nodep->name(VString::dot(m_clockingp->name(), "__DOT__", nodep->name()));
|
||||
} else if (!nodep->user1p()) {
|
||||
if (!nodep->user1p()) {
|
||||
AstScope* scopep = m_scopep;
|
||||
if (AstIfaceRefDType* const ifacerefp = VN_CAST(nodep->dtypep(), IfaceRefDType)) {
|
||||
// Attach every non-virtual interface variable its inner scope
|
||||
|
||||
Reference in New Issue
Block a user