From bb92dc09a8d3450a7d356edf0ac2e9971083cf2f Mon Sep 17 00:00:00 2001 From: David Shah Date: Sat, 16 Jun 2018 17:09:41 +0200 Subject: ice40: Promote reset signal Signed-off-by: David Shah --- ice40/arch_place.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ice40/arch_place.cc') diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index 492ed846..19c95816 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -99,6 +99,20 @@ bool isValidBelForCell(Design *design, CellInfo *cell, BelId bel) return logicCellsCompatible(cells); } else if (cell->type == "SB_IO") { return design->chip.getBelPackagePin(bel) != ""; + } else if (cell->type == "SB_GB") { + bool is_reset = false, is_cen = false; + assert(cell->ports.at("GLOBAL_BUFFER_OUTPUT").net != nullptr); + for (auto user : cell->ports.at("GLOBAL_BUFFER_OUTPUT").net->users) { + if (is_reset_port(user)) + is_reset = 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) + return (glb_id % 2) == 0; + else + return true; } else { // TODO: IO cell clock checks return true; -- cgit v1.2.3