summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-02-21 13:10:36 +0100
committerClifford Wolf <clifford@clifford.at>2014-02-21 13:10:36 +0100
commitf3ff29d4107355f5a1941da67e6402644dffefa4 (patch)
tree8e62696a26b9fcc8e3d27e896d183c3ed05a5eba
parent3c5e9730924e5cc1ac5769f1fadd3f1d15a2aaa3 (diff)
Fixed instantiating multi-bit ports in edif backend
-rw-r--r--backends/edif/edif.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/edif/edif.cc b/backends/edif/edif.cc
index 1748ed81..5020cd67 100644
--- a/backends/edif/edif.cc
+++ b/backends/edif/edif.cc
@@ -303,8 +303,10 @@ struct EdifBackend : public Backend {
sig.expand();
for (int i = 0; i < sig.width; i++) {
RTLIL::SigSpec sigbit(sig.chunks.at(i));
- std::string portname = sig.width > 1 ? stringf("%s[%d]", RTLIL::id2cstr(p.first), i) : RTLIL::id2cstr(p.first);
- net_join_db[sigbit].insert(stringf("(portRef %s (instanceRef %s))", edif_names(portname).c_str(), EDIF_NAME(cell->name)));
+ if (sig.width == 1)
+ net_join_db[sigbit].insert(stringf("(portRef %s (instanceRef %s))", edif_names(RTLIL::id2cstr(p.first)).c_str(), EDIF_NAME(cell->name)));
+ else
+ net_join_db[sigbit].insert(stringf("(portRef (member %s %d) (instanceRef %s))", edif_names(RTLIL::id2cstr(p.first)).c_str(), i, EDIF_NAME(cell->name)));
}
}
}