summaryrefslogtreecommitdiff
path: root/kernel/select.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-03-08 08:47:29 +0100
committerClifford Wolf <clifford@clifford.at>2013-03-08 08:47:35 +0100
commit79b3afa0110f975f300674426c938bab25d76baf (patch)
tree00afff5ecf421b59747b2a4f61b923bdc47cadea /kernel/select.cc
parent653f0049a824e4ed34760b70c909aaba4fd61c2f (diff)
Added ## selection operator (union all on stack)
Diffstat (limited to 'kernel/select.cc')
-rw-r--r--kernel/select.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/select.cc b/kernel/select.cc
index ae76f4f4..df13fce1 100644
--- a/kernel/select.cc
+++ b/kernel/select.cc
@@ -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");