aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-20 12:50:38 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-20 12:50:38 +0200
commitc3837027b22b67a5079d84419bae20c4d545430b (patch)
tree49196c574fdda739506d7c78df6a96960620590f /common
parenta06d2aeb4da0c51fb50d8283367836e6dbf91b4d (diff)
downloadnextpnr-c3837027b22b67a5079d84419bae20c4d545430b.tar.gz
nextpnr-c3837027b22b67a5079d84419bae20c4d545430b.tar.bz2
nextpnr-c3837027b22b67a5079d84419bae20c4d545430b.zip
Add better iCE40 delay estimates
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'common')
-rw-r--r--common/nextpnr.h10
-rw-r--r--common/route.cc16
2 files changed, 14 insertions, 12 deletions
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 <algorithm>
#include <assert.h>
#include <stdint.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
-#include <algorithm>
#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))