aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2020-06-29 11:56:43 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2020-06-29 11:56:43 +0200
commit87717d67d1bf24e0fa120a16dda71a47b33fa347 (patch)
tree30b189327522acd24ddf3c9e56235791a91770d2
parentb822beb1b2e667459f4864b759b7f4d82a064354 (diff)
downloadyosys-87717d67d1bf24e0fa120a16dda71a47b33fa347.tar.gz
yosys-87717d67d1bf24e0fa120a16dda71a47b33fa347.tar.bz2
yosys-87717d67d1bf24e0fa120a16dda71a47b33fa347.zip
expose pass fix
-rw-r--r--passes/sat/expose.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/passes/sat/expose.cc b/passes/sat/expose.cc
index 5fe7efc34..e115b184e 100644
--- a/passes/sat/expose.cc
+++ b/passes/sat/expose.cc
@@ -445,6 +445,8 @@ struct ExposePass : public Pass {
SigMap out_to_in_map;
+ std::map<RTLIL::Wire*, RTLIL::IdString> wire_map;
+
for (auto w : module->wires())
{
if (flag_shared) {
@@ -462,8 +464,7 @@ struct ExposePass : public Pass {
if (!w->port_input) {
w->port_input = true;
log("New module port: %s/%s\n", RTLIL::id2cstr(module->name), RTLIL::id2cstr(w->name));
- RTLIL::Wire *in_wire = module->addWire(NEW_ID, GetSize(w));
- out_to_in_map.add(w, in_wire);
+ wire_map[w] = NEW_ID;
}
}
else
@@ -474,12 +475,22 @@ struct ExposePass : public Pass {
}
if (flag_cut) {
- RTLIL::Wire *in_wire = add_new_wire(module, w->name.str() + sep + "i", w->width);
- in_wire->port_input = true;
- out_to_in_map.add(sigmap(w), in_wire);
+ wire_map[w] = w->name.str() + sep + "i";
}
}
}
+ for (auto &wm : wire_map)
+ {
+ if (flag_input) {
+ RTLIL::Wire *in_wire = module->addWire(wm.second, GetSize(wm.first));
+ out_to_in_map.add(wm.first, in_wire);
+ }
+ if (flag_cut) {
+ RTLIL::Wire *in_wire = add_new_wire(module, wm.second, wm.first->width);
+ in_wire->port_input = true;
+ out_to_in_map.add(sigmap(wm.first), in_wire);
+ }
+ }
if (flag_input)
{