Forum Discussion
Altera_Forum
Honored Contributor
13 years agoI'm trying to get rid of this warning:
Warning (13004): Presettable and clearable registers converted to equivalent circuits with latches. Registers power-up to an undefined state, and DEVCLRn places the registers in an undefined state.
Warning (13310): Register "addr_register" is converted into an equivalent circuit using register "addr_register~_emulated" and latch "addr_register~latch"
All 8 bits in my addr_register have this warning. If I make the address register very simple like this it works and that warning goes away:
always_ff @ (posedge ale_clk)
begin
addr_register <= data_in;
end
However, what I want is to automatically increment the addr_register after every rd or wr. There are other conditions on the increment which I have combined into a single bit called addr_incr. So here is the code with the increment operation added in:
always_ff @ (posedge ale_clk, negedge end_rd_or_wr)
begin
if (ale_clk) addr_register <= data_in;
else addr_register <= addr_register + addr_incr;
end
Now it creates that warning and converts this into a latch. This is happening in several areas of my code wherever I implement any kind of increment or decrement on a register. Is this OK? If not, how do you increment or decrement a register?