aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorJannis Harder <me@jix.one>2022-08-30 13:58:09 +0200
committerJannis Harder <me@jix.one>2022-12-07 18:21:36 +0100
commitdd8b412833b85cfffb6371b1f75340233b83a0bd (patch)
tree36c7ed03038fc193cf4bcdcdabd366c7c3117431 /frontends
parent1f6ac926a45cd5b757a3ea171777a9a2830cff3f (diff)
downloadyosys-dd8b412833b85cfffb6371b1f75340233b83a0bd.tar.gz
yosys-dd8b412833b85cfffb6371b1f75340233b83a0bd.tar.bz2
yosys-dd8b412833b85cfffb6371b1f75340233b83a0bd.zip
simplify: Do not recursively simplify AST_CELL within AST_CELLARRAY
Otherwise the AST_CELL simplification uses the wrong celltype before the AST_CELLARRAY simplification has a chance to unroll it and change it to the $array celltype.
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/simplify.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 57237f4b3..91c4d1472 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -1627,6 +1627,8 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
break;
if (type == AST_GENBLOCK)
break;
+ if (type == AST_CELLARRAY && children[i]->type == AST_CELL)
+ continue;
if (type == AST_BLOCK && !str.empty())
break;
if (type == AST_PREFIX && i >= 1)