aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-27 16:16:38 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-27 16:16:38 +0200
commit28e851cf456bc0211cd9bf866f0049b14e6cab68 (patch)
tree9cee5ad67edc8cdc2924405b0a1948de725f3ecd /ice40
parent885fe93a17fc841912c5a58bcf6c89668f453a4d (diff)
downloadnextpnr-28e851cf456bc0211cd9bf866f0049b14e6cab68.tar.gz
nextpnr-28e851cf456bc0211cd9bf866f0049b14e6cab68.tar.bz2
nextpnr-28e851cf456bc0211cd9bf866f0049b14e6cab68.zip
ice40: Fix IO packer
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/pack.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 69bea740..9191255d 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -326,6 +326,7 @@ static void pack_constants(Context *ctx)
gnd_net->name = ctx->id("$PACKER_GND_NET");
gnd_net->driver.cell = gnd_cell.get();
gnd_net->driver.port = ctx->id("O");
+ gnd_cell->ports.at(ctx->id("O")).net = gnd_net.get();
std::unique_ptr<CellInfo> vcc_cell = create_ice_cell(ctx, ctx->id("ICESTORM_LC"), "$PACKER_VCC");
vcc_cell->params[ctx->id("LUT_INIT")] = "1";
@@ -333,6 +334,7 @@ static void pack_constants(Context *ctx)
vcc_net->name = ctx->id("$PACKER_VCC_NET");
vcc_net->driver.cell = vcc_cell.get();
vcc_net->driver.port = ctx->id("O");
+ vcc_cell->ports.at(ctx->id("O")).net = vcc_net.get();
std::vector<IdString> dead_nets;
@@ -402,6 +404,12 @@ static void pack_io(Context *ctx)
ctx->nets.erase(net->name);
sb->ports.at(ctx->id("PACKAGE_PIN")).net = nullptr;
}
+ if (ci->type == ctx->id("$nextpnr_iobuf")) {
+ NetInfo *net2 = ci->ports.at(ctx->id("I")).net;
+ if (net2 != nullptr) {
+ ctx->nets.erase(net2->name);
+ }
+ }
} else {
// Create a SB_IO buffer
std::unique_ptr<CellInfo> ice_cell =