I wrote a code like this:
if (a) begin
//some coding
end
else begin
stage = 0;
if (b) begin
if (stage == 0) begin
stage = 1;
end
else if (stage == 1) begin
stage = 2;
end
else begin
stage = 0;
end
else
// some coding
end
end
When stage is 1, the code inside stage == 1 cannot perform. Is there anything wrong with my code?