aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-08-20 11:37:26 +0200
committerGitHub <noreply@github.com>2019-08-20 11:37:26 +0200
commitc25c1e742ba6e0ac481eb625e9e5eca84fc92632 (patch)
tree02340c9adc659be859533263273fa55aa85cc597
parent749ff864aa708cb069fc5c356e5db69664fdd93e (diff)
parent24971fda87e66af528aeeffab841a64fc960410a (diff)
downloadyosys-c25c1e742ba6e0ac481eb625e9e5eca84fc92632.tar.gz
yosys-c25c1e742ba6e0ac481eb625e9e5eca84fc92632.tar.bz2
yosys-c25c1e742ba6e0ac481eb625e9e5eca84fc92632.zip
Merge pull request #1308 from jakobwenzel/real_params
Handle real values when deriving ast modules
-rw-r--r--frontends/ast/ast.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc
index 0d6626b19..82283fb5b 100644
--- a/frontends/ast/ast.cc
+++ b/frontends/ast/ast.cc
@@ -1502,7 +1502,10 @@ std::string AstModule::derive_common(RTLIL::Design *design, dict<RTLIL::IdString
rewrite_parameter:
para_info += stringf("%s=%s", child->str.c_str(), log_signal(RTLIL::SigSpec(parameters[para_id])));
delete child->children.at(0);
- if ((parameters[para_id].flags & RTLIL::CONST_FLAG_STRING) != 0)
+ if ((parameters[para_id].flags & RTLIL::CONST_FLAG_REAL) != 0) {
+ child->children[0] = new AstNode(AST_REALVALUE);
+ child->children[0]->realvalue = std::stod(parameters[para_id].decode_string());
+ } else if ((parameters[para_id].flags & RTLIL::CONST_FLAG_STRING) != 0)
child->children[0] = AstNode::mkconst_str(parameters[para_id].decode_string());
else
child->children[0] = AstNode::mkconst_bits(parameters[para_id].bits, (parameters[para_id].flags & RTLIL::CONST_FLAG_SIGNED) != 0);