aboutsummaryrefslogtreecommitdiffstats
path: root/common/timing.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-11-16 12:59:27 +0000
committerDavid Shah <dave@ds0.me>2018-11-16 13:26:28 +0000
commit13244e513b2a7454f2fa6d952df334439d28588a (patch)
tree954408662b0ed447bad6640eaef0889f37b97214 /common/timing.cc
parent19cc284b8cd6293430dd8acc11ace73b8e13b287 (diff)
downloadnextpnr-13244e513b2a7454f2fa6d952df334439d28588a.tar.gz
nextpnr-13244e513b2a7454f2fa6d952df334439d28588a.tar.bz2
nextpnr-13244e513b2a7454f2fa6d952df334439d28588a.zip
ecp5: Fix db import, improve timing data debugging
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common/timing.cc')
-rw-r--r--common/timing.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/timing.cc b/common/timing.cc
index 80be554c..00142a4d 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -554,6 +554,7 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p
Fmax = 1000 / ctx->getDelayNS(path.second.path_delay);
else
Fmax = 500 / ctx->getDelayNS(path.second.path_delay);
+ log_info("%d %f\n", a.edge == b.edge, ctx->getDelayNS(path.second.path_delay));
if (!clock_fmax.count(a.clock) || Fmax < clock_fmax.at(a.clock)) {
clock_reports[a.clock] = path;
clock_fmax[a.clock] = Fmax;
@@ -608,6 +609,8 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p
if (clknet != nullptr && clknet->name == clocks.start.clock &&
clockInfo.edge == clocks.start.edge) {
last_port = clockInfo.clock_port;
+ total += clockInfo.clockToQ.maxDelay();
+ break;
}
}
}
@@ -623,7 +626,7 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p
if (last_port == driver.port) {
// Case where we start with a STARTPOINT etc
comb_delay = ctx->getDelayFromNS(0);
- } else {
+ } else if (total == 0) {
ctx->getCellDelay(sink_cell, last_port, driver.port, comb_delay);
}
total += comb_delay.maxDelay();
@@ -657,7 +660,18 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p
}
}
last_port = sink->port;
+
}
+ int clockCount = 0;
+ auto sinkClass = ctx->getPortTimingClass(crit_path.back()->cell, crit_path.back()->port, clockCount);
+ if (sinkClass == TMG_REGISTER_INPUT && clockCount > 0) {
+ auto sinkClockInfo = ctx->getPortClockingInfo(crit_path.back()->cell, crit_path.back()->port, 0);
+ delay_t setup = sinkClockInfo.setup.maxDelay();
+ total += setup;
+ log_info("%4.1f %4.1f Setup %s.%s\n", ctx->getDelayNS(setup), ctx->getDelayNS(total),
+ crit_path.back()->cell->name.c_str(ctx), crit_path.back()->port.c_str(ctx));
+ }
+
};
for (auto &clock : clock_reports) {