diff options
author | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-01-26 18:40:42 -0800 |
---|---|---|
committer | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-02-04 16:38:33 -0800 |
commit | 1dd24f6461a9d22d77e91fef413900ec3651d938 (patch) | |
tree | 8e1a8b13cda38904d46e1d62010caf574c8cd6d2 /fpga_interchange | |
parent | 6e68e8f0979c7be57e92e17e932da830c8af9717 (diff) | |
download | nextpnr-1dd24f6461a9d22d77e91fef413900ec3651d938.tar.gz nextpnr-1dd24f6461a9d22d77e91fef413900ec3651d938.tar.bz2 nextpnr-1dd24f6461a9d22d77e91fef413900ec3651d938.zip |
Assorted fixes to new FPGA interchange based arch.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'fpga_interchange')
-rw-r--r-- | fpga_interchange/arch.cc | 16 | ||||
-rw-r--r-- | fpga_interchange/arch.h | 2 | ||||
-rw-r--r-- | fpga_interchange/constids.inc | 0 |
3 files changed, 13 insertions, 5 deletions
diff --git a/fpga_interchange/arch.cc b/fpga_interchange/arch.cc index c1f33318..6e69f137 100644 --- a/fpga_interchange/arch.cc +++ b/fpga_interchange/arch.cc @@ -194,11 +194,12 @@ WireId Arch::getWireByName(IdString name) const { if (wire_by_name_cache.count(name)) return wire_by_name_cache.at(name); + WireId ret; setup_byname(); const std::string &s = name.str(this); - auto sp = split_identifier_name(s.substr(8)); + auto sp = split_identifier_name(s); auto iter = site_by_name.find(sp.first); if (iter != site_by_name.end()) { int tile; @@ -214,14 +215,21 @@ WireId Arch::getWireByName(IdString name) const } } } else { - auto sp = split_identifier_name(s); int tile = tile_by_name.at(sp.first); auto &tile_info = chip_info->tile_types[chip_info->tiles[tile].type]; IdString wirename = id(sp.second); for (int i = 0; i < tile_info.num_wires; i++) { if (tile_info.wire_data[i].site == -1 && tile_info.wire_data[i].name == wirename.index) { - ret.tile = tile; - ret.index = i; + int32_t node = chip_info->tiles[tile].tile_wire_to_node[i]; + if (node == -1) { + // Not a nodal wire + ret.tile = tile; + ret.index = i; + } else { + // Is a nodal wire, set tile to -1 + ret.tile = -1; + ret.index = node; + } break; } } diff --git a/fpga_interchange/arch.h b/fpga_interchange/arch.h index a14d3096..390af594 100644 --- a/fpga_interchange/arch.h +++ b/fpga_interchange/arch.h @@ -42,7 +42,7 @@ template <typename T> struct RelPtr const T *get() const { - return reinterpret_cast<const T *>(reinterpret_cast<const char *>(this) + int64_t(offset) * 4); + return reinterpret_cast<const T *>(reinterpret_cast<const char *>(this) + offset); } const T &operator[](size_t index) const { return get()[index]; } diff --git a/fpga_interchange/constids.inc b/fpga_interchange/constids.inc deleted file mode 100644 index e69de29b..00000000 --- a/fpga_interchange/constids.inc +++ /dev/null |