aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/chip.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ice40/chip.cc')
-rw-r--r--ice40/chip.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/ice40/chip.cc b/ice40/chip.cc
index 464b226c..267976eb 100644
--- a/ice40/chip.cc
+++ b/ice40/chip.cc
@@ -240,6 +240,20 @@ PipId Chip::getPipByName(IdString name) const
// -----------------------------------------------------------------------
+BelId Chip::getPackagePinBel(const std::string &pin) const
+{
+ for (int i = 0; i < package_info->num_pins; i++) {
+ if (package_info->pins[i].name == pin) {
+ BelId id;
+ id.index = package_info->pins[i].bel_index;
+ return id;
+ }
+ }
+ return BelId();
+}
+
+// -----------------------------------------------------------------------
+
void Chip::getBelPosition(BelId bel, float &x, float &y) const
{
assert(bel != BelId());