aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various/muxpack.v
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-06-06 13:51:22 -0700
committerEddie Hung <eddie@fpgeh.com>2019-06-06 13:51:22 -0700
commitccdf989025e57da7dfd5ab609676ebe3cfb2c2d6 (patch)
tree68d9f57cb227ba5b7114fc42b95e86522d602e48 /tests/various/muxpack.v
parentdc7b8c4b942f9d9bc61a87a81291244d0b73843b (diff)
downloadyosys-ccdf989025e57da7dfd5ab609676ebe3cfb2c2d6.tar.gz
yosys-ccdf989025e57da7dfd5ab609676ebe3cfb2c2d6.tar.bz2
yosys-ccdf989025e57da7dfd5ab609676ebe3cfb2c2d6.zip
Support cascading $pmux.A with $mux.A and $mux.B
Diffstat (limited to 'tests/various/muxpack.v')
-rw-r--r--tests/various/muxpack.v25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/various/muxpack.v b/tests/various/muxpack.v
index e847fef27..fe0150532 100644
--- a/tests/various/muxpack.v
+++ b/tests/various/muxpack.v
@@ -85,3 +85,28 @@ always @* begin
if (s == 0) o <= i[2*W+:W];
end
endmodule
+
+module mux_case_unbal_7_7#(parameter N=7, parameter W=7) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
+always @* begin
+ o <= {W{1'bx}};
+ case (s)
+ 0: o <= i[0*W+:W];
+ default:
+ case (s)
+ 1: o <= i[1*W+:W];
+ 2: o <= i[2*W+:W];
+ default:
+ case (s)
+ 3: o <= i[3*W+:W];
+ 4: o <= i[4*W+:W];
+ 5: o <= i[5*W+:W];
+ default:
+ case (s)
+ 6: o <= i[6*W+:W];
+ default: o <= i[7*W+:W];
+ endcase
+ endcase
+ endcase
+ endcase
+end
+endmodule