aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/bitstream.cc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-07-21 19:48:00 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-07-21 19:48:00 +0200
commit3175891cb53ef5f9299d2897c286a803a47c9779 (patch)
treeb642c64ae6c8418cf7a133bacb95269a4e1cee87 /ice40/bitstream.cc
parent57c63e692199c2e747e2c5229041d55303a067b0 (diff)
downloadnextpnr-3175891cb53ef5f9299d2897c286a803a47c9779.tar.gz
nextpnr-3175891cb53ef5f9299d2897c286a803a47c9779.tar.bz2
nextpnr-3175891cb53ef5f9299d2897c286a803a47c9779.zip
Map ports to nets
Diffstat (limited to 'ice40/bitstream.cc')
-rw-r--r--ice40/bitstream.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc
index 65c90eb1..8819a643 100644
--- a/ice40/bitstream.cc
+++ b/ice40/bitstream.cc
@@ -758,6 +758,20 @@ bool read_asc(Context *ctx, std::istream &in)
}
}
}
+ for (auto &cell : ctx->cells) {
+ if (cell.second->bel != BelId()) {
+ for (auto &port : cell.second->ports) {
+ PortPin pin = ctx->portPinFromId(port.first);
+ WireId wire = ctx->getWireBelPin(cell.second->bel, pin);
+ if (wire != WireId()) {
+ IdString name = ctx->getBoundWireNet(wire);
+ if (name != IdString()) {
+ port.second.net = ctx->nets[name].get();
+ }
+ }
+ }
+ }
+ }
return true;
} catch (log_execution_error_exception) {
return false;