Skip to content

Commit ebbb786

Browse files
committed
Verilog: test for reduction operators
1 parent a4526fc commit ebbb786

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
reduction1.v
3+
--bound 0
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module main(input [31:0] in);
2+
3+
// reduction and
4+
always assert reduction_and1:
5+
&3'b111 == 1 && &3'b101 == 0;
6+
7+
// reduction nand
8+
always assert reduction_nand1:
9+
~&in == !(&in);
10+
11+
// reduction or
12+
always assert reduction_or1:
13+
|3'b000 == 0 && |3'b101 == 1;
14+
15+
// reduction nor
16+
always assert reduction_nor1:
17+
~|in == !(|in);
18+
19+
// reduction xor
20+
always assert reduction_xor1:
21+
^3'b000 == 0 && ^3'b111 == 1;
22+
23+
// reduction xnor, variant 1
24+
always assert reduction_xnor1:
25+
~^in == !(^in);
26+
27+
// reduction xnor, variant 2
28+
always assert reduction_xnor2:
29+
^~in == !(^in);
30+
31+
endmodule

0 commit comments

Comments
 (0)