diff options
author | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-03-18 16:31:40 -0700 |
---|---|---|
committer | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-03-22 09:17:55 -0700 |
commit | e7d81913a48bffd970f7a92acc44eb36d9f996f7 (patch) | |
tree | 93704cb3edc4497651e23adfb7d6541eab1bb907 /generic | |
parent | 53ed6979a964f3eaaabc0d97399eec9b4c3347f9 (diff) | |
download | nextpnr-e7d81913a48bffd970f7a92acc44eb36d9f996f7.tar.gz nextpnr-e7d81913a48bffd970f7a92acc44eb36d9f996f7.tar.bz2 nextpnr-e7d81913a48bffd970f7a92acc44eb36d9f996f7.zip |
Add "checkPipAvailForNet" to Arch API.
This is important for distiguishing valid pseudo pips in the FPGA
interchange arch. This also avoids a double or triple lookup of
pip->net map.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'generic')
-rw-r--r-- | generic/arch.cc | 6 | ||||
-rw-r--r-- | generic/arch.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/generic/arch.cc b/generic/arch.cc index 1f9531c7..a683e34e 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -450,6 +450,12 @@ void Arch::unbindPip(PipId pip) bool Arch::checkPipAvail(PipId pip) const { return pips.at(pip).bound_net == nullptr; } +bool Arch::checkPipAvailForNet(PipId pip, NetInfo *net) const +{ + NetInfo *bound_net = pips.at(pip).bound_net; + return bound_net == nullptr || bound_net == net; +} + NetInfo *Arch::getBoundPipNet(PipId pip) const { return pips.at(pip).bound_net; } NetInfo *Arch::getConflictingPipNet(PipId pip) const { return pips.at(pip).bound_net; } diff --git a/generic/arch.h b/generic/arch.h index 1d37b2fd..92260ce0 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -279,6 +279,7 @@ struct Arch : ArchAPI<ArchRanges> void bindPip(PipId pip, NetInfo *net, PlaceStrength strength) override; void unbindPip(PipId pip) override; bool checkPipAvail(PipId pip) const override; + bool checkPipAvailForNet(PipId pip, NetInfo *net) const override; NetInfo *getBoundPipNet(PipId pip) const override; WireId getConflictingPipWire(PipId pip) const override; NetInfo *getConflictingPipNet(PipId pip) const override; |