aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorJannis Harder <me@jix.one>2023-04-24 16:08:48 +0200
committerGitHub <noreply@github.com>2023-04-24 16:08:48 +0200
commitcee3cb31b98e3b67af3165969c8cfc0616c37e19 (patch)
treef146d725bdaf0262f04bcd6092a34abbd127f3ad /frontends
parent51dd0290241c521f5498f71f4fd4fb0598d83a76 (diff)
parent985f4926b77aef98a2639624a44e155b2233c3ad (diff)
downloadyosys-master.tar.gz
yosys-master.tar.bz2
yosys-master.zip
Merge pull request #3734 from jix/fix_unbased_unsized_constHEADmaster
verilog: Fix const eval of unbased unsized constants
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/ast.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc
index 5a2ade04a..91001c70d 100644
--- a/frontends/ast/ast.cc
+++ b/frontends/ast/ast.cc
@@ -847,7 +847,7 @@ RTLIL::Const AstNode::bitsAsConst(int width, bool is_signed)
bits.resize(width);
if (width >= 0 && width > int(bits.size())) {
RTLIL::State extbit = RTLIL::State::S0;
- if (is_signed && !bits.empty())
+ if ((is_signed || is_unsized) && !bits.empty())
extbit = bits.back();
while (width > int(bits.size()))
bits.push_back(extbit);