From 080f0aac3490114c483cc37c1febd0698970d0fe Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 11 Aug 2013 13:33:38 +0200 Subject: [PATCH] Added ";;" as shortcut for "; clean;" --- kernel/register.cc | 5 ++++- passes/opt/opt_clean.cc | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/register.cc b/kernel/register.cc index f6f5804b5..9f6fe37d3 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -149,12 +149,15 @@ void Pass::call(RTLIL::Design *design, std::string command) std::string str = p; int strsz = str.size(); if (strsz > 0 && str[strsz-1] == ';') { + int num_semikolon = 0; while (strsz > 0 && str[strsz-1] == ';') - strsz--; + strsz--, num_semikolon++; if (strsz > 0) args.push_back(str.substr(0, strsz)); call(design, args); args.clear(); + if (num_semikolon == 2) + call(design, "clean"); } else args.push_back(str); } diff --git a/passes/opt/opt_clean.cc b/passes/opt/opt_clean.cc index 183d6757e..17f4168da 100644 --- a/passes/opt/opt_clean.cc +++ b/passes/opt/opt_clean.cc @@ -313,6 +313,9 @@ struct CleanPass : public Pass { log("\n"); log("This is identical to opt_clean, but less verbose.\n"); log("\n"); + log("When commands are seperated using the ';;' token, this command will be executed\n"); + log("between the commands.\n"); + log("\n"); } virtual void execute(std::vector args, RTLIL::Design *design) { -- 2.30.2