diff options
author | David Shah <dave@ds0.me> | 2018-10-05 16:47:03 +0100 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2018-10-05 16:47:03 +0100 |
commit | cd688a278435c8ea86aee365c02b3ba1af7d3a26 (patch) | |
tree | ea5b6c26d2fe26895d55f0fe85e918e5c284379c /ecp5/pack.cc | |
parent | 85a95ec2508db54c503605d03f242ddfd92d7145 (diff) | |
download | nextpnr-cd688a278435c8ea86aee365c02b3ba1af7d3a26.tar.gz nextpnr-cd688a278435c8ea86aee365c02b3ba1af7d3a26.tar.bz2 nextpnr-cd688a278435c8ea86aee365c02b3ba1af7d3a26.zip |
ecp5: Fixing EBR constant tie-offs
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/pack.cc')
-rw-r--r-- | ecp5/pack.cc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 0045617b..47480dee 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -909,10 +909,59 @@ class Ecp5Packer } } + void autocreate_empty_port(CellInfo *cell, IdString port) + { + if (!cell->ports.count(port)) { + cell->ports[port].name = port; + cell->ports[port].net = nullptr; + cell->ports[port].type = PORT_IN; + } + } + + // Pack EBR + void pack_ebr() + { + for (auto cell : sorted(ctx->cells)) { + CellInfo *ci = cell.second; + if (ci->type == id_DP16KD) { + // Add ports, even if disconnected, to ensure correct tie-offs + for (int i = 0; i < 14; i++) { + autocreate_empty_port(ci, ctx->id("ADA" + std::to_string(i))); + autocreate_empty_port(ci, ctx->id("ADB" + std::to_string(i))); + } + for (int i = 0; i < 18; i++) { + autocreate_empty_port(ci, ctx->id("DIA" + std::to_string(i))); + autocreate_empty_port(ci, ctx->id("DIB" + std::to_string(i))); + } + for (int i = 0; i < 3; i++) { + autocreate_empty_port(ci, ctx->id("CSA" + std::to_string(i))); + autocreate_empty_port(ci, ctx->id("CSB" + std::to_string(i))); + } + for (int i = 0; i < 3; i++) { + autocreate_empty_port(ci, ctx->id("CSA" + std::to_string(i))); + autocreate_empty_port(ci, ctx->id("CSB" + std::to_string(i))); + } + + autocreate_empty_port(ci, id_CLKA); + autocreate_empty_port(ci, id_CEA); + autocreate_empty_port(ci, id_OCEA); + autocreate_empty_port(ci, id_WEA); + autocreate_empty_port(ci, id_RSTA); + + autocreate_empty_port(ci, id_CLKB); + autocreate_empty_port(ci, id_CEB); + autocreate_empty_port(ci, id_OCEB); + autocreate_empty_port(ci, id_WEB); + autocreate_empty_port(ci, id_RSTB); + } + } + } + public: void pack() { pack_io(); + pack_ebr(); pack_constants(); pack_dram(); pack_carries(); |