From bfa83b3bfd8020298b672d467dbd6c1c6c067c21 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 22 Jul 2018 11:12:28 +0200 Subject: Add Arch::getBelPinType() and Arch::getWireBelPins() in generic arch Signed-off-by: Clifford Wolf --- generic/arch.cc | 7 +++++++ 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 &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 &Arch::getWireBelPins(WireId wire) const { return wires.at(wire).bel_pins; } + const std::vector &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 downhill, uphill, aliases; BelPin uphill_bel_pin; std::vector downhill_bel_pins; + std::vector bel_pins; DecalXY decalxy; int x, y; }; @@ -146,8 +147,9 @@ struct Arch : BaseCtx const std::vector &getBelsByType(BelType type) const; BelType getBelType(BelId bel) const; WireId getBelPinWire(BelId bel, PortPin pin) const; - BelPin getBelPinUphill(WireId wire) const; - const std::vector &getBelPinsDownhill(WireId wire) const; + PortType getBelPinType(BelId bel, PortPin pin) const; + BelPin getBelPinUphill(WireId wire) const NPNR_DEPRECATED; + const std::vector &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 &getWires() const; + const std::vector &getWireBelPins(WireId wire) const; PipId getPipByName(IdString name) const; IdString getPipName(PipId pip) const; -- cgit v1.2.3