aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2019-02-22 16:21:29 +0000
committerDavid Shah <davey1576@gmail.com>2019-02-24 10:28:25 +0100
commit0d83f3fcfe54a32b6770c3703ebbd680bb4cd5a3 (patch)
tree47ebda2b867d46208597b77606592150e1b2613f /ecp5
parentab50a6ef54bf2aa98e768e21914bb902e91b308a (diff)
downloadnextpnr-0d83f3fcfe54a32b6770c3703ebbd680bb4cd5a3.tar.gz
nextpnr-0d83f3fcfe54a32b6770c3703ebbd680bb4cd5a3.tar.bz2
nextpnr-0d83f3fcfe54a32b6770c3703ebbd680bb4cd5a3.zip
ecp5: Connect unused DQSBUF inputs to GND
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5')
-rw-r--r--ecp5/pack.cc44
1 files changed, 30 insertions, 14 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc
index d1f89a83..8a991189 100644
--- a/ecp5/pack.cc
+++ b/ecp5/pack.cc
@@ -1513,8 +1513,29 @@ class Ecp5Packer
cursor = ctx->getPipDstWire(fnd->second);
}
}
- std::unordered_map<IdString, std::pair<bool, int>> dqsbuf_dqsg;
+ void tie_zero(CellInfo *ci, IdString port)
+ {
+
+ if (!ci->ports.count(port)) {
+ ci->ports[port].name = port;
+ ci->ports[port].type = PORT_IN;
+ }
+
+ std::unique_ptr<CellInfo> zero_cell{new CellInfo};
+ std::unique_ptr<NetInfo> zero_net{new NetInfo};
+ IdString name = ctx->id(ci->name.str(ctx) + "$zero$" + port.str(ctx));
+ zero_cell->type = ctx->id("GND");
+ zero_cell->name = name;
+ zero_net->name = name;
+ zero_cell->ports[ctx->id("GND")].type = PORT_OUT;
+ connect_port(ctx, zero_net.get(), zero_cell.get(), ctx->id("GND"));
+ connect_port(ctx, zero_net.get(), ci, port);
+ ctx->nets[name] = std::move(zero_net);
+ new_cells.push_back(std::move(zero_cell));
+ }
+
+ std::unordered_map<IdString, std::pair<bool, int>> dqsbuf_dqsg;
// Pack DQSBUFs
void pack_dqsbuf()
{
@@ -1565,6 +1586,14 @@ class Ecp5Packer
}
pn->is_global = true;
}
+
+ for (auto zport :
+ {id_RDMOVE, id_RDDIRECTION, id_WRMOVE, id_WRDIRECTION, id_READ0, id_READ1, id_READCLKSEL0,
+ id_READCLKSEL1, id_READCLKSEL2, id_DYNDELAY0, id_DYNDELAY1, id_DYNDELAY2, id_DYNDELAY3,
+ id_DYNDELAY4, id_DYNDELAY5, id_DYNDELAY6, id_DYNDELAY7}) {
+ if (net_or_nullptr(ci, zport) == nullptr)
+ tie_zero(ci, zport);
+ }
}
}
}
@@ -1733,19 +1762,6 @@ class Ecp5Packer
}
};
- auto tie_zero = [&](CellInfo *ci, IdString port) {
- std::unique_ptr<CellInfo> zero_cell{new CellInfo};
- std::unique_ptr<NetInfo> zero_net{new NetInfo};
- IdString name = ctx->id(ci->name.str(ctx) + "$zero$" + port.str(ctx));
- zero_cell->type = ctx->id("GND");
- zero_cell->name = name;
- zero_net->name = name;
- zero_cell->ports[ctx->id("GND")].type = PORT_OUT;
- connect_port(ctx, zero_net.get(), zero_cell.get(), ctx->id("GND"));
- ctx->nets[name] = std::move(zero_net);
- new_cells.push_back(std::move(zero_cell));
- };
-
for (auto cell : sorted(ctx->cells)) {
CellInfo *ci = cell.second;
if (ci->type == ctx->id("DELAYF") || ci->type == ctx->id("DELAYG")) {