Added ## selection operator (union all on stack)
authorClifford Wolf <clifford@clifford.at>
Fri, 8 Mar 2013 07:47:29 +0000 (08:47 +0100)
committerClifford Wolf <clifford@clifford.at>
Fri, 8 Mar 2013 07:47:35 +0000 (08:47 +0100)
kernel/select.cc

index ae76f4f43711f0c321d3360f787c466c49a28b35..df13fce1f5ee0de9000b02888aa6a8bf7df842d1 100644 (file)
@@ -325,6 +325,12 @@ static void select_stmt(RTLIL::Design *design, std::string arg)
                        if (design->selection_stack.size() > 0)
                                work_stack.push_back(design->selection_stack.back());
                } else
+               if (arg == "##") {
+                       while (work_stack.size() > 1) {
+                               select_op_union(design, work_stack.front(), work_stack.back());
+                               work_stack.pop_back();
+                       }
+               } else
                if (arg == "#n") {
                        if (work_stack.size() < 1)
                                log_cmd_error("Must have at least one element on stack for operator #n.\n");
@@ -617,6 +623,9 @@ struct SelectPass : public Pass {
                log("    #\n");
                log("        push a copy of the current selection to the stack\n");
                log("\n");
+               log("    ##\n");
+               log("        replace the stack with a union of all elements on it\n");
+               log("\n");
                log("    #n\n");
                log("        replace top set with its invert\n");
                log("\n");