aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various/muxpack.v
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-06-07 08:34:58 -0700
committerEddie Hung <eddie@fpgeh.com>2019-06-07 08:34:58 -0700
commit0f6e914ef63d06ae77b54d246b61118c19647f26 (patch)
treed4e8f6b0c1e46750ad3660a9b43550907746c32c /tests/various/muxpack.v
parent5c277c6325b78bfe18cf294b63ea69ff272e69c5 (diff)
downloadyosys-0f6e914ef63d06ae77b54d246b61118c19647f26.tar.gz
yosys-0f6e914ef63d06ae77b54d246b61118c19647f26.tar.bz2
yosys-0f6e914ef63d06ae77b54d246b61118c19647f26.zip
Another muxpack test
Diffstat (limited to 'tests/various/muxpack.v')
-rw-r--r--tests/various/muxpack.v17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/various/muxpack.v b/tests/various/muxpack.v
index f1bd5ea8e..41dfed396 100644
--- a/tests/various/muxpack.v
+++ b/tests/various/muxpack.v
@@ -136,3 +136,20 @@ always @*
else
o <= i[7*W+:W];
endmodule
+
+module mux_if_bal_5_1 #(parameter N=5, parameter W=1) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
+always @*
+ if (s[0] == 1'b0)
+ if (s[1] == 1'b0)
+ if (s[2] == 1'b0)
+ o <= i[0*W+:W];
+ else
+ o <= i[1*W+:W];
+ else
+ if (s[2] == 1'b0)
+ o <= i[2*W+:W];
+ else
+ o <= i[3*W+:W];
+ else
+ o <= i[4*W+:W];
+endmodule