diff options
-rw-r--r-- | generic/arch.cc | 7 | ||||
-rw-r--r-- | generic/arch.h | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/generic/arch.cc b/generic/arch.cc index 1a8b1a67..8c7a7670 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -90,6 +90,7 @@ void Arch::addBelInput(IdString bel, IdString name, IdString wire) pi.type = PORT_IN; wires.at(wire).downhill_bel_pins.push_back(BelPin{bel, name}); + wires.at(wire).bel_pins.push_back(BelPin{bel, name}); } void Arch::addBelOutput(IdString bel, IdString name, IdString wire) @@ -101,6 +102,7 @@ void Arch::addBelOutput(IdString bel, IdString name, IdString wire) pi.type = PORT_OUT; wires.at(wire).uphill_bel_pin = BelPin{bel, name}; + wires.at(wire).bel_pins.push_back(BelPin{bel, name}); } void Arch::addBelInout(IdString bel, IdString name, IdString wire) @@ -112,6 +114,7 @@ void Arch::addBelInout(IdString bel, IdString name, IdString wire) pi.type = PORT_INOUT; wires.at(wire).downhill_bel_pins.push_back(BelPin{bel, name}); + wires.at(wire).bel_pins.push_back(BelPin{bel, name}); } void Arch::addGroupBel(IdString group, IdString bel) { groups[group].bels.push_back(bel); } @@ -217,6 +220,8 @@ BelType Arch::getBelType(BelId bel) const { return bels.at(bel).type; } WireId Arch::getBelPinWire(BelId bel, PortPin pin) const { return bels.at(bel).pins.at(pin).wire; } +PortType Arch::getBelPinType(BelId bel, PortPin pin) const { return bels.at(bel).pins.at(pin).type; } + BelPin Arch::getBelPinUphill(WireId wire) const { return wires.at(wire).uphill_bel_pin; } const std::vector<BelPin> &Arch::getBelPinsDownhill(WireId wire) const { return wires.at(wire).downhill_bel_pins; } @@ -267,6 +272,8 @@ IdString Arch::getBoundWireNet(WireId wire) const { return wires.at(wire).bound_ IdString Arch::getConflictingWireNet(WireId wire) const { return wires.at(wire).bound_net; } +const std::vector<BelPin> &Arch::getWireBelPins(WireId wire) const { return wires.at(wire).bel_pins; } + const std::vector<WireId> &Arch::getWires() const { return wire_ids; } // --------------------------------------------------------------- diff --git a/generic/arch.h b/generic/arch.h index 7bcb965f..2a74b1ae 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -43,6 +43,7 @@ struct WireInfo std::vector<PipId> downhill, uphill, aliases; BelPin uphill_bel_pin; std::vector<BelPin> downhill_bel_pins; + std::vector<BelPin> bel_pins; DecalXY decalxy; int x, y; }; @@ -146,8 +147,9 @@ struct Arch : BaseCtx const std::vector<BelId> &getBelsByType(BelType type) const; BelType getBelType(BelId bel) const; WireId getBelPinWire(BelId bel, PortPin pin) const; - BelPin getBelPinUphill(WireId wire) const; - const std::vector<BelPin> &getBelPinsDownhill(WireId wire) const; + PortType getBelPinType(BelId bel, PortPin pin) const; + BelPin getBelPinUphill(WireId wire) const NPNR_DEPRECATED; + const std::vector<BelPin> &getBelPinsDownhill(WireId wire) const NPNR_DEPRECATED; WireId getWireByName(IdString name) const; IdString getWireName(WireId wire) const; @@ -159,6 +161,7 @@ struct Arch : BaseCtx IdString getConflictingWireNet(WireId wire) const; DelayInfo getWireDelay(WireId wire) const { return DelayInfo(); } const std::vector<WireId> &getWires() const; + const std::vector<BelPin> &getWireBelPins(WireId wire) const; PipId getPipByName(IdString name) const; IdString getPipName(PipId pip) const; |