Added ";;" as shortcut for "; clean;"
authorClifford Wolf <clifford@clifford.at>
Sun, 11 Aug 2013 11:33:38 +0000 (13:33 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 11 Aug 2013 11:33:38 +0000 (13:33 +0200)
kernel/register.cc
passes/opt/opt_clean.cc

index f6f5804b5cfac89e38fc50aecd1c2ec6120a6a43..9f6fe37d3faefc464261b3f0d100af3910a978b8 100644 (file)
@@ -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);
        }
index 183d6757e1cf54cce91ec51a48d0b11a76aa3f9d..17f4168da293dbe6ac63ea53261b0698fd6de117 100644 (file)
@@ -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<std::string> args, RTLIL::Design *design)
        {