Forum Discussion
Altera_Forum
Honored Contributor
8 years agoThis is incorrect semantics for implementing a synchronously clocked register with an asynchronous reset:
always @ (posedge rdclk)
begin
r_addr <= r_addr + 1;
D_Out <= addr;
end
always @ (nrst)
begin
if (!nrst)
begin
r_addr <= 0;
end
end
You need to rewrite the each register as a single always block:
always @ (posedge rdclk or negedge nrst)
begin
if (!nrst)
begin
r_addr <= 0;
end
else
begin
r_addr <= r_addr + 1;
D_Out <= addr;
end
end