The following is a code to capture data and the captured data is passed through a follower flip flop. The author of Paper on Synchronous and Asynchronous Resets says that the the rst_n
will be used as data enable for the second flip-flop, because both flip-flops are inferred from the same procedural block. Can anyone explain how will the simulator interpret this to be a Load-data
signal only for the second flip flop?
module badFFstyle (
output reg q2,
input d, clk, rst_n
);
reg q1;
always @(posedge clk)
if (!rst_n) q1 <= 1'b0;
else begin
q1 <= d;
q2 <= q1;
end
endmodule