diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-11-12 13:02:36 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-11-12 13:02:36 +0100 |
commit | 7ae3d1b5a99edf84fd543fe78ed68b0470005959 (patch) | |
tree | 7d5db102aa1fa3866f4b5df48b47d0809805f990 /frontends | |
parent | 34f2b84fb60445210ff9ffdf33b90ef6f50b91ed (diff) | |
download | yosys-7ae3d1b5a99edf84fd543fe78ed68b0470005959.tar.gz yosys-7ae3d1b5a99edf84fd543fe78ed68b0470005959.tar.bz2 yosys-7ae3d1b5a99edf84fd543fe78ed68b0470005959.zip |
More bugfixes in handling of parameters in tasks and functions
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/simplify.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 24e96f074..b7ccf7e0b 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -1773,6 +1773,7 @@ skip_dynamic_range_lvalue_expansion:; size_t arg_count = 0; std::map<std::string, std::string> replace_rules; + vector<AstNode*> added_mod_children; if (current_block == NULL) { @@ -1873,9 +1874,13 @@ skip_dynamic_range_lvalue_expansion:; wire->is_input = false; wire->is_output = false; current_ast_mod->children.push_back(wire); - while (wire->simplify(true, false, false, 1, -1, false, false)) { } + added_mod_children.push_back(wire); + + if (child->type == AST_WIRE) + while (wire->simplify(true, false, false, 1, -1, false, false)) { } replace_rules[child->str] = wire->str; + current_scope[wire->str] = wire; if ((child->is_input || child->is_output) && arg_count < children.size()) { @@ -1895,6 +1900,11 @@ skip_dynamic_range_lvalue_expansion:; } } + for (auto child : added_mod_children) { + child->replace_ids(prefix, replace_rules); + while (child->simplify(true, false, false, 1, -1, false, false)) { } + } + for (auto child : decl->children) if (child->type != AST_WIRE && child->type != AST_PARAMETER && child->type != AST_LOCALPARAM) { |