Issues

Declaration issue

Declaring a local variable inside the always_comb block causes some issue with initialization.

always_comb begin

int i = 0; // Replace with "i=0;" and declare outside the always_comb

for (int j=0; j<8; j++) begin

<Loop logic to retrigger the block>

end

end

Here the "i" won't be initialized when the block is re-triggered. The initialization only happens when the always_block is entered for the first time in the simulation cycle.