mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
+5
-5
@@ -5309,18 +5309,18 @@ class LinkDotResolveVisitor final : public VNVisitor {
|
||||
const VSymEnt* foundp;
|
||||
if (nodep->classOrPackagep()) {
|
||||
foundp = m_statep->getNodeSym(nodep->classOrPackagep())->findIdFlat(nodep->name());
|
||||
} else if (!nodep->ifacePortName().empty()) { // Interface typedef
|
||||
nodep->v3error("Unsupported: SystemVerilog 2005 interface typedef");
|
||||
return;
|
||||
} else if (m_ds.m_dotPos == DP_FIRST || m_ds.m_dotPos == DP_NONE) {
|
||||
foundp = m_curSymp->findIdFallback(nodep->name());
|
||||
} else {
|
||||
//foundp = m_curSymp->findIdFlat(nodep->name());
|
||||
// Use dotSymp if set (e.g., for captured interface typedefs), else curSymp
|
||||
VSymEnt* const lookupSymp = m_ds.m_dotSymp ? m_ds.m_dotSymp : m_curSymp;
|
||||
foundp = lookupSymp->findIdFlat(nodep->name());
|
||||
}
|
||||
if (!foundp && ifaceCaptured && capturedTypedefp) {
|
||||
if (ifaceCaptured && capturedTypedefp) {
|
||||
// When we have a captured interface typedef context, use the captured typedef
|
||||
// instead of any local lookup result. This handles the case where the local
|
||||
// typedef has the same name as the interface typedef (e.g., `typedef if0.rq_t
|
||||
// rq_t;`)
|
||||
UINFO(9, indent() << "iface capture binding via captured typedef fallback name="
|
||||
<< nodep->name() << " typedef=" << capturedTypedefp);
|
||||
nodep->typedefp(capturedTypedefp);
|
||||
|
||||
Reference in New Issue
Block a user