diff options
author | clairexen <claire@symbioticeda.com> | 2020-06-30 17:38:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 17:38:49 +0200 |
commit | 9d658a19708b99288bed2d8c8da3a2fe987a21b3 (patch) | |
tree | ee4abec0ec1a1c095e440261f85f47ab78e3dd41 /frontends | |
parent | 3fb5b4fd8a04179a95b14384a4fd34e87ef7e8e6 (diff) | |
parent | 27cec16cda7d10e94931b25711358da2b382fdbf (diff) | |
download | yosys-9d658a19708b99288bed2d8c8da3a2fe987a21b3.tar.gz yosys-9d658a19708b99288bed2d8c8da3a2fe987a21b3.tar.bz2 yosys-9d658a19708b99288bed2d8c8da3a2fe987a21b3.zip |
Merge pull request #2136 from zachjs/master
Allow constant function calls in for loops and generate if and case
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/simplify.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 55e7da0aa..c819924a0 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -1126,6 +1126,10 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, bool in_param_here = in_param; if (i == 0 && (type == AST_REPLICATE || type == AST_WIRE)) const_fold_here = true, in_param_here = true; + if (i == 0 && (type == AST_GENIF || type == AST_GENCASE)) + in_param_here = true; + if (i == 1 && (type == AST_FOR || type == AST_GENFOR)) + in_param_here = true; if (type == AST_PARAMETER || type == AST_LOCALPARAM) const_fold_here = true; if (i == 0 && (type == AST_ASSIGN || type == AST_ASSIGN_EQ || type == AST_ASSIGN_LE)) @@ -1942,7 +1946,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, continue; buf = child->clone(); - while (buf->simplify(true, false, false, stage, width_hint, sign_hint, false)) { } + while (buf->simplify(true, false, false, stage, width_hint, sign_hint, true)) { } if (buf->type != AST_CONSTANT) { // for (auto f : log_files) // dumpAst(f, "verilog-ast> "); |