mistral: Fix pip binding check

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2021-08-14 20:18:54 +01:00
parent a66cd0200b
commit e7db15d6a4

View File

@ -388,21 +388,28 @@ struct Arch : BaseArch<ArchRanges>
return UpDownhillPipRange(wires.at(wire).wires_uphill, wire, true); return UpDownhillPipRange(wires.at(wire).wires_uphill, wire, true);
} }
bool checkPipAvail(PipId pip) const override bool is_pip_blocked(PipId pip) const
{ {
// Check reserved routes
WireId dst(pip.dst); WireId dst(pip.dst);
const auto &dst_data = wires.at(dst); const auto &dst_data = wires.at(dst);
if ((dst_data.flags & WireInfo::RESERVED_ROUTE) != 0) { if ((dst_data.flags & WireInfo::RESERVED_ROUTE) != 0) {
if (WireId(pip.src) != dst_data.wires_uphill.at(dst_data.flags & 0xFF)) if (WireId(pip.src) != dst_data.wires_uphill.at(dst_data.flags & 0xFF))
return false; return true;
} }
return false;
}
bool checkPipAvail(PipId pip) const override
{
// Check reserved routes
if (is_pip_blocked(pip))
return false;
return BaseArch::checkPipAvail(pip); return BaseArch::checkPipAvail(pip);
} }
bool checkPipAvailForNet(PipId pip, NetInfo *net) const override bool checkPipAvailForNet(PipId pip, NetInfo *net) const override
{ {
if (!checkPipAvail(pip)) if (is_pip_blocked(pip))
return false; return false;
return BaseArch::checkPipAvailForNet(pip, net); return BaseArch::checkPipAvailForNet(pip, net);
} }