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 <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-12-29 13:36:08 -08:00
parent 0958621ad1
commit e88f9c52ea
1 changed files with 10 additions and 7 deletions

View File

@ -21,6 +21,7 @@
# include "config.h" # include "config.h"
# include "PExpr.h" # include "PExpr.h"
# include "PPackage.h"
# include "netlist.h" # include "netlist.h"
# include "netmisc.h" # include "netmisc.h"
# include "netstruct.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*PEIdent::elaborate_unpacked_net(Design*des, NetScope*scope) const
{ {
NetNet* sig = 0; NetScope *use_scope = scope;
const NetExpr*par = 0; if (package_) {
NetEvent* eve = 0; use_scope = des->find_package(package_->pscope_name());
perm_string method_name; ivl_assert(*this, use_scope);
}
symbol_search(this, des, scope, path_, sig, par, eve); symbol_search_results sr;
if (!sig) { symbol_search(this, des, use_scope, path_, &sr);
if (!sr.net) {
cerr << get_fileline() << ": error: Net " << path_ cerr << get_fileline() << ": error: Net " << path_
<< " is not defined in this context." << endl; << " is not defined in this context." << endl;
des->errors += 1; des->errors += 1;
@ -1122,7 +1125,7 @@ NetNet*PEIdent::elaborate_unpacked_net(Design*des, NetScope*scope) const
return nullptr; return nullptr;
} }
return sig; return sr.net;
} }
bool PEIdent::is_collapsible_net(Design*des, NetScope*scope, bool PEIdent::is_collapsible_net(Design*des, NetScope*scope,