aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch.cc15
-rw-r--r--ice40/arch.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 5f0384a3..65b21afd 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -340,6 +340,21 @@ WireId Arch::getBelPinWire(BelId bel, PortPin pin) const
return ret;
}
+std::vector<PortPin> Arch::getBelPins(BelId bel) const
+{
+ std::vector<PortPin> ret;
+
+ 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++)
+ ret.push_back(bel_wires[i].port);
+
+ return ret;
+}
+
// -----------------------------------------------------------------------
WireId Arch::getWireByName(IdString name) const
diff --git a/ice40/arch.h b/ice40/arch.h
index f3016424..2e2018fb 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -494,6 +494,8 @@ struct Arch : BaseCtx
return range;
}
+ std::vector<PortPin> getBelPins(BelId bel) const;
+
// -------------------------------------------------
WireId getWireByName(IdString name) const;