From e88f9c52eacaebba7c0f6b6fdf5b0ade71c99636 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Thu, 29 Dec 2022 13:36:08 -0800 Subject: [PATCH] Handle continuous array assignments from package scoped indentifiers Make sure the package scope is considered when elaborating identifiers for continuous unpacked array assignments. Signed-off-by: Lars-Peter Clausen --- elab_net.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/elab_net.cc b/elab_net.cc index 2e45929a0..20e25799c 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -21,6 +21,7 @@ # include "config.h" # include "PExpr.h" +# include "PPackage.h" # include "netlist.h" # include "netmisc.h" # include "netstruct.h" @@ -1101,13 +1102,15 @@ NetNet* PEIdent::elaborate_subport(Design*des, NetScope*scope) const NetNet*PEIdent::elaborate_unpacked_net(Design*des, NetScope*scope) const { - NetNet* sig = 0; - const NetExpr*par = 0; - NetEvent* eve = 0; - perm_string method_name; + NetScope *use_scope = scope; + if (package_) { + use_scope = des->find_package(package_->pscope_name()); + ivl_assert(*this, use_scope); + } - symbol_search(this, des, scope, path_, sig, par, eve); - if (!sig) { + symbol_search_results sr; + symbol_search(this, des, use_scope, path_, &sr); + if (!sr.net) { cerr << get_fileline() << ": error: Net " << path_ << " is not defined in this context." << endl; des->errors += 1; @@ -1122,7 +1125,7 @@ NetNet*PEIdent::elaborate_unpacked_net(Design*des, NetScope*scope) const return nullptr; } - return sig; + return sr.net; } bool PEIdent::is_collapsible_net(Design*des, NetScope*scope,