summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/genrtlil.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc
index d32b4434..f3ca0c78 100644
--- a/frontends/ast/genrtlil.cc
+++ b/frontends/ast/genrtlil.cc
@@ -966,6 +966,8 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
sig.width += s.chunks[i].width;
}
}
+ if (sig.width < width_hint)
+ sig.extend(width_hint, false);
return sig;
}
@@ -979,6 +981,8 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
RTLIL::SigSpec sig;
for (int i = 0; i < count; i++)
sig.append(right);
+ if (sig.width < width_hint)
+ sig.extend(width_hint, false);
is_signed = false;
return sig;
}