aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-11-11 00:02:28 +0100
committerClifford Wolf <clifford@clifford.at>2013-11-11 00:39:45 +0100
commite5b974fa2af7ee372eb7ee4f59322099ee3c1bf9 (patch)
treedba5018d12a4bca14c5c2adef8adaca1aa0dbebe /frontends
parent0fd3ebdb23dd1116a37c5277596d367487a283fb (diff)
downloadyosys-e5b974fa2af7ee372eb7ee4f59322099ee3c1bf9.tar.gz
yosys-e5b974fa2af7ee372eb7ee4f59322099ee3c1bf9.tar.bz2
yosys-e5b974fa2af7ee372eb7ee4f59322099ee3c1bf9.zip
Cleanups and bugfixes in response to new internal cell checker
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/genrtlil.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc
index 25781ae23..e64193f6e 100644
--- a/frontends/ast/genrtlil.cc
+++ b/frontends/ast/genrtlil.cc
@@ -1199,7 +1199,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
addr_bits++;
cell->connections["\\CLK"] = RTLIL::SigSpec(RTLIL::State::Sx, 1);
- cell->connections["\\ADDR"] = children[0]->genRTLIL();
+ cell->connections["\\ADDR"] = children[0]->genWidthRTLIL(addr_bits);
cell->connections["\\DATA"] = RTLIL::SigSpec(wire);
cell->parameters["\\MEMID"] = RTLIL::Const(str);
@@ -1229,10 +1229,13 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
addr_bits++;
cell->connections["\\CLK"] = RTLIL::SigSpec(RTLIL::State::Sx, 1);
- cell->connections["\\ADDR"] = children[0]->genRTLIL();
- cell->connections["\\DATA"] = children[1]->genRTLIL();
+ cell->connections["\\ADDR"] = children[0]->genWidthRTLIL(addr_bits);
+ cell->connections["\\DATA"] = children[1]->genWidthRTLIL(current_module->memories[str]->width);
cell->connections["\\EN"] = children[2]->genRTLIL();
+ if (cell->connections["\\EN"].width > 1)
+ cell->connections["\\EN"] = uniop2rtlil(this, "$reduce_bool", 1, cell->connections["\\EN"], false);
+
cell->parameters["\\MEMID"] = RTLIL::Const(str);
cell->parameters["\\ABITS"] = RTLIL::Const(addr_bits);
cell->parameters["\\WIDTH"] = RTLIL::Const(current_module->memories[str]->width);