As you can see in the cursor below, the if statement looks AFTER the transition (it sees rst = 0 and thus sets a equal to in) rather than seeing rst = 1.
BUT it can also be seen that c takes the value of a BEFORE the transition.
I am wondering why this is. Suppose you want to gate a register with an enable that is delayed on clock cycle, then you can not use if (enable_delayed) because (ideally) the falling transition will happen on the rising edge of the clock and thus not be detected in simulation.
I have not had success finding my problem online. It is hard to explain and search for. Thanks for the help.
Code:
module project_test
( input logic clk, rst,
input logic in,
output logic a,
output logic b,
output logic c
);
always@(posedge clk)
if(rst) a <= 1'b0;
else a <= in;
always@(posedge clk)
if(a) b <= a;
always@(posedge clk)
c <= a;
endmodule: project_test