mirror of https://github.com/YosysHQ/yosys.git
One more and tidy up
This commit is contained in:
parent
5d4eca5a29
commit
b8620f7b3d
|
@ -5,7 +5,6 @@ always @*
|
||||||
else if (s == 2) o <= i[2*W+:W];
|
else if (s == 2) o <= i[2*W+:W];
|
||||||
else if (s == 3) o <= i[3*W+:W];
|
else if (s == 3) o <= i[3*W+:W];
|
||||||
else o <= {W{1'bx}};
|
else o <= {W{1'bx}};
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module mux_if_unbal_5_3 #(parameter N=5, parameter W=3) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
|
module mux_if_unbal_5_3 #(parameter N=5, parameter W=3) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
|
||||||
|
@ -17,7 +16,6 @@ always @* begin
|
||||||
if (s == 3) o <= i[3*W+:W];
|
if (s == 3) o <= i[3*W+:W];
|
||||||
if (s == 4) o <= i[4*W+:W];
|
if (s == 4) o <= i[4*W+:W];
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module mux_if_unbal_5_3_invert #(parameter N=5, parameter W=3) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
|
module mux_if_unbal_5_3_invert #(parameter N=5, parameter W=3) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
|
||||||
|
@ -32,7 +30,6 @@ always @*
|
||||||
else o <= i[2*W+:W];
|
else o <= i[2*W+:W];
|
||||||
else o <= i[1*W+:W];
|
else o <= i[1*W+:W];
|
||||||
else o <= {W{1'bx}};
|
else o <= {W{1'bx}};
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module mux_if_unbal_5_3_width_mismatch #(parameter N=5, parameter W=3) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
|
module mux_if_unbal_5_3_width_mismatch #(parameter N=5, parameter W=3) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
|
||||||
|
@ -44,10 +41,9 @@ always @* begin
|
||||||
if (s == 3) o <= i[3*W+:W];
|
if (s == 3) o <= i[3*W+:W];
|
||||||
if (s == 4) o <= i[4*W+:W];
|
if (s == 4) o <= i[4*W+:W];
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module mux_if_unbal_5_3_missing #(parameter N=5, parameter W=3) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
|
module mux_if_unbal_4_1_missing #(parameter N=5, parameter W=3) (input [N*W-1:0] i, input [$clog2(N)-1:0] s, output reg [W-1:0] o);
|
||||||
always @* begin
|
always @* begin
|
||||||
if (s == 0) o <= i[0*W+:W];
|
if (s == 0) o <= i[0*W+:W];
|
||||||
// else if (s == 1) o <= i[1*W+:W];
|
// else if (s == 1) o <= i[1*W+:W];
|
||||||
|
@ -55,5 +51,17 @@ always @* begin
|
||||||
else if (s == 3) o <= i[3*W+:W];
|
else if (s == 3) o <= i[3*W+:W];
|
||||||
else o <= {W{1'bx}};
|
else o <= {W{1'bx}};
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
|
module mux_if_unbal_5_3_order #(parameter N=5, parameter W=3) (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 == 3) o <= i[3*W+:W];
|
||||||
|
if (s == 2) o <= i[2*W+:W];
|
||||||
|
if (s == 1) o <= i[1*W+:W];
|
||||||
|
if (s == 4) o <= i[4*W+:W];
|
||||||
|
if (s == 0) o <= i[0*W+:W];
|
||||||
|
end
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,21 @@ miter -equiv -flatten -make_assert -make_outputs gold gate miter
|
||||||
sat -verify -prove-asserts -show-ports miter
|
sat -verify -prove-asserts -show-ports miter
|
||||||
|
|
||||||
design -load read
|
design -load read
|
||||||
hierarchy -top mux_if_unbal_5_3_missing
|
hierarchy -top mux_if_unbal_4_1_missing
|
||||||
|
prep
|
||||||
|
design -save gold
|
||||||
|
muxpack
|
||||||
|
opt
|
||||||
|
stat
|
||||||
|
select -assert-count 1 t:$pmux
|
||||||
|
design -stash gate
|
||||||
|
design -import gold -as gold
|
||||||
|
design -import gate -as gate
|
||||||
|
miter -equiv -flatten -make_assert -make_outputs gold gate miter
|
||||||
|
sat -verify -prove-asserts -show-ports miter
|
||||||
|
|
||||||
|
design -load read
|
||||||
|
hierarchy -top mux_if_unbal_5_3_order
|
||||||
prep
|
prep
|
||||||
design -save gold
|
design -save gold
|
||||||
muxpack
|
muxpack
|
||||||
|
|
Loading…
Reference in New Issue