From 4d110a96bf18368d0abaa9c9786b5169ec26163a Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Thu, 30 Apr 2026 10:51:03 -0700 Subject: [PATCH 1/3] Localize external package/global net --- frontends/verific/verific.cc | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 212761028..c82fca6b7 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2814,7 +2814,22 @@ struct VerificExtNets cursor = ((Instance*)cursor->GetReferences()->GetLast())->Owner(); } - log_error("No common ancestor found between %s and %s.\n", get_full_netlist_name(A), get_full_netlist_name(B)); + return nullptr; + } + + Net *localize_external_package_net(Netlist *nl, Net *net, Port *port) + { + string name = stringf("___extnets_%d", portname_cnt++); + Net *new_net = new Net(name.c_str()); + nl->Add(new_net); + + if (!port->IsInput()) + log_warning("Localizing external package/global net reference '%s.%s' on %s.%s; " + "writes to the package/global object are not propagated.\n", + get_full_netlist_name(net->Owner()).c_str(), net->Name(), + get_full_netlist_name(nl).c_str(), port->Name()); + + return new_net; } void run(Netlist *nl) @@ -2847,6 +2862,14 @@ struct VerificExtNets Netlist *ca_nl = find_common_ancestor(nl, ext_nl); + if (ca_nl == nullptr) { + Net *new_net = localize_external_package_net(nl, net, port); + if (verific_verbose) + log(" localized external package/global net: %s\n", new_net->Name()); + todo_connect.push_back(tuple(inst, port, new_net)); + continue; + } + if (verific_verbose) log(" common ancestor: %s\n", get_full_netlist_name(ca_nl)); From 89a8250ae8c1921d43fcdc2f0f349261609fcfc2 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Thu, 30 Apr 2026 14:15:25 -0700 Subject: [PATCH 2/3] Update frontends/verific/verific.cc Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- frontends/verific/verific.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index c82fca6b7..745ac950f 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2823,7 +2823,12 @@ struct VerificExtNets Net *new_net = new Net(name.c_str()); nl->Add(new_net); - if (!port->IsInput()) + if (port->IsInput()) + log_warning("Localizing external package/global net reference '%s.%s' on %s.%s; " + "reads from the package/global object will return an undriven (floating) value.\n", + get_full_netlist_name(net->Owner()).c_str(), net->Name(), + get_full_netlist_name(nl).c_str(), port->Name()); + else log_warning("Localizing external package/global net reference '%s.%s' on %s.%s; " "writes to the package/global object are not propagated.\n", get_full_netlist_name(net->Owner()).c_str(), net->Name(), From e1aade6a1f9d617d989b365f300555f2fba4607e Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Thu, 30 Apr 2026 14:15:44 -0700 Subject: [PATCH 3/3] Update frontends/verific/verific.cc Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- frontends/verific/verific.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 745ac950f..acbe4b5a7 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2817,6 +2817,11 @@ struct VerificExtNets return nullptr; } + // Handles the case where a net belongs to an external package or global scope + // (i.e., there is no common ancestor in the design hierarchy). Creates a fresh + // local net in `nl` and disconnects it from the original package/global net. + // For input ports the new net will be undriven; for output ports, writes will + // not be propagated back to the package/global object. Net *localize_external_package_net(Netlist *nl, Net *net, Port *port) { string name = stringf("___extnets_%d", portname_cnt++);