aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-06-24 22:04:22 -0700
committerEddie Hung <eddie@fpgeh.com>2019-06-24 22:04:22 -0700
commitbabadf59386550246cc56e96656c9fce775c80be (patch)
tree5e410580623917d257cb64d6c5b91574a3c81e61 /passes
parentca0225fcfaa8c9c68647034351a1569464959edf (diff)
downloadyosys-babadf59386550246cc56e96656c9fce775c80be.tar.gz
yosys-babadf59386550246cc56e96656c9fce775c80be.tar.bz2
yosys-babadf59386550246cc56e96656c9fce775c80be.zip
Do not use log_id as it strips \\, also fix scc for |wire| > 1
Diffstat (limited to 'passes')
-rw-r--r--passes/techmap/abc9.cc43
1 files changed, 30 insertions, 13 deletions
diff --git a/passes/techmap/abc9.cc b/passes/techmap/abc9.cc
index c0b0e4160..c8272153d 100644
--- a/passes/techmap/abc9.cc
+++ b/passes/techmap/abc9.cc
@@ -96,11 +96,15 @@ void handle_loops(RTLIL::Design *design)
Wire *w = b.wire;
log_assert(!w->port_input);
w->port_input = true;
- w = module->wire(stringf("%s.abci", log_id(w->name)));
- if (!w)
- w = module->addWire(stringf("%s.abci", log_id(b.wire->name)), GetSize(b.wire));
- log_assert(b.offset < GetSize(w));
- w->port_output = true;
+ w = module->wire(stringf("%s.abci", w->name.c_str()));
+ if (!w) {
+ w = module->addWire(stringf("%s.abci", b.wire->name.c_str()), GetSize(b.wire));
+ w->port_output = true;
+ }
+ else {
+ log_assert(w->port_input);
+ log_assert(b.offset < GetSize(w));
+ }
w->set_bool_attribute("\\abc_scc_break");
module->swap_names(b.wire, w);
c.second = RTLIL::SigBit(w, b.offset);
@@ -118,14 +122,27 @@ void handle_loops(RTLIL::Design *design)
auto &c = *it;
SigBit b = cell->getPort(RTLIL::escape_id(jt->second.decode_string()));
Wire *w = b.wire;
- log_assert(!w->port_output);
- w->port_output = true;
- w->set_bool_attribute("\\abc_scc_break");
- w = module->wire(stringf("%s.abci", log_id(w->name)));
- if (!w)
- w = module->addWire(stringf("%s.abci", log_id(b.wire->name)), GetSize(b.wire));
- log_assert(b.offset < GetSize(w));
- w->port_input = true;
+ if (w->port_output) {
+ log_assert(w->get_bool_attribute("\\abc_scc_break"));
+ w = module->wire(stringf("%s.abci", w->name.c_str()));
+ log_assert(w);
+ log_assert(b.offset < GetSize(w));
+ log_assert(w->port_input);
+ }
+ else {
+ log_assert(!w->port_output);
+ w->port_output = true;
+ w->set_bool_attribute("\\abc_scc_break");
+ w = module->wire(stringf("%s.abci", w->name.c_str()));
+ if (!w) {
+ w = module->addWire(stringf("%s.abci", b.wire->name.c_str()), GetSize(b.wire));
+ w->port_input = true;
+ }
+ else {
+ log_assert(w->port_input);
+ log_assert(b.offset < GetSize(w));
+ }
+ }
c.second = RTLIL::SigBit(w, b.offset);
}
}