From f3adf5a576a881e39cf78e599cbcd7ed3d3b8ec1 Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 2 Dec 2018 14:08:11 +0000 Subject: [PATCH] timing_opt: Make an optional pass controlled by command line Signed-off-by: David Shah --- ice40/arch.cc | 11 ++++++++--- ice40/main.cc | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ice40/arch.cc b/ice40/arch.cc index 98e6d4c7..9dbc78bb 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -631,9 +631,14 @@ bool Arch::place() { if (!placer1(getCtx(), Placer1Cfg(getCtx()))) return false; - TimingOptCfg tocfg(getCtx()); - tocfg.cellTypes.insert(id_ICESTORM_LC); - return timing_opt(getCtx(), tocfg); + 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 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; }