K
kb33
Guest
Hi,
I have matched all the if-else statements in the following code, but
cannot get rid of the warnings for all the array elements:
"Latch generated from always block for signal array1_comb[1][15][7:0],
probably caused by a missing assignment in an if or case stmt"
....and so on for the others as well.
The code (with some missing I/O definitions) is:
reg [`DATA_SZ-1:0] array1 [0:`NUM_RSRC-1][0:`NUM_ATTRIB-1],
array1_comb [0:`NUM_RSRC-1]
[0:`NUM_ATTRIB-1];
always @(posedge sys_clk)
begin
for (i = 0; i < `NUM_RSRC; i = i+1)
for (j=0; j < `NUM_ATTRIB; j=j+1)
array1 [j] <= #1 array1_comb [j];
end
//array1_comb...
always @(reset_n, match_state, curr_attrib, rsrc_id, data_in)
begin
if (~reset_n)
for (k = 0; k < `NUM_RSRC; k = k+1)
for (l=0; l < `NUM_ATTRIB; l=l+1)
array1_comb [k][l] <= 0;
else if (match_state == `RECORD_RSRC)
begin
for (k = 0; k < `NUM_RSRC; k = k+1)
if (k == rsrc_id)
for (l=0; l < `NUM_ATTRIB; l=l+1)
if (l == curr_attrib)
array1_comb [k][l] <= data_in;
else
array1_comb [k][l] <= array1 [k][l];
else
array1_comb [k][l] <= array1 [k][l];
end
else
for (k = 0; k < `NUM_RSRC; k = k+1)
for (l=0; l < `NUM_ATTRIB; l=l+1)
array1_comb [k][l] <= array1 [k][l];
end // always @ (reset_n, match_state, curr_attrib, rsrc_id,
data_in)
I have matched all the if-else statements in the following code, but
cannot get rid of the warnings for all the array elements:
"Latch generated from always block for signal array1_comb[1][15][7:0],
probably caused by a missing assignment in an if or case stmt"
....and so on for the others as well.
The code (with some missing I/O definitions) is:
reg [`DATA_SZ-1:0] array1 [0:`NUM_RSRC-1][0:`NUM_ATTRIB-1],
array1_comb [0:`NUM_RSRC-1]
[0:`NUM_ATTRIB-1];
always @(posedge sys_clk)
begin
for (i = 0; i < `NUM_RSRC; i = i+1)
for (j=0; j < `NUM_ATTRIB; j=j+1)
array1 [j] <= #1 array1_comb [j];
end
//array1_comb...
always @(reset_n, match_state, curr_attrib, rsrc_id, data_in)
begin
if (~reset_n)
for (k = 0; k < `NUM_RSRC; k = k+1)
for (l=0; l < `NUM_ATTRIB; l=l+1)
array1_comb [k][l] <= 0;
else if (match_state == `RECORD_RSRC)
begin
for (k = 0; k < `NUM_RSRC; k = k+1)
if (k == rsrc_id)
for (l=0; l < `NUM_ATTRIB; l=l+1)
if (l == curr_attrib)
array1_comb [k][l] <= data_in;
else
array1_comb [k][l] <= array1 [k][l];
else
array1_comb [k][l] <= array1 [k][l];
end
else
for (k = 0; k < `NUM_RSRC; k = k+1)
for (l=0; l < `NUM_ATTRIB; l=l+1)
array1_comb [k][l] <= array1 [k][l];
end // always @ (reset_n, match_state, curr_attrib, rsrc_id,
data_in)