aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-05-04 08:46:24 +0200
committerClifford Wolf <clifford@clifford.at>2019-05-04 08:46:24 +0200
commit87426f5a06b0cf9d1fe44efda65e3c048d89d322 (patch)
tree18b19e16f34977758fb4df010daf389a7dce61fb /frontends/ast
parente2fb8ebe86f49523168c413c734ce4690d740351 (diff)
downloadyosys-87426f5a06b0cf9d1fe44efda65e3c048d89d322.tar.gz
yosys-87426f5a06b0cf9d1fe44efda65e3c048d89d322.tar.bz2
yosys-87426f5a06b0cf9d1fe44efda65e3c048d89d322.zip
Improve write_verilog specify support
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/genrtlil.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc
index 92205b7ae..379fed641 100644
--- a/frontends/ast/genrtlil.cc
+++ b/frontends/ast/genrtlil.cc
@@ -1492,10 +1492,12 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
continue;
}
if (child->type == AST_PARASET) {
+ int extra_const_flags = 0;
IdString paraname = child->str.empty() ? stringf("$%d", ++para_counter) : child->str;
if (child->children[0]->type == AST_REALVALUE) {
log_file_warning(filename, linenum, "Replacing floating point parameter %s.%s = %f with string.\n",
log_id(cell), log_id(paraname), child->children[0]->realvalue);
+ extra_const_flags = RTLIL::CONST_FLAG_REAL;
auto strnode = AstNode::mkconst_str(stringf("%f", child->children[0]->realvalue));
strnode->cloneInto(child->children[0]);
delete strnode;
@@ -1504,6 +1506,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
log_file_error(filename, linenum, "Parameter %s.%s with non-constant value!\n",
log_id(cell), log_id(paraname));
cell->parameters[paraname] = child->children[0]->asParaConst();
+ cell->parameters[paraname].flags |= extra_const_flags;
continue;
}
if (child->type == AST_ARGUMENT) {