diff options
author | David Shah <davey1576@gmail.com> | 2018-06-16 17:44:35 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-16 17:44:35 +0200 |
commit | 1e6124309fb02824c43549e0861d4023fc5827d8 (patch) | |
tree | 9b60248aa76cb911fe6af0eca037113d1af986b6 /ice40/arch_place.cc | |
parent | bb92dc09a8d3450a7d356edf0ac2e9971083cf2f (diff) | |
download | nextpnr-1e6124309fb02824c43549e0861d4023fc5827d8.tar.gz nextpnr-1e6124309fb02824c43549e0861d4023fc5827d8.tar.bz2 nextpnr-1e6124309fb02824c43549e0861d4023fc5827d8.zip |
ice40: Proper global promotion
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/arch_place.cc')
-rw-r--r-- | ice40/arch_place.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index 19c95816..c991af13 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -105,12 +105,18 @@ bool isValidBelForCell(Design *design, CellInfo *cell, BelId bel) for (auto user : cell->ports.at("GLOBAL_BUFFER_OUTPUT").net->users) { if (is_reset_port(user)) is_reset = true; + if (is_enable_port(user)) + is_cen = true; } IdString glb_net = chip.getWireName( chip.getWireBelPin(bel, PIN_GLOBAL_BUFFER_OUTPUT)); int glb_id = std::stoi(std::string("") + glb_net.str().back()); - if (is_reset) + if (is_reset && is_cen) + return false; + else if (is_reset) return (glb_id % 2) == 0; + else if (is_cen) + return (glb_id % 2) == 1; else return true; } else { |