diff --git a/PExpr.cc b/PExpr.cc index 2928e4bc5..8454ad930 100644 --- a/PExpr.cc +++ b/PExpr.cc @@ -238,8 +238,8 @@ static pform_name_t pn_from_ps(perm_string n) return tmp; } -PECallFunction::PECallFunction(PPackage*pkg, perm_string n, const list &parms) -: package_(pkg), path_(pn_from_ps(n)), parms_(parms.size()), is_overridden_(false) +PECallFunction::PECallFunction(PPackage*pkg, const pform_name_t&n, const list &parms) +: package_(pkg), path_(n), parms_(parms.size()), is_overridden_(false) { int tmp_idx = 0; assert(parms_.size() == parms.size()); diff --git a/PExpr.h b/PExpr.h index 75db22d5f..86550a303 100644 --- a/PExpr.h +++ b/PExpr.h @@ -521,7 +521,8 @@ class PEIdent : public PExpr { unsigned expr_wid, unsigned flags) const; - unsigned test_width_method_(Design*des, NetScope*scope, width_mode_t&mode); + unsigned test_width_method_(const symbol_search_results &sr); + unsigned test_width_parameter_(const NetExpr *par, width_mode_t&mode); @@ -886,8 +887,7 @@ class PECallFunction : public PExpr { public: explicit PECallFunction(const pform_name_t&n, const std::vector &parms); // Call function defined in package. - explicit PECallFunction(PPackage*pkg, perm_string n, const std::vector &parms); - explicit PECallFunction(PPackage*pkg, perm_string n, const std::list &parms); + explicit PECallFunction(PPackage*pkg, const pform_name_t&n, const std::list &parms); // Used to convert a user function called as a task explicit PECallFunction(PPackage*pkg, const pform_name_t&n, const std::vector &parms); diff --git a/elab_expr.cc b/elab_expr.cc index 0dc874ac0..7db1f21ef 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -3981,7 +3981,7 @@ NetExpr* PEIdent::calculate_up_do_base_(Design*des, NetScope*scope, return tmp; } -unsigned PEIdent::test_width_method_(Design*des, NetScope*scope, width_mode_t&) +unsigned PEIdent::test_width_method_(const symbol_search_results &sr) { if (!gn_system_verilog()) return 0; @@ -3998,12 +3998,7 @@ unsigned PEIdent::test_width_method_(Design*des, NetScope*scope, width_mode_t&) << " of signal " << use_path << endl; } - NetNet*net = 0; - ivl_type_t cls_val = 0; - const NetExpr*par = 0; - ivl_type_t par_type = 0; - NetEvent*eve = 0; - symbol_search(this, des, scope, use_path, net, par, eve, par_type, cls_val); + NetNet *net = sr.net; if (net == 0) { if (debug_elaborate) cerr << get_fileline() << ": PEIdent::test_width_method_: " @@ -4088,13 +4083,13 @@ unsigned PEIdent::test_width(Design*des, NetScope*scope, width_mode_t&mode) ivl_assert(*this, use_scope); } - if (unsigned tmp = test_width_method_(des, scope, mode)) { - return tmp; - } - symbol_search_results sr; symbol_search(this, des, use_scope, path_, &sr); + if (unsigned tmp = test_width_method_(sr)) { + return tmp; + } + // If there is a part/bit select expression, then process it // here. This constrains the results no matter what kind the // name is. diff --git a/parse.y b/parse.y index 081851b2f..07ed144e8 100644 --- a/parse.y +++ b/parse.y @@ -3776,11 +3776,10 @@ expr_primary delete $3; $$ = tmp; } - | package_scope IDENTIFIER { lex_in_package_scope(0); } '(' expression_list_with_nuls ')' - { perm_string use_name = lex_strings.make($2); - PECallFunction*tmp = new PECallFunction($1, use_name, *$5); + | package_scope hierarchy_identifier { lex_in_package_scope(0); } '(' expression_list_with_nuls ')' + { PECallFunction*tmp = new PECallFunction($1, *$2, *$5); FILE_NAME(tmp, @2); - delete[]$2; + delete $2; delete $5; $$ = tmp; }