diff options
author | David Shah <dave@ds0.me> | 2020-11-11 13:42:23 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-11-30 08:45:28 +0000 |
commit | 530d6ce9e9528e6067e679323694fbc1617586d8 (patch) | |
tree | 0f409425937bb9019ecbeb72f1c83528c162eb10 /nexus/pack.cc | |
parent | 9b89a82573500118269515154265f811cef6191c (diff) | |
download | nextpnr-530d6ce9e9528e6067e679323694fbc1617586d8.tar.gz nextpnr-530d6ce9e9528e6067e679323694fbc1617586d8.tar.bz2 nextpnr-530d6ce9e9528e6067e679323694fbc1617586d8.zip |
nexus: Add EBR timing analysis
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus/pack.cc')
-rw-r--r-- | nexus/pack.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/nexus/pack.cc b/nexus/pack.cc index bfa45d38..260dcf19 100644 --- a/nexus/pack.cc +++ b/nexus/pack.cc @@ -1306,6 +1306,25 @@ void Arch::assignCellInfo(CellInfo *cell) cell->ffInfo.di = nullptr; cell->ffInfo.m = nullptr; cell->tmg_index = get_cell_timing_idx(id_RAMW); + } else if (cell->type == id_OXIDE_EBR) { + // Strip off bus indices to get the timing ports + // as timing is generally word-wide + for (const auto &port : cell->ports) { + const std::string &name = port.first.str(this); + size_t idx_end = name.find_last_not_of("0123456789"); + std::string base = name.substr(0, idx_end + 1); + if (base == "ADA" || base == "ADB") { + // [4:0] and [13:5] have different timing + int idx = std::stoi(name.substr(idx_end + 1)); + cell->tmg_portmap[port.first] = id(base + ((idx >= 5) ? "_13_5" : "_4_0")); + } else { + // Just strip off bus index + cell->tmg_portmap[port.first] = id(base); + } + } + + cell->tmg_index = get_cell_timing_idx(id(str_or_default(cell->params, id_MODE, "DP16K") + "_MODE")); + NPNR_ASSERT(cell->tmg_index != -1); } } |