diff options
author | Zachary Snow <zach@zachjs.com> | 2020-12-07 13:52:44 -0700 |
---|---|---|
committer | Zachary Snow <zach@zachjs.com> | 2020-12-07 13:53:27 -0700 |
commit | 186d6df4c3e612667b1eb945ce3e27a92e2cb485 (patch) | |
tree | 026b6aad7e7f6b0974223eaf9cfb2e6b9207f1c7 /frontends/ast | |
parent | 95c60866813e520da48c628d4f98a2fe2cb4db25 (diff) | |
download | yosys-186d6df4c3e612667b1eb945ce3e27a92e2cb485.tar.gz yosys-186d6df4c3e612667b1eb945ce3e27a92e2cb485.tar.bz2 yosys-186d6df4c3e612667b1eb945ce3e27a92e2cb485.zip |
Allow constant function calls in constant function arguments
Diffstat (limited to 'frontends/ast')
-rw-r--r-- | frontends/ast/simplify.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index fb6623f02..8e205cb76 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -1205,6 +1205,11 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, current_block = this; current_block_child = children[i]; } + if (!in_param_here && type == AST_FCALL) { + bool recommend_const_eval = false; + bool require_const_eval = has_const_only_constructs(recommend_const_eval); + in_param_here = recommend_const_eval || require_const_eval; + } if ((type == AST_ALWAYS || type == AST_INITIAL) && children[i]->type == AST_BLOCK) current_top_block = children[i]; if (i == 0 && child_0_is_self_determined) |