I'm a bit confused about what is considered an input when you use the wildcard @*
in an always
block sensitivity list. For instance, in the following example, which signals are interpreted as inputs that cause the always
block to be reevaluated?
From what I understand, clk and reset aren't included because they don't appear on the right hand side of any procedural statement in the always
block. a and b are included because they both appear on the right hand side of procedural statements in the always
block.
But, where I'm really confused about is en and mux. Because they are used as test conditions in the if and case statements, are they considered inputs? Is the always
block reevaluated each time en and mux change value?
module example
(
input wire clk, reset, en, a, b,
input wire [1:0] mux,
output reg x,y, z
);
always @*
begin
x = a & b;
if (en)
y= a | b;
case(mux)
2'b00: z = 0;
2'b01: z = 1;
2'b10: z = 1;
2'b11: z = 0;
endcase
end
endmodule