mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-25 21:57:01 +00:00
Clean up
This commit is contained in:
parent
da3d2eedd2
commit
b304744d15
1 changed files with 4 additions and 6 deletions
|
@ -70,6 +70,8 @@ module \$lut (A, Y);
|
||||||
parameter WIDTH = 0;
|
parameter WIDTH = 0;
|
||||||
parameter LUT = 0;
|
parameter LUT = 0;
|
||||||
|
|
||||||
|
input [WIDTH-1:0] A;
|
||||||
|
output Y;
|
||||||
|
|
||||||
// Need to swap input ordering, and fix init accordingly,
|
// Need to swap input ordering, and fix init accordingly,
|
||||||
// to match ABC's expectation of LUT inputs in non-decreasing
|
// to match ABC's expectation of LUT inputs in non-decreasing
|
||||||
|
@ -86,19 +88,15 @@ module \$lut (A, Y);
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function [2**P_WIDTH-1:0] permute_init;
|
function [2**P_WIDTH-1:0] permute_init;
|
||||||
input [2**P_WIDTH-1:0] orig;
|
|
||||||
integer i;
|
integer i;
|
||||||
begin
|
begin
|
||||||
permute_init = 0;
|
permute_init = 0;
|
||||||
for (i = 0; i < 2**P_WIDTH; i = i + 1)
|
for (i = 0; i < 2**P_WIDTH; i = i + 1)
|
||||||
permute_init[i] = orig[permute_index(i)];
|
permute_init[i] = LUT[permute_index(i)];
|
||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
parameter [2**P_WIDTH-1:0] P_LUT = permute_init(LUT);
|
parameter [2**P_WIDTH-1:0] P_LUT = permute_init();
|
||||||
|
|
||||||
input [WIDTH-1:0] A;
|
|
||||||
output Y;
|
|
||||||
|
|
||||||
generate
|
generate
|
||||||
if (WIDTH == 1) begin
|
if (WIDTH == 1) begin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue