diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-11-11 17:28:41 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-11-11 17:28:41 +0100 |
commit | f93129634b479ba54d8e33186eb79f412eaeb4a9 (patch) | |
tree | 9f38835ee9187160307f89132cac0e57c7a3aebf /ice40 | |
parent | ee8826b6e86fdce793a4c58ee685bd6cae5d796e (diff) | |
download | nextpnr-f93129634b479ba54d8e33186eb79f412eaeb4a9.tar.gz nextpnr-f93129634b479ba54d8e33186eb79f412eaeb4a9.tar.bz2 nextpnr-f93129634b479ba54d8e33186eb79f412eaeb4a9.zip |
Add getConflictingWireWire() arch API, streamline getConflictingXY semantic
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/arch.h | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/ice40/arch.h b/ice40/arch.h index 46f2b348..2967ee1f 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -566,6 +566,11 @@ struct Arch : BaseCtx return wire_to_net[wire.index]; } + WireId getConflictingWireWire(WireId wire) const + { + return wire; + } + NetInfo *getConflictingWireNet(WireId wire) const { NPNR_ASSERT(wire != WireId()); @@ -642,49 +647,59 @@ struct Arch : BaseCtx refreshUiWire(dst); } - bool checkPipAvail(PipId pip) const + bool ice40_pip_hard_unavail(PipId pip) const { NPNR_ASSERT(pip != PipId()); auto &pi = chip_info->pip_data[pip.index]; auto &si = chip_info->bits_info->switches[pi.switch_index]; - if (switches_locked[pi.switch_index] != WireId()) - return false; - if (pi.flags & PipInfoPOD::FLAG_ROUTETHRU) { NPNR_ASSERT(si.bel >= 0); if (bel_to_cell[si.bel] != nullptr) - return false; + return true; } if (pi.flags & PipInfoPOD::FLAG_NOCARRY) { NPNR_ASSERT(si.bel >= 0); if (bel_carry[si.bel]) - return false; + return true; } - return true; + return false; } - NetInfo *getBoundPipNet(PipId pip) const + bool checkPipAvail(PipId pip) const { - NPNR_ASSERT(pip != PipId()); - return pip_to_net[pip.index]; + if (ice40_pip_hard_unavail(pip)) + return false; + + auto &pi = chip_info->pip_data[pip.index]; + return switches_locked[pi.switch_index] == WireId(); } - NetInfo *getConflictingPipNet(PipId pip) const + NetInfo *getBoundPipNet(PipId pip) const { NPNR_ASSERT(pip != PipId()); - WireId wire = switches_locked[chip_info->pip_data[pip.index].switch_index]; - return wire == WireId() ? nullptr : wire_to_net[wire.index]; + return pip_to_net[pip.index]; } WireId getConflictingPipWire(PipId pip) const { - NPNR_ASSERT(pip != PipId()); + if (ice40_pip_hard_unavail(pip)) + return WireId(); + return switches_locked[chip_info->pip_data[pip.index].switch_index]; } + NetInfo *getConflictingPipNet(PipId pip) const + { + if (ice40_pip_hard_unavail(pip)) + return nullptr; + + WireId wire = switches_locked[chip_info->pip_data[pip.index].switch_index]; + return wire == WireId() ? nullptr : wire_to_net[wire.index]; + } + AllPipRange getPips() const { AllPipRange range; |