Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/11/2009, 13:01
Mario19_86
 
Fecha de Ingreso: agosto-2008
Mensajes: 29
Antigüedad: 15 años, 9 meses
Puntos: 0
Pelota con vhdl

Hola a todos, estoy intentando desarrollar un pong en Vhdl, me encuentro algo atrancado para conseguir el movimiento de la pelota de momento en el eje x, ni siquiera me la pinta, no se si alguien podría echarme una mano, trabajo con Xilinx ISE 11.1, la FPGA es una Spartan 3, el codigo que uso es el siguiente y como digo no me pinta pelota ni la mueve: ESTE ES Mi CODIGO SI ALGUIEN TIENE ALGUNO QUE LE FUNCIONE ME SERIA DE GRAN AYUDA

La signal reloj es la de la fpga:

RELOJPELOTA: process (reloj)
begin
if reset='1' then
contadorpelota <=0;
clockpelota<='0';
elsif (reloj'event and reloj='1') then
contadorpelota <=contadorpelota +1;
if contadorpelota =30000000 then
clockpelota<=not clockpelota;
clockpelota<=0;
else clockpelota<=clockpelota;
end if;
end if;
end process RELOJPLATANO;

MOVERPELOTA: process(clockpelota)
begin
if reset='1' then //////POSICION INICIAL
x<="000101000";
y<="0010011001";
elsif (clockpelota'event and clockpelota='1') then
if x<281 then
x<=x+1;
else
x<="000101000";
end if;
end if;
end process MOVERPELOTA;

PINTAPELOTA: process(hcnt,vcnt,x,y)
begin
if (hcnt>=x and hcnt <x+5 and hcnt<281) and (vcnt>y and vcnt<y+10) then
rgb<='111111111';
else
rgb<='000000000';
end if;
end process PINTAPELOTA;