mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Fixed $lut simlib model for a wider range of tools
This commit is contained in:
parent
13359d65ba
commit
3d7a1491aa
|
@ -715,17 +715,19 @@ generate
|
||||||
\$lut #( .WIDTH(WIDTH-1), .LUT(LUT ) ) lut0 ( .I(I[WIDTH-2:0]), .O(lut0_out) );
|
\$lut #( .WIDTH(WIDTH-1), .LUT(LUT ) ) lut0 ( .I(I[WIDTH-2:0]), .O(lut0_out) );
|
||||||
\$lut #( .WIDTH(WIDTH-1), .LUT(LUT >> (2**(WIDTH-1))) ) lut1 ( .I(I[WIDTH-2:0]), .O(lut1_out) );
|
\$lut #( .WIDTH(WIDTH-1), .LUT(LUT >> (2**(WIDTH-1))) ) lut1 ( .I(I[WIDTH-2:0]), .O(lut1_out) );
|
||||||
end
|
end
|
||||||
endgenerate
|
|
||||||
|
|
||||||
always @* begin
|
if (WIDTH > 0) begin:lutlogic
|
||||||
casez ({I[WIDTH-1], lut0_out, lut1_out})
|
always @* begin
|
||||||
3'b?11: O = 1'b1;
|
casez ({I[WIDTH-1], lut0_out, lut1_out})
|
||||||
3'b?00: O = 1'b0;
|
3'b?11: O = 1'b1;
|
||||||
3'b0??: O = lut0_out;
|
3'b?00: O = 1'b0;
|
||||||
3'b1??: O = lut1_out;
|
3'b0??: O = lut0_out;
|
||||||
default: O = 1'bx;
|
3'b1??: O = lut1_out;
|
||||||
endcase
|
default: O = 1'bx;
|
||||||
end
|
endcase
|
||||||
|
end
|
||||||
|
end
|
||||||
|
endgenerate
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue