From 1dc6fd3d939bea23922a60dc81087efb465437eb Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 28 Sep 2024 17:37:44 -0400 Subject: [PATCH] Internals: Move interface error to later phase, prep for later commit. No functional change intended. --- src/V3LinkDot.cpp | 9 +++++++++ src/V3LinkParse.cpp | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index d2e81676c..8ecd3ca35 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -489,6 +489,15 @@ public: } } else if (ifacerefp->ifaceViaCellp()->dead()) { if (varp->isIfaceRef()) { + if (forPrimary() && !varp->isIfaceParent() + && !v3Global.opt.topIfacesSupported()) { + // Only AstIfaceRefDType's at this point correspond to ports; + // haven't made additional ones for interconnect yet, so assert is simple + // What breaks later is we don't have a Scope/Cell representing + // the interface to attach to + varp->v3warn(E_UNSUPPORTED, + "Unsupported: Interfaced port on top level module"); + } ifacerefp->v3error("Parent instance's interface is not found: " << AstNode::prettyNameQ(ifacerefp->ifaceName())); } else { diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index d1e4a8b6b..faa31fe0c 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -398,15 +398,6 @@ class LinkParseVisitor final : public VNVisitor { VN_AS(nodep->valuep()->unlinkFrBack(), NodeExpr)}); } } - if (nodep->isIfaceRef() && !nodep->isIfaceParent() && !v3Global.opt.topIfacesSupported()) { - // Only AstIfaceRefDType's at this point correspond to ports; - // haven't made additional ones for interconnect yet, so assert is simple - // What breaks later is we don't have a Scope/Cell representing - // the interface to attach to - if (m_modp->level() <= 2) { - nodep->v3warn(E_UNSUPPORTED, "Unsupported: Interfaced port on top level module"); - } - } } void visit(AstConst* nodep) override { if (nodep->num().autoExtend() && nodep->fileline()->language() < V3LangCode::L1800_2005) {