aboutsummaryrefslogtreecommitdiffstats
path: root/nexus
diff options
context:
space:
mode:
authorAlessandro Comodi <acomodi@antmicro.com>2022-01-25 17:46:54 +0100
committerAlessandro Comodi <acomodi@antmicro.com>2022-02-01 11:18:17 +0100
commit676e56e5d44e09f3ff816c5efbb85e2b2ac1086b (patch)
tree69fa8a9aa9b7bbce4720486b403095d3fb832664 /nexus
parente069b3bc6ab4d504e84ef62086d2bb9e5144717b (diff)
downloadnextpnr-676e56e5d44e09f3ff816c5efbb85e2b2ac1086b.tar.gz
nextpnr-676e56e5d44e09f3ff816c5efbb85e2b2ac1086b.tar.bz2
nextpnr-676e56e5d44e09f3ff816c5efbb85e2b2ac1086b.zip
nexus: add option to modify the mult factor of the estimate delay
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Diffstat (limited to 'nexus')
-rw-r--r--nexus/arch.cc7
-rw-r--r--nexus/arch.h1
-rw-r--r--nexus/main.cc4
3 files changed, 11 insertions, 1 deletions
diff --git a/nexus/arch.cc b/nexus/arch.cc
index a7751425..06a901cd 100644
--- a/nexus/arch.cc
+++ b/nexus/arch.cc
@@ -601,7 +601,8 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
int dst_x = dst.tile % chip_info->width, dst_y = dst.tile / chip_info->width;
int dist_x = std::abs(src_x - dst_x);
int dist_y = std::abs(src_y - dst_y);
- return 75 * dist_x + 75 * dist_y + 250;
+
+ return estimate_delay_mult * (dist_x + dist_y) + 250;
}
delay_t Arch::predictDelay(BelId src_bel, IdString src_pin, BelId dst_bel, IdString dst_pin) const
{
@@ -655,6 +656,10 @@ ArcBounds Arch::getRouteBoundingBox(WireId src, WireId dst) const
bool Arch::place()
{
+ estimate_delay_mult = 75;
+ if (getCtx()->settings.count(getCtx()->id("estimate-delay-mult")))
+ estimate_delay_mult = getCtx()->setting<int>("estimate-delay-mult");
+
std::string placer = str_or_default(settings, id("placer"), defaultPlacer);
if (placer == "heap") {
diff --git a/nexus/arch.h b/nexus/arch.h
index 0bd1b62c..ea4e9f5b 100644
--- a/nexus/arch.h
+++ b/nexus/arch.h
@@ -1290,6 +1290,7 @@ struct Arch : BaseArch<ArchRanges>
// -------------------------------------------------
+ int32_t estimate_delay_mult;
delay_t estimateDelay(WireId src, WireId dst) const override;
delay_t predictDelay(BelId src_bel, IdString src_pin, BelId dst_bel, IdString dst_pin) const override;
delay_t getDelayEpsilon() const override { return 20; }
diff --git a/nexus/main.cc b/nexus/main.cc
index 9fec8d5e..b02dfa99 100644
--- a/nexus/main.cc
+++ b/nexus/main.cc
@@ -54,6 +54,8 @@ po::options_description NexusCommandHandler::getArchOptions()
specific.add_options()("no-pack-lutff", "disable packing (clustering) LUTs and FFs together");
specific.add_options()("carry-lutff-ratio", po::value<float>(),
"ratio of FFs to be added to carry-chain LUT clusters");
+ specific.add_options()("estimate-delay-mult", po::value<int>(),
+ "multiplier for the estimate delay");
return specific;
}
@@ -88,6 +90,8 @@ std::unique_ptr<Context> NexusCommandHandler::createContext(dict<std::string, Pr
}
ctx->settings[ctx->id("carry_lutff_ratio")] = ratio;
}
+ if (vm.count("estimate-delay-mult"))
+ ctx->settings[ctx->id("estimate-delay-mult")] = vm["estimate-delay-mult"].as<int>();
return ctx;
}