aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch_place.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-21 19:03:35 +0000
committerEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-21 19:03:35 +0000
commitf176ee48cdd6b508f6f26e7b2ccca97a680929cf (patch)
tree93d8b7f0baad5b504aff26acdba441ea6ba6d8c6 /ice40/arch_place.cc
parent3eecccc6f7f8c36994e9227adfc8ab1067ea287f (diff)
parent1f6897733b57f03cf7f5ccab46c27de811d42167 (diff)
downloadnextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.tar.gz
nextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.tar.bz2
nextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.zip
Merge branch 'redist_slack' into 'redist_slack'
Redist slack See merge request eddiehung/nextpnr!5
Diffstat (limited to 'ice40/arch_place.cc')
-rw-r--r--ice40/arch_place.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc
index 1f2943a0..116ab7d3 100644
--- a/ice40/arch_place.cc
+++ b/ice40/arch_place.cc
@@ -108,21 +108,15 @@ bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const
} else if (cell->type == id_sb_io) {
return getBelPackagePin(bel) != "";
} else if (cell->type == id_sb_gb) {
- bool is_reset = false, is_cen = false;
NPNR_ASSERT(cell->ports.at(id_glb_buf_out).net != nullptr);
- for (auto user : cell->ports.at(id_glb_buf_out).net->users) {
- if (is_reset_port(this, user))
- is_reset = true;
- if (is_enable_port(this, user))
- is_cen = true;
- }
+ const NetInfo *net = cell->ports.at(id_glb_buf_out).net;
IdString glb_net = getWireName(getWireBelPin(bel, PIN_GLOBAL_BUFFER_OUTPUT));
int glb_id = std::stoi(std::string("") + glb_net.str(this).back());
- if (is_reset && is_cen)
+ if (net->is_reset && net->is_enable)
return false;
- else if (is_reset)
+ else if (net->is_reset)
return (glb_id % 2) == 0;
- else if (is_cen)
+ else if (net->is_enable)
return (glb_id % 2) == 1;
else
return true;