diff options
| author | Zachary Snow <zach@zachjs.com> | 2020-08-29 13:31:02 -0400 | 
|---|---|---|
| committer | Zachary Snow <zach@zachjs.com> | 2020-08-29 13:31:02 -0400 | 
| commit | ecc5c23b4d3ec42599b80f5f4dc8699f024124be (patch) | |
| tree | dd4184715b0b0330c5126e1f0a9b0c864e4a3cf1 /frontends/ast | |
| parent | 082cbcb4c7c4fa6984f86f8edb2e1d16e8ad3a41 (diff) | |
| download | yosys-ecc5c23b4d3ec42599b80f5f4dc8699f024124be.tar.gz yosys-ecc5c23b4d3ec42599b80f5f4dc8699f024124be.tar.bz2 yosys-ecc5c23b4d3ec42599b80f5f4dc8699f024124be.zip | |
Fix constant args used with function ports split across declarations
Diffstat (limited to 'frontends/ast')
| -rw-r--r-- | frontends/ast/simplify.cc | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 7f9795d29..2a5ad99c8 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -3211,14 +3211,15 @@ skip_dynamic_range_lvalue_expansion:;  				if (wire_cache.count(child->str))  				{  					wire = wire_cache.at(child->str); -					if (wire->children.empty()) { +					bool contains_value = wire->type == AST_LOCALPARAM; +					if (wire->children.size() == contains_value) {  						for (auto c : child->children)  							wire->children.push_back(c->clone());  					} else if (!child->children.empty()) {  						while (child->simplify(true, false, false, stage, -1, false, false)) { } -						if (GetSize(child->children) == GetSize(wire->children)) { +						if (GetSize(child->children) == GetSize(wire->children) - contains_value) {  							for (int i = 0; i < GetSize(child->children); i++) -								if (*child->children.at(i) != *wire->children.at(i)) +								if (*child->children.at(i) != *wire->children.at(i + contains_value))  									goto tcall_incompatible_wires;  						} else {  					tcall_incompatible_wires: | 
