mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Fix handling of defparam for when default_nettype is none
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
a516b4fb5a
commit
1816fe06af
|
@ -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)
|
// (iterate by index as e.g. auto wires can add new children in the process)
|
||||||
for (size_t i = 0; i < children.size(); i++) {
|
for (size_t i = 0; i < children.size(); i++) {
|
||||||
bool did_something_here = true;
|
bool did_something_here = true;
|
||||||
|
bool backup_flag_autowire = flag_autowire;
|
||||||
if ((type == AST_GENFOR || type == AST_FOR) && i >= 3)
|
if ((type == AST_GENFOR || type == AST_FOR) && i >= 3)
|
||||||
break;
|
break;
|
||||||
if ((type == AST_GENIF || type == AST_GENCASE) && i >= 1)
|
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;
|
break;
|
||||||
if (type == AST_PREFIX && i >= 1)
|
if (type == AST_PREFIX && i >= 1)
|
||||||
break;
|
break;
|
||||||
|
if (type == AST_DEFPARAM && i == 0)
|
||||||
|
flag_autowire = true;
|
||||||
while (did_something_here && i < children.size()) {
|
while (did_something_here && i < children.size()) {
|
||||||
bool const_fold_here = const_fold, in_lvalue_here = in_lvalue;
|
bool const_fold_here = const_fold, in_lvalue_here = in_lvalue;
|
||||||
int width_hint_here = width_hint;
|
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--));
|
children.erase(children.begin() + (i--));
|
||||||
did_something = true;
|
did_something = true;
|
||||||
}
|
}
|
||||||
|
flag_autowire = backup_flag_autowire;
|
||||||
}
|
}
|
||||||
for (auto &attr : attributes) {
|
for (auto &attr : attributes) {
|
||||||
while (attr.second->simplify(true, false, false, stage, -1, false, true))
|
while (attr.second->simplify(true, false, false, stage, -1, false, true))
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
`default_nettype none
|
||||||
|
|
||||||
module hierdefparam_top(input [7:0] A, output [7:0] Y);
|
module hierdefparam_top(input [7:0] A, output [7:0] Y);
|
||||||
generate begin:foo
|
generate begin:foo
|
||||||
hierdefparam_a mod_a(.A(A), .Y(Y));
|
hierdefparam_a mod_a(.A(A), .Y(Y));
|
||||||
|
|
Loading…
Reference in a new issue