diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-02-24 20:09:41 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-02-24 20:09:41 +0100 |
commit | 1816fe06af9ab2c50bd293dc10359238acc88f12 (patch) | |
tree | 00efc3732f55f86499e4f3a8f3f26e3604a6b399 /frontends/ast/simplify.cc | |
parent | a516b4fb5af0d8389fa8aede95ae5a76bec13dcf (diff) | |
download | yosys-1816fe06af9ab2c50bd293dc10359238acc88f12.tar.gz yosys-1816fe06af9ab2c50bd293dc10359238acc88f12.tar.bz2 yosys-1816fe06af9ab2c50bd293dc10359238acc88f12.zip |
Fix handling of defparam for when default_nettype is none
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'frontends/ast/simplify.cc')
-rw-r--r-- | frontends/ast/simplify.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 737fb300c..46013544b 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -642,6 +642,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, // (iterate by index as e.g. auto wires can add new children in the process) for (size_t i = 0; i < children.size(); i++) { bool did_something_here = true; + bool backup_flag_autowire = flag_autowire; if ((type == AST_GENFOR || type == AST_FOR) && i >= 3) break; if ((type == AST_GENIF || type == AST_GENCASE) && i >= 1) @@ -652,6 +653,8 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, break; if (type == AST_PREFIX && i >= 1) break; + if (type == AST_DEFPARAM && i == 0) + flag_autowire = true; while (did_something_here && i < children.size()) { bool const_fold_here = const_fold, in_lvalue_here = in_lvalue; int width_hint_here = width_hint; @@ -686,6 +689,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, children.erase(children.begin() + (i--)); did_something = true; } + flag_autowire = backup_flag_autowire; } for (auto &attr : attributes) { while (attr.second->simplify(true, false, false, stage, -1, false, true)) |