From c3837027b22b67a5079d84419bae20c4d545430b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 20 Jun 2018 12:50:38 +0200 Subject: Add better iCE40 delay estimates Signed-off-by: Clifford Wolf --- common/nextpnr.h | 10 +++++----- common/route.cc | 16 +++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'common') diff --git a/common/nextpnr.h b/common/nextpnr.h index c59b401e..5ccbf057 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -17,13 +17,13 @@ * */ +#include #include #include #include #include #include #include -#include #ifndef NEXTPNR_H #define NEXTPNR_H @@ -196,12 +196,12 @@ struct CellInfo; enum PlaceStrength { - STRENGTH_NONE = 0, - STRENGTH_WEAK = 1, + STRENGTH_NONE = 0, + STRENGTH_WEAK = 1, STRENGTH_STRONG = 2, - STRENGTH_FIXED = 3, + STRENGTH_FIXED = 3, STRENGTH_LOCKED = 4, - STRENGTH_USER = 5 + STRENGTH_USER = 5 }; struct PortRef diff --git a/common/route.cc b/common/route.cc index b031237c..42a705a1 100644 --- a/common/route.cc +++ b/common/route.cc @@ -206,15 +206,16 @@ struct Router assert(next_delay >= 0); if (visited.count(next_wire)) { - if (visited.at(next_wire).delay <= next_delay + 1e-3) + if (visited.at(next_wire).delay <= + next_delay + ctx->getDelayEpsilon()) continue; #if 0 // FIXME if (ctx->verbose) log("Found better route to %s. Old vs new delay " - "estimate: %.2f %.2f\n", + "estimate: %.3f %.3f\n", ctx->getWireName(next_wire).c_str(), - float(visited.at(next_wire).delay), - float(next_delay)); + ctx->getDelayNS(visited.at(next_wire).delay), + ctx->getDelayNS(next_delay)); #endif revisitCnt++; } @@ -246,8 +247,8 @@ struct Router } if (ctx->verbose) - log(" Final path delay: %.2f\n", - float(visited[dst_wire].delay)); + log(" Final path delay: %.3f\n", + ctx->getDelayNS(visited[dst_wire].delay)); maxDelay = fmaxf(maxDelay, visited[dst_wire].delay); if (ctx->verbose) @@ -257,7 +258,8 @@ struct Router while (1) { if (ctx->verbose) - log(" %8.2f %s\n", float(visited[cursor].delay), + log(" %8.3f %s\n", + ctx->getDelayNS(visited[cursor].delay), ctx->getWireName(cursor).c_str(ctx)); if (src_wires.count(cursor)) -- cgit v1.2.3