Altera_Forum
Honored Contributor
16 years agoInferred latches for variables
I have problem in determine wat is the actual problem given by these two warnings:
Warning (10235): Verilog HDL Always Construct warning at decimal_to_binary.v(32): variable "count" is read inside the Always Construct but isn't in the Always Construct's Event Control Warning (10240): Verilog HDL Always Construct warning at decimal_to_binary.v(29): inferring latch(es) for variable "b", which holds its previous value in one or more paths through the always construct here is part of my code: module decimal_to_binary (trigger, trigger_A, trigger_B, inputA, inputB, A, B, C, D, E, F, G, H, I, J); input A, B, C, D, E, F, G, H, I, J; reg [3:0] count=4'b0000; input trigger; input trigger_A; input trigger_B; output reg [31:0] inputA; output reg [31:0] inputB; reg [31:0] stage [9:0]; integer a, b, c, d, e, f, g, h, i, j; always@(trigger) begin if(trigger == 1) count = count + 1; case(count) 1: begin if(A == 1) a = 0000000000; else if(B == 1) b = 1000000000; else if(C == 1) c = 2000000000; else if(D == 1) d = 3000000000; else if(E == 1) e = 4000000000; stage[0] = a + b + c + d + e + f + g + h + i + j; a = 32'b00000000000000000000000000000000; b = 32'b00000000000000000000000000000000; c = 32'b00000000000000000000000000000000; d = 32'b00000000000000000000000000000000; e = 32'b00000000000000000000000000000000; f = 32'b00000000000000000000000000000000; g = 32'b00000000000000000000000000000000; h = 32'b00000000000000000000000000000000; i = 32'b00000000000000000000000000000000; j = 32'b00000000000000000000000000000000; end