aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-04-22 15:35:05 -0700
committerGitHub <noreply@github.com>2020-04-22 15:35:05 -0700
commitfa9df06c9dc5ead43645ba973e2ca8c63adfb29d (patch)
treed20d965ea24181f43872ba9a96c032abb6feb7b8 /tests
parent274098cce6133dfb9a5b0ad013e55119cb1741cf (diff)
parentbeb9e4b29964cee0ea1eb77a50e7f040e067144d (diff)
downloadyosys-fa9df06c9dc5ead43645ba973e2ca8c63adfb29d.tar.gz
yosys-fa9df06c9dc5ead43645ba973e2ca8c63adfb29d.tar.bz2
yosys-fa9df06c9dc5ead43645ba973e2ca8c63adfb29d.zip
Merge pull request #1949 from YosysHQ/eddie/select_blackbox
select: do not select inside black-/white- boxes unless '=' prefix used
Diffstat (limited to 'tests')
-rw-r--r--tests/select/blackboxes.ys28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/select/blackboxes.ys b/tests/select/blackboxes.ys
new file mode 100644
index 000000000..9bfe92c6b
--- /dev/null
+++ b/tests/select/blackboxes.ys
@@ -0,0 +1,28 @@
+read_verilog -specify <<EOT
+module top(input a, b, output o);
+assign o = a & b;
+endmodule
+
+(* blackbox *)
+module bb(input a, b, output o);
+assign o = a | b;
+specify
+ (a => o) = 1;
+endspecify
+endmodule
+
+(* whitebox *)
+module wb(input a, b, output o);
+assign o = a ^ b;
+endmodule
+EOT
+clean
+
+select -assert-count 1 c:*
+select -assert-none t:* t:$and %d
+select -assert-count 3 w:*
+select -assert-count 4 *
+
+select -assert-count 3 =c:*
+select -assert-count 10 =w:*
+select -assert-count 13 =*