diff options
author | William D. Jones <thor0505@comcast.net> | 2020-12-07 17:41:34 -0500 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-02-12 10:36:59 +0000 |
commit | a7917c9c63efe654a24a4136a91fa4558ee2c625 (patch) | |
tree | ca683477bc179094c7672d687016df1de57c971b /machxo2/arch.cc | |
parent | bbc683dd75fcf54b8f215704a932c5c2f1a39c93 (diff) | |
download | nextpnr-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.cc | 16 |
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(); } |