aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-05-28 17:42:16 +0200
committerGitHub <noreply@github.com>2019-05-28 17:42:16 +0200
commit8e647901ef6ea484bfe41628f258c53590ae4114 (patch)
treebf7e482b1bf628c39cf81ac89622e67bbd9bfb08 /tests
parent49d641d97f98526484d4ea7021f6ed15584fa4c9 (diff)
parentba2185ead89fdb6afeec6043ab18f2e045d80247 (diff)
downloadyosys-8e647901ef6ea484bfe41628f258c53590ae4114.tar.gz
yosys-8e647901ef6ea484bfe41628f258c53590ae4114.tar.bz2
yosys-8e647901ef6ea484bfe41628f258c53590ae4114.zip
Merge pull request #1050 from YosysHQ/clifford/wandwor
Refactored wand/wor support
Diffstat (limited to 'tests')
-rw-r--r--tests/simple/wandwor.v36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/simple/wandwor.v b/tests/simple/wandwor.v
new file mode 100644
index 000000000..34404aa26
--- /dev/null
+++ b/tests/simple/wandwor.v
@@ -0,0 +1,36 @@
+module wandwor_test0 (A, B, C, D, X, Y, Z);
+ input A, B, C, D;
+ output wor X;
+ output wand Y;
+ output Z;
+
+ assign X = A, X = B, Y = C, Y = D;
+ foo foo_0 (C, D, X);
+ foo foo_1 (A, B, Y);
+ foo foo_2 (X, Y, Z);
+endmodule
+
+module wandwor_test1 (A, B, C, D, X, Y, Z);
+ input [3:0] A, B, C, D;
+ output wor [3:0] X;
+ output wand [3:0] Y;
+ output Z;
+
+ bar bar_inst (
+ .I0({A, B}),
+ .I1({B, A}),
+ .O({X, Y})
+ );
+
+ assign X = C, X = D;
+ assign Y = C, Y = D;
+ assign Z = ^{X,Y};
+endmodule
+
+module foo(input I0, I1, output O);
+ assign O = I0 ^ I1;
+endmodule
+
+module bar(input [7:0] I0, I1, output [7:0] O);
+ assign O = I0 + I1;
+endmodule