diff options
author | gatecat <gatecat@ds0.me> | 2021-05-09 16:51:28 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-05-15 14:54:33 +0100 |
commit | 386b5b901c9e62d527e84bbd0833f5908f778413 (patch) | |
tree | 39ad000b5a07756ba3c6741dadf227e4b4cf81ff /mistral/arch.cc | |
parent | c5d983066df541ad93a13904e96e0298489e2fcd (diff) | |
download | nextpnr-386b5b901c9e62d527e84bbd0833f5908f778413.tar.gz nextpnr-386b5b901c9e62d527e84bbd0833f5908f778413.tar.bz2 nextpnr-386b5b901c9e62d527e84bbd0833f5908f778413.zip |
mistral: Implement some misc. things
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'mistral/arch.cc')
-rw-r--r-- | mistral/arch.cc | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/mistral/arch.cc b/mistral/arch.cc index 632fb0b2..5fc2a0b4 100644 --- a/mistral/arch.cc +++ b/mistral/arch.cc @@ -80,9 +80,11 @@ Arch::Arch(ArchArgs args) } } - for (auto gpio_pos : cyclonev->gpio_get_pos()) { + for (auto gpio_pos : cyclonev->gpio_get_pos()) create_gpio(CycloneV::pos2x(gpio_pos), CycloneV::pos2y(gpio_pos)); - } + + for (auto cmuxh_pos : cyclonev->cmuxh_get_pos()) + create_clkbuf(CycloneV::pos2x(cmuxh_pos), CycloneV::pos2y(cmuxh_pos)); // This import takes about 5s, perhaps long term we can speed it up, e.g. defer to Mistral more... log_info("Initialising routing graph...\n"); @@ -354,6 +356,26 @@ void Arch::assignArchInfo() } } +delay_t Arch::estimateDelay(WireId src, WireId dst) const +{ + int x0 = CycloneV::rn2x(src.node); + int y0 = CycloneV::rn2y(src.node); + int x1 = CycloneV::rn2x(dst.node); + int y1 = CycloneV::rn2y(dst.node); + return 100 * std::abs(y1 - y0) + 100 * std::abs(x1 - x0) + 100; +} + +delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const +{ + if (net_info->driver.cell == nullptr || net_info->driver.cell->bel == BelId()) + return 100; + if (sink.cell->bel == BelId()) + return 100; + Loc src_loc = getBelLocation(net_info->driver.cell->bel); + Loc dst_loc = getBelLocation(sink.cell->bel); + return std::abs(dst_loc.y - src_loc.y) * 100 + std::abs(dst_loc.x - src_loc.x) * 100 + 100; +} + bool Arch::place() { std::string placer = str_or_default(settings, id("placer"), defaultPlacer); |