aboutsummaryrefslogtreecommitdiffstats
path: root/common/router2.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/router2.h')
-rw-r--r--common/router2.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/router2.h b/common/router2.h
index 34102f44..629453c6 100644
--- a/common/router2.h
+++ b/common/router2.h
@@ -21,6 +21,13 @@
NEXTPNR_NAMESPACE_BEGIN
+inline float default_base_cost(Context *ctx, WireId wire, PipId pip, float crit_weight)
+{
+ (void)crit_weight; // unused
+ return ctx->getDelayNS(ctx->getPipDelay(pip).maxDelay() + ctx->getWireDelay(wire).maxDelay() +
+ ctx->getDelayEpsilon());
+}
+
struct Router2Cfg
{
Router2Cfg(Context *ctx);
@@ -51,6 +58,7 @@ struct Router2Cfg
bool perf_profile = false;
std::string heatmap;
+ std::function<float(Context *ctx, WireId wire, PipId pip, float crit_weight)> get_base_cost = default_base_cost;
};
void router2(Context *ctx, const Router2Cfg &cfg);