3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-15 15:25:28 +00:00

Add RF initialization

This commit is contained in:
Miodrag Milanovic 2024-05-17 09:28:07 +02:00
parent 7e4aef06e4
commit 9d6b47466f
3 changed files with 29 additions and 5 deletions

View file

@ -0,0 +1,17 @@
function [9728-1:0] rf_init_to_string;
input [1152-1:0] array;
input integer blocks;
input integer width;
reg [9728-1:0] temp; // (1152+1152/18)*8
integer i;
begin
temp = "";
for (i = 0; i < blocks; i = i + 1) begin
if (i != 0) begin
temp = {temp, ","};
end
temp = {temp, $sformatf("%b",array[(i+1)*width-1: i*width])};
end
rf_init_to_string = temp;
end
endfunction