Altera_Forum
Honored Contributor
13 years agoCan someone please help me get this to compile
I can get this to compile and ive been at it for two days I dont get it
Can someone please help me to find why it wont compile. The issue seems to be from the top If condition that uses SIGNAL_in and A_reg; If i comment that sensativity list out and that correspsonding of condition it will compile Its just a counter that has signals that go in and out of it from other counters. The SIGNAL_IN is a reg type from the counter stacked on top of it. The error is only in this .v file not the other counter. Please help im pulling my hair out.module last_row_counter(A,OVERFLOW,CLK,RST, upcount,SIGNAL,SIGNAL_IN);
input wire CLK, RST, upcount;
input wire SIGNAL_IN;
output wire OVERFLOW;
output wire A;
output wire SIGNAL;
reg OVERFLOW_reg;
reg A_reg;
reg SIGNAL_reg;
assign SIGNAL=SIGNAL_reg;
assign A=A_reg;
assign OVERFLOW=OVERFLOW_reg;
always @ (posedge CLK or negedge RST)
begin
if (SIGNAL_IN==4'b0100 && A_reg== 4'b0010)
begin
A_reg<=4'b0000;
SIGNAL_reg<=4'b0000;
end
end
always @ (posedge CLK or negedge RST)
if (~RST) begin
OVERFLOW_reg <= 1'b0;
A_reg<= 4'b0000;
SIGNAL_reg<=4'b0000;
end
else if ( upcount == 1 )
begin
if (A<9) begin
A_reg <= A_reg + 1'b1;
SIGNAL_reg<=SIGNAL_reg+1'b1;
OVERFLOW_reg <= 1'b0;
end
else begin
A_reg <= 4'b0000;
SIGNAL_reg<=4'b0000;
OVERFLOW_reg <= 1'b1;
end
end
else
begin
if (A>2) begin //This is my count down
A_reg <= A_reg - 1'b1;
OVERFLOW_reg <= 1'b0;
end
else begin
A_reg <= 4'b1001;
OVERFLOW_reg <= 1'b1;
end
end
endmodule