aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2/arch.h
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2020-12-06 21:50:04 -0500
committergatecat <gatecat@ds0.me>2021-02-12 10:36:59 +0000
commit094233a4ab49245d8fbdbae83f3241ff3c6585b0 (patch)
tree4cf7719554f1a22e0ff6a6b15d6a31bf5e50f557 /machxo2/arch.h
parent52b424c385a488c48ff91ba8ba52913f1b10995f (diff)
downloadnextpnr-094233a4ab49245d8fbdbae83f3241ff3c6585b0.tar.gz
nextpnr-094233a4ab49245d8fbdbae83f3241ff3c6585b0.tar.bz2
nextpnr-094233a4ab49245d8fbdbae83f3241ff3c6585b0.zip
machxo2: Implement getBelLocation to stop std::out_of_range in place phase.
Diffstat (limited to 'machxo2/arch.h')
-rw-r--r--machxo2/arch.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/machxo2/arch.h b/machxo2/arch.h
index 1cf24892..527c6572 100644
--- a/machxo2/arch.h
+++ b/machxo2/arch.h
@@ -348,7 +348,16 @@ struct Arch : BaseCtx
BelId getBelByName(IdString name) const;
IdString getBelName(BelId bel) const;
- Loc getBelLocation(BelId bel) const;
+ Loc getBelLocation(BelId bel) const
+ {
+ NPNR_ASSERT(bel != BelId());
+ Loc loc;
+ loc.x = bel.location.x;
+ loc.y = bel.location.y;
+ loc.z = tileInfo(bel)->bel_data[bel.index].z;
+ return loc;
+ }
+
BelId getBelByLocation(Loc loc) const;
const std::vector<BelId> &getBelsByTile(int x, int y) const;
bool getBelGlobalBuf(BelId bel) const;