From e1f72318e0b126de119cbc5e7f7b143e7beadd09 Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Sat, 30 Jan 2021 12:39:57 -0500 Subject: machxo2: Tweak A-star parameters for acceptable performance. --- machxo2/arch.cc | 20 ++++++++++++++++++-- machxo2/arch.h | 9 ++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'machxo2') diff --git a/machxo2/arch.cc b/machxo2/arch.cc index 3410ec16..58c48044 100644 --- a/machxo2/arch.cc +++ b/machxo2/arch.cc @@ -365,9 +365,25 @@ const std::vector &Arch::getGroupGroups(GroupId group) const { return g // --------------------------------------------------------------- -delay_t Arch::estimateDelay(WireId src, WireId dst) const { return 0; } +delay_t Arch::estimateDelay(WireId src, WireId dst) const +{ + // Taxicab distance multiplied by pipDelay (0.01) and fake wireDelay (0.01). + // TODO: This function will not work well for entrance to global routing, + // as the entrances are located physically far from the DCCAs. + return (abs(dst.location.x - src.location.x) + abs(dst.location.y - src.location.y)) * (0.01 + 0.01); +} + +delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const +{ + BelId src = net_info->driver.cell->bel; + BelId dst = sink.cell->bel; + + NPNR_ASSERT(src != BelId()); + NPNR_ASSERT(dst != BelId()); -delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const { return 0; } + // TODO: Same deal applies here as with estimateDelay. + return (abs(dst.location.x - src.location.x) + abs(dst.location.y - src.location.y)) * (0.01 + 0.01); +} bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t &budget) const { return false; } diff --git a/machxo2/arch.h b/machxo2/arch.h index a438424f..8fdb63fc 100644 --- a/machxo2/arch.h +++ b/machxo2/arch.h @@ -850,7 +850,14 @@ struct Arch : BaseCtx return wire; } - DelayInfo getPipDelay(PipId pip) const { return DelayInfo(); } + DelayInfo getPipDelay(PipId pip) const + { + DelayInfo delay; + + delay.delay = 0.01; + + return delay; + } PipRange getPipsDownhill(WireId wire) const { -- cgit v1.2.3