Consider code as follows:
reg [2:0] cnt;
// a is an input (say 4 bit) to design and being assigned after some manipulation
// to some other variable
always @(a)
for (cnt = 0; cnt < 4; cnt = cnt+1) begin
//some operation involving a [bitwise]
end
Now as you can see I didn’t include cnt in event list of always block as cnt is not referenced / assigned outside always block and is completely iterated through with for loop
My question is should I have cnt on event list?
The way the sensitivity list of the always block works is that once one of the input changes, the always block will execute until it reaches the end, and then it will wait for another change in the sensitivity list.
In your case if you change
a, it should run through all 4 loops of your for loop and then finish, so havingcntin the sensitivity list would not be a requirement.That said, I’m having trouble imagining what kind of logic this is supposed to synthesize to. Is your for loop something that should be clocked, or is it intended to execute instantaneously?