From 0daffec2a0efdbea36201eeb5666d208a10d0226 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 30 Jul 2018 15:35:40 +0200 Subject: Add predictDelay Arch API Signed-off-by: Clifford Wolf --- generic/arch.cc | 9 +++++++++ generic/arch.h | 1 + 2 files changed, 10 insertions(+) (limited to 'generic') diff --git a/generic/arch.cc b/generic/arch.cc index 5c9864ab..8ef37716 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -403,6 +403,15 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return (dx + dy) * grid_distance_to_delay; } +delay_t Arch::predictDelay(WireId src, WireId dst) const +{ + const WireInfo &s = wires.at(src); + const WireInfo &d = wires.at(dst); + int dx = abs(s.x - d.x); + int dy = abs(s.y - d.y); + return (dx + dy) * grid_distance_to_delay; +} + // --------------------------------------------------------------- bool Arch::place() { return placer1(getCtx()); } diff --git a/generic/arch.h b/generic/arch.h index 01a90ee1..60220fbe 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -194,6 +194,7 @@ struct Arch : BaseCtx const std::vector &getGroupGroups(GroupId group) const; delay_t estimateDelay(WireId src, WireId dst) const; + delay_t predictDelay(WireId src, WireId dst) const; delay_t getDelayEpsilon() const { return 0.01; } delay_t getRipupDelayPenalty() const { return 1.0; } float getDelayNS(delay_t v) const { return v; } -- cgit v1.2.3 From a82f6f410595de26e82eaf4818e41036f0bc2f9c Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 30 Jul 2018 19:19:30 -0700 Subject: Modify predictDelay signature --- generic/arch.cc | 12 +++++++----- generic/arch.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'generic') diff --git a/generic/arch.cc b/generic/arch.cc index 8ef37716..4469a828 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -403,12 +403,14 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return (dx + dy) * grid_distance_to_delay; } -delay_t Arch::predictDelay(WireId src, WireId dst) const +delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const; { - const WireInfo &s = wires.at(src); - const WireInfo &d = wires.at(dst); - int dx = abs(s.x - d.x); - int dy = abs(s.y - d.y); + const auto& driver = net_info->driver; + auto driver_loc = getBelLocation(driver.cell->bel); + auto sink_loc = getBelLocation(sink.cell->bel); + + int dx = abs(driver_loc.x - driver_loc.x); + int dy = abs(sink_loc.y - sink_locy); return (dx + dy) * grid_distance_to_delay; } diff --git a/generic/arch.h b/generic/arch.h index 60220fbe..f02649f6 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -194,7 +194,7 @@ struct Arch : BaseCtx const std::vector &getGroupGroups(GroupId group) const; delay_t estimateDelay(WireId src, WireId dst) const; - delay_t predictDelay(WireId src, WireId dst) const; + delay_t predictDelay(const NetInfo *net_info, const PortRef &sink) const; delay_t getDelayEpsilon() const { return 0.01; } delay_t getRipupDelayPenalty() const { return 1.0; } float getDelayNS(delay_t v) const { return v; } -- cgit v1.2.3