From 987fdc1b29d9cb7478df49c72f68ce5f3f9f740c Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 22 Jul 2018 17:07:38 +0200 Subject: ecp5: Adding new Bel pin API Signed-off-by: David Shah --- ecp5/arch.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index 13b2c3b8..b6aec856 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -50,6 +50,7 @@ NPNR_PACKED_STRUCT(struct BelWirePOD { LocationPOD rel_wire_loc; int32_t wire_index; PortPin port; + int32_t type; }); NPNR_PACKED_STRUCT(struct BelInfoPOD { @@ -87,6 +88,9 @@ NPNR_PACKED_STRUCT(struct WireInfoPOD { int32_t num_bels_downhill; BelPortPOD bel_uphill; RelPtr bels_downhill; + + int32_t num_bel_pins; + RelPtr bel_pins; }); NPNR_PACKED_STRUCT(struct LocationTypePOD { @@ -486,7 +490,7 @@ struct Arch : BaseCtx WireId getBelPinWire(BelId bel, PortPin pin) const; - BelPin getBelPinUphill(WireId wire) const + BelPin getBelPinUphill(WireId wire) const NPNR_DEPRECATED { BelPin ret; NPNR_ASSERT(wire != WireId()); @@ -500,7 +504,7 @@ struct Arch : BaseCtx return ret; } - BelPinRange getBelPinsDownhill(WireId wire) const + BelPinRange getBelPinsDownhill(WireId wire) const NPNR_DEPRECATED { BelPinRange range; NPNR_ASSERT(wire != WireId()); @@ -511,6 +515,19 @@ struct Arch : BaseCtx return range; } + BelPinRange getWireBelPins(WireId wire) const + { + BelPinRange range; + NPNR_ASSERT(wire != WireId()); + range.b.ptr = locInfo(wire)->wire_data[wire.index].bel_pins.get(); + range.b.wire_loc = wire.location; + range.e.ptr = range.b.ptr + locInfo(wire)->wire_data[wire.index].num_bel_pins; + range.e.wire_loc = wire.location; + return range; + } + + std::vector getBelPins(BelId bel) const; + // ------------------------------------------------- WireId getWireByName(IdString name) const; @@ -581,6 +598,7 @@ struct Arch : BaseCtx DelayInfo getWireDelay(WireId wire) const { DelayInfo delay; + delay.delay = 0; return delay; } @@ -739,6 +757,8 @@ struct Arch : BaseCtx BelId getPackagePinBel(const std::string &pin) const; std::string getBelPackagePin(BelId bel) const; + PortType getBelPinType(BelId bel, PortPin pin) const; + // ------------------------------------------------- GroupId getGroupByName(IdString name) const { return GroupId(); } -- cgit v1.2.3