I am looking at some Verilog stuff from 'asic-world' and have a question about the asynchronous reset. Not very sure how does it work when the reset is at its positive edge. If only consider the rising edge of reset, the Verilog code below check whether reset is equal to 1 for resetting. If reset is 1, then output gets reset to ZERO. But since it happens at the rising edge of reset, reset is in a metastable state, which is neither 0 nor 1. So, checking the value of reset at the positive edge of reset does not really make sense to me. Could anyone please explain it?
Verilog code from Asic-world:
module asyn_reset(clk,reset,a,c);
input clk;
input reset;
input a;
output c;
wire clk;
wire reset;
wire a;
reg c;
always @ (posedge clk or posedge reset)
if ( reset == 1'b1) begin
c <= 0;
end else begin
c <= a;
end
endmodule