diff options
author | myrtle <gatecat@ds0.me> | 2022-06-09 06:51:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-09 06:51:45 +0100 |
commit | aeece7d2788ce667c5eca8b321f4043a13e53950 (patch) | |
tree | b15a4cfd64fa6412c091ba579dee250fb8cae639 /gowin | |
parent | 2da7caf6573d857e72388003982043d743bc9438 (diff) | |
parent | bd0af4052c434b1cf3ed8522360b5acc78bd17a2 (diff) | |
download | nextpnr-aeece7d2788ce667c5eca8b321f4043a13e53950.tar.gz nextpnr-aeece7d2788ce667c5eca8b321f4043a13e53950.tar.bz2 nextpnr-aeece7d2788ce667c5eca8b321f4043a13e53950.zip |
Merge pull request #996 from yrabbit/sn
gowin: Use local aliases
Diffstat (limited to 'gowin')
-rw-r--r-- | gowin/arch.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc index a991879e..82f5018b 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -34,6 +34,8 @@ NEXTPNR_NAMESPACE_BEGIN +const PairPOD *pairLookup(const PairPOD *list, const size_t len, const int dest); + // GUI void Arch::fixClockSpineDecals(void) { @@ -627,7 +629,15 @@ IdString Arch::wireToGlobal(int &row, int &col, const DatabasePOD *db, IdString } snprintf(buf, 32, "%c%d0", direction, num); wire = id(buf); - snprintf(buf, 32, "R%dC%d_%c%d", row + 1, col + 1, direction, num); + // local aliases + const TilePOD *tile = db->grid[row * db->cols + col].get(); + auto local_alias = pairLookup(tile->aliases.get(), tile->num_aliases, wire.index); + if (local_alias != nullptr) { + wire = IdString(local_alias->src_id); + snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, wire.c_str(this)); + } else { + snprintf(buf, 32, "R%dC%d_%c%d", row + 1, col + 1, direction, num); + } return id(buf); } @@ -1491,12 +1501,6 @@ Arch::Arch(ArchArgs args) : args(args) snprintf(buf, 32, "R%dC%d_%s_%s", row + 1, col + 1, srcid.c_str(this), destid.c_str(this)); IdString pipname = id(buf); DelayQuad delay = getWireTypeDelay(destid); - // local alias - auto local_alias = pairLookup(tile->aliases.get(), tile->num_aliases, srcid.index); - if (local_alias != nullptr) { - srcid = IdString(local_alias->src_id); - gsrcname = wireToGlobal(srcrow, srccol, db, srcid); - } // global alias srcid = IdString(pip.src_id); GlobalAliasPOD alias; |