aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2021-02-22 22:33:47 -0500
committerWilliam D. Jones <thor0505@comcast.net>2021-07-01 09:36:01 -0400
commitec239c8c35e24ea12c97bcdaa34425d1269d54ab (patch)
tree64f04ded1a40c6e809ca403eb81d96ec1e466c0b /machxo2
parentb1f25d4b33a40666a2f483ee3875074c65c2ac68 (diff)
downloadnextpnr-ec239c8c35e24ea12c97bcdaa34425d1269d54ab.tar.gz
nextpnr-ec239c8c35e24ea12c97bcdaa34425d1269d54ab.tar.bz2
nextpnr-ec239c8c35e24ea12c97bcdaa34425d1269d54ab.zip
machxo2: Hardcode a rule for emitting U_/D_ or G_ prefixes in ASCII output.
Diffstat (limited to 'machxo2')
-rw-r--r--machxo2/bitstream.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/machxo2/bitstream.cc b/machxo2/bitstream.cc
index f7e774cf..62d1be75 100644
--- a/machxo2/bitstream.cc
+++ b/machxo2/bitstream.cc
@@ -71,9 +71,24 @@ static std::string get_trellis_wirename(Context *ctx, Location loc, WireId wire)
name.find("JINCK") != std::string::npos);
};
- if (prefix2 == "G_" || prefix2 == "L_" || prefix2 == "R_" || prefix2 == "U_" || prefix2 == "D_" ||
- prefix7 == "BRANCH_")
+ if (prefix2 == "G_" || prefix2 == "L_" || prefix2 == "R_" || prefix7 == "BRANCH_")
return basename;
+
+ if (prefix2 == "U_" || prefix2 == "D_") {
+ // We needded to keep U_ and D_ prefixes to generate the routing
+ // graph connections properly, but in truth they are not relevant
+ // outside of the center row of tiles as far as the database is
+ // concerned. So convert U_/D_ prefixes back to G_ if not in the
+ // center row.
+
+ // FIXME: This is hardcoded to 1200HC coordinates for now. Perhaps
+ // add a center row/col field to chipdb?
+ if (loc.y == 6)
+ return basename;
+ else
+ return "G_" + basename.substr(2);
+ }
+
if (loc == wire.location) {
// TODO: JINCK is not currently handled by this.
if (is_pio_wire(basename)) {