Assorted fixes to new FPGA interchange based arch.

Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
Keith Rothman 2021-01-26 18:40:42 -08:00
parent 6e68e8f097
commit 1dd24f6461
3 changed files with 13 additions and 5 deletions

View File

@ -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) {
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;
}
}

View File

@ -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]; }