Merge pull request #1054 from YosysHQ/gatecat/api-add-const
api: Make NetInfo* of checkPipAvailForNet const
This commit is contained in:
commit
db25c5c889
10
.github/workflows/arch_ci.yml
vendored
10
.github/workflows/arch_ci.yml
vendored
@ -30,14 +30,14 @@ jobs:
|
||||
- name: Install
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev lzma-dev libftdi-dev clang bison flex swig qt5-default iverilog
|
||||
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev lzma-dev libftdi-dev clang bison flex swig qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools iverilog
|
||||
|
||||
- name: Cache yosys installation
|
||||
uses: actions/cache@v3
|
||||
id: cache-yosys
|
||||
with:
|
||||
path: .yosys
|
||||
key: cache-yosys-${{ env.YOSYS_REVISION }}-r2
|
||||
key: cache-yosys-${{ env.YOSYS_REVISION }}-r3
|
||||
|
||||
- name: Build yosys
|
||||
run: |
|
||||
@ -50,7 +50,7 @@ jobs:
|
||||
id: cache-icestorm
|
||||
with:
|
||||
path: .icestorm
|
||||
key: cache-icestorm-${{ env.ICESTORM_REVISION }}
|
||||
key: cache-icestorm-${{ env.ICESTORM_REVISION }}-r3
|
||||
if: matrix.arch == 'ice40'
|
||||
|
||||
- name: Build icestorm
|
||||
@ -64,7 +64,7 @@ jobs:
|
||||
id: cache-trellis
|
||||
with:
|
||||
path: .trellis
|
||||
key: cache-trellis-${{ env.TRELLIS_REVISION }}
|
||||
key: cache-trellis-${{ env.TRELLIS_REVISION }}-r3
|
||||
if: matrix.arch == 'ecp5' || matrix.arch == 'machxo2'
|
||||
|
||||
- name: Build trellis
|
||||
@ -78,7 +78,7 @@ jobs:
|
||||
id: cache-prjoxide
|
||||
with:
|
||||
path: .prjoxide
|
||||
key: cache-prjoxide-${{ env.PRJOXIDE_REVISION }}
|
||||
key: cache-prjoxide-${{ env.PRJOXIDE_REVISION }}-r3
|
||||
if: matrix.arch == 'nexus'
|
||||
|
||||
- name: Build prjoxide
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user