diff --git a/common/kernel/arch_api.h b/common/kernel/arch_api.h index 14a30652..49be489b 100644 --- a/common/kernel/arch_api.h +++ b/common/kernel/arch_api.h @@ -93,7 +93,7 @@ template 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; diff --git a/common/kernel/base_arch.h b/common/kernel/base_arch.h index 3055619d..55fcf280 100644 --- a/common/kernel/base_arch.h +++ b/common/kernel/base_arch.h @@ -274,7 +274,7 @@ template struct BaseArch : ArchAPI 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; diff --git a/docs/archapi.md b/docs/archapi.md index 3fc30cdb..efd833d2 100644 --- a/docs/archapi.md +++ b/docs/archapi.md @@ -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. diff --git a/ecp5/arch.h b/ecp5/arch.h index 12f043b7..86504520 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -847,7 +847,7 @@ struct Arch : BaseArch 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); diff --git a/fpga_interchange/arch.cc b/fpga_interchange/arch.cc index 3ce9f79e..4fc5d48d 100644 --- a/fpga_interchange/arch.cc +++ b/fpga_interchange/arch.cc @@ -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); diff --git a/fpga_interchange/arch.h b/fpga_interchange/arch.h index aeb5578f..04f583d4 100644 --- a/fpga_interchange/arch.h +++ b/fpga_interchange/arch.h @@ -596,7 +596,7 @@ struct Arch : ArchAPI 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 { diff --git a/generic/arch.cc b/generic/arch.cc index 9992e1cd..a1d98200 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -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; diff --git a/generic/arch.h b/generic/arch.h index 688392da..6b34c289 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -294,7 +294,7 @@ struct Arch : BaseArch 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; diff --git a/generic/viaduct_api.h b/generic/viaduct_api.h index bc9b4311..6f8adb3e 100644 --- a/generic/viaduct_api.h +++ b/generic/viaduct_api.h @@ -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; diff --git a/ice40/arch.h b/ice40/arch.h index 5ed2347d..498a8b71 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -680,7 +680,7 @@ struct Arch : BaseArch 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; diff --git a/mistral/arch.h b/mistral/arch.h index 8fcea291..5ceda53c 100644 --- a/mistral/arch.h +++ b/mistral/arch.h @@ -408,7 +408,7 @@ struct Arch : BaseArch 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; diff --git a/nexus/arch.h b/nexus/arch.h index df4f976a..41c54cd8 100644 --- a/nexus/arch.h +++ b/nexus/arch.h @@ -1018,7 +1018,7 @@ struct Arch : BaseArch 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;