From ec239c8c35e24ea12c97bcdaa34425d1269d54ab Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Mon, 22 Feb 2021 22:33:47 -0500 Subject: machxo2: Hardcode a rule for emitting U_/D_ or G_ prefixes in ASCII output. --- machxo2/bitstream.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'machxo2') 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)) { -- cgit v1.2.3