aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2/arch.cc
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2020-12-07 17:41:34 -0500
committergatecat <gatecat@ds0.me>2021-02-12 10:36:59 +0000
commita7917c9c63efe654a24a4136a91fa4558ee2c625 (patch)
treeca683477bc179094c7672d687016df1de57c971b /machxo2/arch.cc
parentbbc683dd75fcf54b8f215704a932c5c2f1a39c93 (diff)
downloadnextpnr-a7917c9c63efe654a24a4136a91fa4558ee2c625.tar.gz
nextpnr-a7917c9c63efe654a24a4136a91fa4558ee2c625.tar.bz2
nextpnr-a7917c9c63efe654a24a4136a91fa4558ee2c625.zip
machxo2: Implement WireId/PipId, complete Bel part of API.
Diffstat (limited to 'machxo2/arch.cc')
-rw-r--r--machxo2/arch.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/machxo2/arch.cc b/machxo2/arch.cc
index a01f96e6..ee334ed4 100644
--- a/machxo2/arch.cc
+++ b/machxo2/arch.cc
@@ -212,6 +212,22 @@ const std::map<IdString, std::string> &Arch::getBelAttrs(BelId bel) const { retu
WireId Arch::getBelPinWire(BelId bel, IdString pin) const
{
+ NPNR_ASSERT(bel != BelId());
+
+ int num_bel_wires = tileInfo(bel)->bel_data[bel.index].num_bel_wires;
+ const BelWirePOD *bel_wires = &*tileInfo(bel)->bel_data[bel.index].bel_wires;
+
+ for(int i = 0; i < num_bel_wires; i++)
+ if(bel_wires[i].port == pin.index) {
+ WireId ret;
+
+ ret.location.x = bel_wires[i].rel_wire_loc.x;
+ ret.location.y = bel_wires[i].rel_wire_loc.y;
+ ret.index = bel_wires[i].wire_index;
+
+ return ret;
+ }
+
return WireId();
}