mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-04-26 12:17:01 +00:00
api: Make NetInfo* of checkPipAvailForNet const
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
@@ -93,7 +93,7 @@ template <typename R> struct ArchAPI : BaseCtx
|
||||
virtual void bindPip(PipId pip, NetInfo *net, PlaceStrength strength) = 0;
|
||||
virtual void unbindPip(PipId pip) = 0;
|
||||
virtual bool checkPipAvail(PipId pip) const = 0;
|
||||
virtual bool checkPipAvailForNet(PipId pip, NetInfo *net) const = 0;
|
||||
virtual bool checkPipAvailForNet(PipId pip, const NetInfo *net) const = 0;
|
||||
virtual NetInfo *getBoundPipNet(PipId pip) const = 0;
|
||||
virtual WireId getConflictingPipWire(PipId pip) const = 0;
|
||||
virtual NetInfo *getConflictingPipNet(PipId pip) const = 0;
|
||||
|
||||
@@ -274,7 +274,7 @@ template <typename R> struct BaseArch : ArchAPI<R>
|
||||
p2n_entry = nullptr;
|
||||
}
|
||||
virtual bool checkPipAvail(PipId pip) const override { return getBoundPipNet(pip) == nullptr; }
|
||||
virtual bool checkPipAvailForNet(PipId pip, NetInfo *net) const override
|
||||
virtual bool checkPipAvailForNet(PipId pip, const NetInfo *net) const override
|
||||
{
|
||||
NetInfo *bound_net = getBoundPipNet(pip);
|
||||
return bound_net == nullptr || bound_net == net;
|
||||
|
||||
@@ -402,7 +402,7 @@ pip to a net.
|
||||
|
||||
*BaseArch default: returns `getBoundPipNet(pip) == nullptr`*
|
||||
|
||||
### bool checkPipAvailForNet(PipId pip, NetInfo *net) const
|
||||
### bool checkPipAvailForNet(PipId pip, const NetInfo *net) const
|
||||
|
||||
Returns true if the given pip is available to be bound to a net, or if the
|
||||
pip is already bound to that net.
|
||||
|
||||
@@ -847,7 +847,7 @@ struct Arch : BaseArch<ArchRanges>
|
||||
return false;
|
||||
}
|
||||
bool checkPipAvail(PipId pip) const override { return (getBoundPipNet(pip) == nullptr) && !is_pip_blocked(pip); }
|
||||
bool checkPipAvailForNet(PipId pip, NetInfo *net) const override
|
||||
bool checkPipAvailForNet(PipId pip, const NetInfo *net) const override
|
||||
{
|
||||
NetInfo *bound_net = getBoundPipNet(pip);
|
||||
return (bound_net == nullptr || bound_net == net) && !is_pip_blocked(pip);
|
||||
|
||||
@@ -1743,7 +1743,7 @@ void Arch::bindWire(WireId wire, NetInfo *net, PlaceStrength strength)
|
||||
refreshUiWire(wire);
|
||||
}
|
||||
|
||||
bool Arch::checkPipAvailForNet(PipId pip, NetInfo *net) const
|
||||
bool Arch::checkPipAvailForNet(PipId pip, const NetInfo *net) const
|
||||
{
|
||||
NPNR_ASSERT(pip != PipId());
|
||||
auto pip_iter = pip_to_net.find(pip);
|
||||
|
||||
@@ -596,7 +596,7 @@ struct Arch : ArchAPI<ArchRanges>
|
||||
void unbindPip(PipId pip) final;
|
||||
|
||||
bool checkPipAvail(PipId pip) const final;
|
||||
bool checkPipAvailForNet(PipId pip, NetInfo *net) const final;
|
||||
bool checkPipAvailForNet(PipId pip, const NetInfo *net) const final;
|
||||
|
||||
NetInfo *getBoundPipNet(PipId pip) const final
|
||||
{
|
||||
|
||||
@@ -468,7 +468,7 @@ bool Arch::checkPipAvail(PipId pip) const
|
||||
return (!uarch || uarch->checkPipAvail(pip)) && (pip_info(pip).bound_net == nullptr);
|
||||
}
|
||||
|
||||
bool Arch::checkPipAvailForNet(PipId pip, NetInfo *net) const
|
||||
bool Arch::checkPipAvailForNet(PipId pip, const NetInfo *net) const
|
||||
{
|
||||
if (uarch && !uarch->checkPipAvailForNet(pip, net))
|
||||
return false;
|
||||
|
||||
@@ -294,7 +294,7 @@ struct Arch : BaseArch<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;
|
||||
bool checkPipAvailForNet(PipId pip, const NetInfo *net) const override;
|
||||
NetInfo *getBoundPipNet(PipId pip) const override;
|
||||
WireId getConflictingPipWire(PipId pip) const override;
|
||||
NetInfo *getConflictingPipNet(PipId pip) const override;
|
||||
|
||||
@@ -77,7 +77,7 @@ struct ViaductAPI
|
||||
// it's bound (which the base arch will deal with)
|
||||
virtual bool checkWireAvail(WireId wire) const { return true; }
|
||||
virtual bool checkPipAvail(PipId pip) const { return true; }
|
||||
virtual bool checkPipAvailForNet(PipId pip, NetInfo *net) const { return checkPipAvail(pip); };
|
||||
virtual bool checkPipAvailForNet(PipId pip, const NetInfo *net) const { return checkPipAvail(pip); };
|
||||
|
||||
// --- Route lookahead ---
|
||||
virtual delay_t estimateDelay(WireId src, WireId dst) const;
|
||||
|
||||
@@ -680,7 +680,7 @@ struct Arch : BaseArch<ArchRanges>
|
||||
return switches_locked[pi.switch_index] == WireId();
|
||||
}
|
||||
|
||||
bool checkPipAvailForNet(PipId pip, NetInfo *net) const override
|
||||
bool checkPipAvailForNet(PipId pip, const NetInfo *net) const override
|
||||
{
|
||||
if (ice40_pip_hard_unavail(pip))
|
||||
return false;
|
||||
|
||||
@@ -408,7 +408,7 @@ struct Arch : BaseArch<ArchRanges>
|
||||
return BaseArch::checkPipAvail(pip);
|
||||
}
|
||||
|
||||
bool checkPipAvailForNet(PipId pip, NetInfo *net) const override
|
||||
bool checkPipAvailForNet(PipId pip, const NetInfo *net) const override
|
||||
{
|
||||
if (is_pip_blocked(pip))
|
||||
return false;
|
||||
|
||||
@@ -1018,7 +1018,7 @@ struct Arch : BaseArch<ArchRanges>
|
||||
return getBoundPipNet(pip) == nullptr;
|
||||
}
|
||||
|
||||
bool checkPipAvailForNet(PipId pip, NetInfo *net) const override
|
||||
bool checkPipAvailForNet(PipId pip, const NetInfo *net) const override
|
||||
{
|
||||
if (disabled_pips.count(pip))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user