diff options
-rw-r--r-- | machxo2/arch.cc | 20 | ||||
-rw-r--r-- | machxo2/arch.h | 9 |
2 files changed, 26 insertions, 3 deletions
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<GroupId> &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 { |