aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r--ice40/arch.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index a670f286..5f0384a3 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -308,6 +308,20 @@ BelRange Arch::getBelsAtSameTile(BelId bel) const
return br;
}
+PortType Arch::getBelPinType(BelId bel, PortPin pin) const
+{
+ NPNR_ASSERT(bel != BelId());
+
+ int num_bel_wires = chip_info->bel_data[bel.index].num_bel_wires;
+ const BelWirePOD *bel_wires = chip_info->bel_data[bel.index].bel_wires.get();
+
+ for (int i = 0; i < num_bel_wires; i++)
+ if (bel_wires[i].port == pin)
+ return PortType(bel_wires[i].type);
+
+ return PORT_INOUT;
+}
+
WireId Arch::getBelPinWire(BelId bel, PortPin pin) const
{
WireId ret;