From 85bb108ba40f9573571de0a785f9fbc91c4e1dd0 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 10 Feb 2021 11:54:54 +0000 Subject: Add getBelPinsForCellPin to Arch API This is a basic implementation, without considering "M of N" arrangements (e.g. for LUT permuation where you only want to route to 1 out of 4/6 sinks) or using a type other than IdString to identify bel pins. But this is also enough to start working out where in nextpnr will break due to removing the 1:1 cell:bel pin cardinality, as a next step. Signed-off-by: gatecat --- generic/arch.cc | 2 ++ generic/arch.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'generic') diff --git a/generic/arch.cc b/generic/arch.cc index 912f8a53..c51fbb84 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -339,6 +339,8 @@ std::vector Arch::getBelPins(BelId bel) const return ret; } +std::array Arch::getBelPinsForCellPin(CellInfo *cell_info, IdString pin) const { return {pin}; } + // --------------------------------------------------------------- WireId Arch::getWireByName(IdStringList name) const diff --git a/generic/arch.h b/generic/arch.h index 09fd8e34..e7d204ef 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -124,6 +124,7 @@ struct ArchRanges using TileBelsRangeT = const std::vector &; using BelAttrsRangeT = const std::map &; using BelPinsRangeT = std::vector; + using CellBelPinRangeT = std::array; // Wires using AllWiresRangeT = const std::vector &; using DownhillPipRangeT = const std::vector &; @@ -241,6 +242,7 @@ struct Arch : ArchAPI WireId getBelPinWire(BelId bel, IdString pin) const override; PortType getBelPinType(BelId bel, IdString pin) const override; std::vector getBelPins(BelId bel) const override; + std::array getBelPinsForCellPin(CellInfo *cell_info, IdString pin) const override; WireId getWireByName(IdStringList name) const override; IdStringList getWireName(WireId wire) const override; -- cgit v1.2.3