aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast/genrtlil.cc
diff options
context:
space:
mode:
authorZachary Snow <zach@zachjs.com>2021-07-29 12:35:22 -0400
committerZachary Snow <zachary.j.snow@gmail.com>2021-07-29 20:55:31 -0400
commit4fec3a85cd7d0fcd35f958bfc89090df25f7de3c (patch)
treee78acff59083ecd64fac829b0d3d33548f76329e /frontends/ast/genrtlil.cc
parent87ef1dd80536d65fde3833c7a504c9b5de5c3ea9 (diff)
downloadyosys-4fec3a85cd7d0fcd35f958bfc89090df25f7de3c.tar.gz
yosys-4fec3a85cd7d0fcd35f958bfc89090df25f7de3c.tar.bz2
yosys-4fec3a85cd7d0fcd35f958bfc89090df25f7de3c.zip
genrtlil: add width detection for AST_PREFIX nodes
Diffstat (limited to 'frontends/ast/genrtlil.cc')
-rw-r--r--frontends/ast/genrtlil.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc
index 90d5f1bba..45aab9d8e 100644
--- a/frontends/ast/genrtlil.cc
+++ b/frontends/ast/genrtlil.cc
@@ -993,6 +993,14 @@ void AstNode::detectSignWidthWorker(int &width_hint, bool &sign_hint, bool *foun
break;
}
+ case AST_PREFIX:
+ // Prefix nodes always resolve to identifiers in generate loops, so we
+ // can simply perform the resolution to determine the sign and width.
+ simplify(true, false, false, 1, -1, false, false);
+ log_assert(type == AST_IDENTIFIER);
+ detectSignWidthWorker(width_hint, sign_hint, found_real);
+ break;
+
case AST_FCALL:
if (str == "\\$anyconst" || str == "\\$anyseq" || str == "\\$allconst" || str == "\\$allseq") {
if (GetSize(children) == 1) {