diff options
author | gatecat <gatecat@ds0.me> | 2021-09-24 19:20:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 19:20:36 +0100 |
commit | d44b6acaa9f724694081139b2e88266af8acbb02 (patch) | |
tree | adfb3dde2e6a46f5a9907f7aee66b017c8608a1f /common | |
parent | d9a71083e1a081f89e1aa4c357bc3b828eea6709 (diff) | |
parent | 718ee441a0dcf7328692c67d143f2b26b8ebc61c (diff) | |
download | nextpnr-d44b6acaa9f724694081139b2e88266af8acbb02.tar.gz nextpnr-d44b6acaa9f724694081139b2e88266af8acbb02.tar.bz2 nextpnr-d44b6acaa9f724694081139b2e88266af8acbb02.zip |
Merge pull request #826 from YosysHQ/gatecat/nexus-lutperm
nexus: Add LUT permutation support
Diffstat (limited to 'common')
-rw-r--r-- | common/router2.cc | 3 | ||||
-rw-r--r-- | common/router2.h | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/common/router2.cc b/common/router2.cc index 1f9196ab..813249b4 100644 --- a/common/router2.cc +++ b/common/router2.cc @@ -355,8 +355,7 @@ struct Router2 { auto &wd = wire_data(wire); auto &nd = nets.at(net->udata); - float base_cost = ctx->getDelayNS(ctx->getPipDelay(pip).maxDelay() + ctx->getWireDelay(wire).maxDelay() + - ctx->getDelayEpsilon()); + float base_cost = cfg.get_base_cost(ctx, wire, pip, crit_weight); int overuse = wd.curr_cong; float hist_cost = 1.0f + crit_weight * (wd.hist_cong_cost - 1.0f); float bias_cost = 0; 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); |