Altera_Forum
Honored Contributor
16 years agofixing inferred latch
I got the following warning message about an inferred latch on a variable:
Warning (10240): Verilog HDL Always Construct warning at fifo.v(103): inferring latch(es) for variable "idx", which holds its previous value in one or more paths through the always construct And the corresponding RTL is: always @(posedge clk or negedge resetn) begin if (~resetn) begin for (idx=0; idx<2; idx=idx+1) mem[idx] <= {(WIDTH){1'b0}}; end else if (wr) begin mem[wr_ptr] <= inp_data; end end How can I go about fixing this? Quartus doesn't seem to provide further information beside the warning message. Where can I find more information on this inferred latch (perhaps from a netlist or latch instantiation logfile from the synthesizer)? Thanks!