diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-06-06 12:44:06 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-06-06 12:44:06 -0700 |
commit | 705388eb24022d2a310ae72cd81e67a2f0ce7586 (patch) | |
tree | d6c5b4e0b668978d9f14a2d2e4f3ba8facff1345 /tests/various/muxpack.v | |
parent | 83450a94898321a239f67f92e05fb9a246f4dd6d (diff) | |
download | yosys-705388eb24022d2a310ae72cd81e67a2f0ce7586.tar.gz yosys-705388eb24022d2a310ae72cd81e67a2f0ce7586.tar.bz2 yosys-705388eb24022d2a310ae72cd81e67a2f0ce7586.zip |
Add non exclusive test
Diffstat (limited to 'tests/various/muxpack.v')
-rw-r--r-- | tests/various/muxpack.v | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/various/muxpack.v b/tests/various/muxpack.v index c2c2537a0..e847fef27 100644 --- a/tests/various/muxpack.v +++ b/tests/various/muxpack.v @@ -64,4 +64,24 @@ always @* begin end endmodule +module mux_if_unbal_4_1_nonexcl #(parameter N=4, 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) o <= i[0*W+:W]; + else if (s == 1) o <= i[1*W+:W]; + else if (s == 2) o <= i[2*W+:W]; + else if (s == 3) o <= i[3*W+:W]; + else if (s == 0) o <= {W{1'b0}}; + else o <= {W{1'bx}}; +endmodule +module mux_if_unbal_5_3_nonexcl #(parameter N=4, parameter W=1) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o); +always @* begin + o <= {W{1'bx}}; + if (s == 0) o <= i[0*W+:W]; + if (s == 1) o <= i[1*W+:W]; + if (s == 2) o <= i[2*W+:W]; + if (s == 3) o <= i[3*W+:W]; + if (s == 4) o <= i[4*W+:W]; + if (s == 0) o <= i[2*W+:W]; +end +endmodule |