aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-12-22 01:31:25 +0000
committerGitHub <noreply@github.com>2020-12-22 01:31:25 +0000
commit3e67ab1ebb62a1cc69f2cb02546ae8b1cf838e07 (patch)
tree8be33088a759dd474cfc5f30ffdbacdc6782872f /frontends/ast
parentdf905709ca8bc2a92e8cef6855b53c5f032e491d (diff)
parent186d6df4c3e612667b1eb945ce3e27a92e2cb485 (diff)
downloadyosys-3e67ab1ebb62a1cc69f2cb02546ae8b1cf838e07.tar.gz
yosys-3e67ab1ebb62a1cc69f2cb02546ae8b1cf838e07.tar.bz2
yosys-3e67ab1ebb62a1cc69f2cb02546ae8b1cf838e07.zip
Merge pull request #2479 from zachjs/const-arg-hint
Allow constant function calls in constant function arguments
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/simplify.cc5
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)