aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-11-18 15:23:47 +0000
committerDavid Shah <dave@ds0.me>2020-02-03 11:38:30 +0000
commit010e7ba8cbff440c10b4482da4e0f9bf4a9210fa (patch)
treee1b06c3d9daa2ef3c89749c9d53889d9d5e64c73 /common
parenta8351b265fb7a8ddf91b78edb2d5ae0a39384c8b (diff)
downloadnextpnr-010e7ba8cbff440c10b4482da4e0f9bf4a9210fa.tar.gz
nextpnr-010e7ba8cbff440c10b4482da4e0f9bf4a9210fa.tar.bz2
nextpnr-010e7ba8cbff440c10b4482da4e0f9bf4a9210fa.zip
router2: Add IPIN cost to model
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common')
-rw-r--r--common/router2.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/router2.cc b/common/router2.cc
index b189c6d1..ee298ae4 100644
--- a/common/router2.cc
+++ b/common/router2.cc
@@ -300,7 +300,9 @@ struct Router2
if (wd.bound_nets.count(net->udata))
source_uses = wd.bound_nets.at(net->udata).first;
// FIXME: timing/wirelength balance?
- return ctx->getDelayNS(ctx->estimateDelay(wire, sink)) / (1 + source_uses);
+ float ipin_cost = ctx->getDelayNS(ctx->getWireDelay(sink).maxDelay() + ctx->getDelayEpsilon());
+ return std::max(0.0f, ctx->getDelayNS(ctx->estimateDelay(wire, sink)) - ipin_cost) / (1 + source_uses) +
+ ipin_cost;
}
bool check_arc_routing(NetInfo *net, size_t usr)