aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast/genrtlil.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-05-27 13:25:52 +0200
committerGitHub <noreply@github.com>2019-05-27 13:25:52 +0200
commit40a070e269ac5dbc88d2f81a4d9b340ecb524009 (patch)
treefff2c69cd5f045777b43a93469793fd7375f081d /frontends/ast/genrtlil.cc
parent2a9c68e2d6e0d58ac9e1ef8e8eb4c21eb979b380 (diff)
parent34417ce55f1b1d71ac11dfdfecfffc7a3340b6cb (diff)
downloadyosys-40a070e269ac5dbc88d2f81a4d9b340ecb524009.tar.gz
yosys-40a070e269ac5dbc88d2f81a4d9b340ecb524009.tar.bz2
yosys-40a070e269ac5dbc88d2f81a4d9b340ecb524009.zip
Merge pull request #1043 from mmicko/unsized_constant
Added support for unsized constants, fixes #1022
Diffstat (limited to 'frontends/ast/genrtlil.cc')
-rw-r--r--frontends/ast/genrtlil.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc
index 379fed641..d9dfc17cc 100644
--- a/frontends/ast/genrtlil.cc
+++ b/frontends/ast/genrtlil.cc
@@ -963,8 +963,13 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
detectSignWidth(width_hint, sign_hint);
is_signed = sign_hint;
- if (type == AST_CONSTANT)
- return RTLIL::SigSpec(bitsAsConst());
+ if (type == AST_CONSTANT) {
+ if (is_unsized) {
+ return RTLIL::SigSpec(bitsAsUnsizedConst(width_hint));
+ } else {
+ return RTLIL::SigSpec(bitsAsConst());
+ }
+ }
RTLIL::SigSpec sig = realAsConst(width_hint);
log_file_warning(filename, linenum, "converting real value %e to binary %s.\n", realvalue, log_signal(sig));