From 296e6d10c21b22b5cf553136d11a7af241eb9679 Mon Sep 17 00:00:00 2001 From: gatecat Date: Tue, 2 Mar 2021 11:00:34 +0000 Subject: timing: Produce plausible Fmax figure Signed-off-by: gatecat --- common/timing.cc | 12 +++++++++++- common/timing.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/common/timing.cc b/common/timing.cc index f46df189..69927841 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -34,6 +34,7 @@ void TimingAnalyser::setup() { init_ports(); get_cell_delays(); + get_route_delays(); topo_sort(); setup_port_domains(); reset_times(); @@ -129,6 +130,15 @@ void TimingAnalyser::get_cell_delays() } } +void TimingAnalyser::get_route_delays() +{ + for (auto net : sorted(ctx->nets)) { + NetInfo *ni = net.second; + for (auto &usr : ni->users) + ports.at(CellPortKey(usr)).route_delay = DelayPair(ctx->getNetinfoRouteDelay(ni, usr)); + } +} + void TimingAnalyser::topo_sort() { TopoSort topo; @@ -396,7 +406,7 @@ void TimingAnalyser::print_fmax() for (auto &req : pd.required) { if (pd.arrival.count(req.first)) { auto &arr = pd.arrival.at(req.first); - double fmax = 1000.0 / (arr.value.maxDelay() - req.second.value.minDelay()); + double fmax = 1000.0 / ctx->getDelayNS(arr.value.maxDelay() - req.second.value.minDelay()); if (!domain_fmax.count(req.first) || domain_fmax.at(req.first) > fmax) domain_fmax[req.first] = fmax; } diff --git a/common/timing.h b/common/timing.h index de30ee61..1205cba5 100644 --- a/common/timing.h +++ b/common/timing.h @@ -132,6 +132,7 @@ struct TimingAnalyser private: void init_ports(); void get_cell_delays(); + void get_route_delays(); void topo_sort(); void setup_port_domains(); -- cgit v1.2.3