From 0d83f3fcfe54a32b6770c3703ebbd680bb4cd5a3 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 22 Feb 2019 16:21:29 +0000 Subject: ecp5: Connect unused DQSBUF inputs to GND Signed-off-by: David Shah --- ecp5/pack.cc | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'ecp5') 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> 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 zero_cell{new CellInfo}; + std::unique_ptr 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> 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 zero_cell{new CellInfo}; - std::unique_ptr 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")) { -- cgit v1.2.3