aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-03-02 11:00:34 +0000
committergatecat <gatecat@ds0.me>2021-03-04 10:29:36 +0000
commit296e6d10c21b22b5cf553136d11a7af241eb9679 (patch)
tree66fbd1288832eb607f1d83e6d414f83a9fef9764
parent541376f8cce23306095c87976ee25d1a7abb719b (diff)
downloadnextpnr-296e6d10c21b22b5cf553136d11a7af241eb9679.tar.gz
nextpnr-296e6d10c21b22b5cf553136d11a7af241eb9679.tar.bz2
nextpnr-296e6d10c21b22b5cf553136d11a7af241eb9679.zip
timing: Produce plausible Fmax figure
Signed-off-by: gatecat <gatecat@ds0.me>
-rw-r--r--common/timing.cc12
-rw-r--r--common/timing.h1
2 files changed, 12 insertions, 1 deletions
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<CellPortKey> 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();