diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-01-18 19:27:16 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-01-18 19:31:40 +0100 |
commit | 3d7a1491aac0849a2a9fae2a06242e125de883d0 (patch) | |
tree | 61f7d0af0a2b0d22ee1073f030b6680644f6c123 /techlibs/common | |
parent | 13359d65ba8cc4a968b5b27deef4040fb2430899 (diff) | |
download | yosys-3d7a1491aac0849a2a9fae2a06242e125de883d0.tar.gz yosys-3d7a1491aac0849a2a9fae2a06242e125de883d0.tar.bz2 yosys-3d7a1491aac0849a2a9fae2a06242e125de883d0.zip |
Fixed $lut simlib model for a wider range of tools
Diffstat (limited to 'techlibs/common')
-rw-r--r-- | techlibs/common/simlib.v | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/techlibs/common/simlib.v b/techlibs/common/simlib.v index e522e37c6..0e041e12e 100644 --- a/techlibs/common/simlib.v +++ b/techlibs/common/simlib.v @@ -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 >> (2**(WIDTH-1))) ) lut1 ( .I(I[WIDTH-2:0]), .O(lut1_out) ); end -endgenerate -always @* begin - casez ({I[WIDTH-1], lut0_out, lut1_out}) - 3'b?11: O = 1'b1; - 3'b?00: O = 1'b0; - 3'b0??: O = lut0_out; - 3'b1??: O = lut1_out; - default: O = 1'bx; - endcase -end + if (WIDTH > 0) begin:lutlogic + always @* begin + casez ({I[WIDTH-1], lut0_out, lut1_out}) + 3'b?11: O = 1'b1; + 3'b?00: O = 1'b0; + 3'b0??: O = lut0_out; + 3'b1??: O = lut1_out; + default: O = 1'bx; + endcase + end + end +endgenerate endmodule |