Altera_Forum
Honored Contributor
16 years agoTestbench in Modelsim problem: no signal clear in a loop
Hi,
I'm doing a project that writes text in a VGA. I'm doing the testbench to try everything, and i want to generate the rows and columns of my VGA with the testbench, i need it to know which pixel i have to write. I'm using a 640x480 resolution, so using a 25.175MHz clock, i have to generate 800 columns and 528 rows. But this isn't the problem... The problem is when i try to generate those rows and columns, with two for loops, the signal column doesn't clear, .... The Fila (row) signal increases every 800 Columna(column) but Columna doesn't clear, so it grows till 1023(10bits) and overflows, so changes to 0. any suggestion?
signal Clck : std_logic :='0';
constant PERIOD1 : time := 60 ns;
--Clock generation:
gen_clock : process(Clck)
begin
Clck <= not Clck after PERIOD1/2;
end process;
--Row & Column generation for the system
gen_col_row : process
begin
nReset<='0';
wait for PERIOD1;
nReset<='1';
Columna<=(others=>'0'); --Initialize counters
Fila<=(others=>'0');
wait until ((Clck'event) AND (Clck='1')); --Clock synchronization
for i in 1 to 528 loop --Generates Fila(Row)
for j in 1 to 800 loop --Generates Columna(Column)
Columna<=Columna+'1';--Columna = column in spanish...
wait for PERIOD1;
end loop;
Columna<=(others=>'0'); --THIS DOESN'T WORK!!!!!!
Fila<=Fila+'1';--Fila=Row in spanish....
end loop;
end process;
Thank you very much! Sergi.