aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch.cc14
-rw-r--r--ice40/main.cc3
-rwxr-xr-xice40/picorv32_benchmark.py2
3 files changed, 17 insertions, 2 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index ada78020..8f52987c 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -26,6 +26,7 @@
#include "nextpnr.h"
#include "placer1.h"
#include "router1.h"
+#include "timing_opt.h"
#include "util.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -626,7 +627,18 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay
// -----------------------------------------------------------------------
-bool Arch::place() { return placer1(getCtx(), Placer1Cfg(getCtx())); }
+bool Arch::place()
+{
+ if (!placer1(getCtx(), Placer1Cfg(getCtx())))
+ return false;
+ if (bool_or_default(settings, id("opt_timing"), false)) {
+ TimingOptCfg tocfg(getCtx());
+ tocfg.cellTypes.insert(id_ICESTORM_LC);
+ return timing_opt(getCtx(), tocfg);
+ } else {
+ return true;
+ }
+}
bool Arch::route() { return router1(getCtx(), Router1Cfg(getCtx())); }
diff --git a/ice40/main.cc b/ice40/main.cc
index 4b6a9e42..543bd229 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -68,6 +68,7 @@ po::options_description Ice40CommandHandler::getArchOptions()
specific.add_options()("promote-logic",
"enable promotion of 'logic' globals (in addition to clk/ce/sr by default)");
specific.add_options()("no-promote-globals", "disable all global promotion");
+ specific.add_options()("opt-timing", "run post-placement timing optimisation pass (experimental)");
specific.add_options()("tmfuzz", "run path delay estimate fuzzer");
return specific;
}
@@ -161,6 +162,8 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext()
ctx->settings[ctx->id("promote_logic")] = "1";
if (vm.count("no-promote-globals"))
ctx->settings[ctx->id("no_promote_globals")] = "1";
+ if (vm.count("opt-timing"))
+ ctx->settings[ctx->id("opt_timing")] = "1";
return ctx;
}
diff --git a/ice40/picorv32_benchmark.py b/ice40/picorv32_benchmark.py
index a4ec581e..5e4fc2e1 100755
--- a/ice40/picorv32_benchmark.py
+++ b/ice40/picorv32_benchmark.py
@@ -22,7 +22,7 @@ for i in range(num_runs):
ascfile = "picorv32_work/picorv32_s{}.asc".format(run)
if path.exists(ascfile):
os.remove(ascfile)
- result = subprocess.run(["../nextpnr-ice40", "--hx8k", "--seed", str(run), "--json", "picorv32.json", "--asc", ascfile, "--freq", "70"], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
+ result = subprocess.run(["../nextpnr-ice40", "--hx8k", "--seed", str(run), "--json", "picorv32.json", "--asc", ascfile, "--freq", "40", "--opt-timing"], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
if result.returncode != 0:
print("Run {} failed!".format(run))
else: