Browse Source

Add test implementation of displaying a sprite stored in rom

master
Pablo 3 years ago
parent
commit
189ce89b10
  1. 2
      fuseRelaunch.cmd
  2. 2
      isim.cmd
  3. 2
      picoblaze.xise
  4. 36
      toplevel.vhd

2
fuseRelaunch.cmd

@ -1 +1 @@
-intstyle "ise" -incremental -o "/home/rani/Desktop/git/picoblaze-lab/tb_vga1_isim_beh.exe" -prj "/home/rani/Desktop/git/picoblaze-lab/tb_vga1_beh.prj" "work.tb_vga1"
-intstyle "ise" -incremental -o "/home/hal/Dev/picoblaze-lab/tb_vga1_isim_beh.exe" -prj "/home/hal/Dev/picoblaze-lab/tb_vga1_beh.prj" "work.tb_vga1"

2
isim.cmd

@ -1,3 +1,3 @@
onerror {resume}
wave add /
run 1000 ns;
run 16.6ms;

2
picoblaze.xise

@ -335,7 +335,7 @@
<property xil_pn:name="Shift Register Extraction" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Show All Models" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Model Target" xil_pn:value="VHDL" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Run Time ISim" xil_pn:value="1000 ns" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Run Time ISim" xil_pn:value="16.6ms" xil_pn:valueState="non-default"/>
<property xil_pn:name="Simulation Run Time Map" xil_pn:value="1000 ns" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Run Time Par" xil_pn:value="1000 ns" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Run Time Translate" xil_pn:value="1000 ns" xil_pn:valueState="default"/>

36
toplevel.vhd

@ -37,7 +37,7 @@ architecture behavioral of toplevel is
end component;
-----------------------------------------------------------------
-- declaración de la ROM de programa
-- declaracin de la ROM de programa
-----------------------------------------------------------------
component programa_helloworld_int
Port ( address : in std_logic_vector(7 downto 0);
@ -97,6 +97,15 @@ constant BALL_ROM : vga_rom_type :=
"01111110", -- ******
"00111100" -- ****
);
-- ROM COLOR
type color_rom_type is array (0 to 1) of std_logic_vector(0 to 2);
constant COLOR_ROM : color_rom_type :=
(
"101",
"110"
);
signal rom_addr, rom_col: integer := 0;
signal rom_data: std_logic_vector(0 to 7);
signal rom_bit: std_logic;
@ -107,7 +116,7 @@ signal cube_x_max : integer := 340;
signal cube_y_min : integer := 220;
signal cube_y_max : integer := 260;
-- Añadimos el controlador de VGA
-- Aadimos el controlador de VGA
component controllerVGA
port (
clk : in std_logic;
@ -129,7 +138,7 @@ begin
port_id <= portid;
in_port <= inport;
out_port <= outport;
picoint <= NOT rx; -- La señal de inicio de RX es un 0.
picoint <= NOT rx; -- La seal de inicio de RX es un 0.
-- Metemos un 1 al pico cuando recibimos.
processor: picoblaze
@ -166,6 +175,9 @@ begin
process(clk_25,reset)
-- Variable para los colores. CARGA INSTANTANEA DEL VALOR, SOLO PARA USO TEMPORAL!!
variable RGB : std_logic_vector(2 downto 0) := (others => '0');
variable row : integer;
variable col : integer;
variable rowData : std_logic_vector(7 downto 0) := (others => '0');
begin
if reset = '1' then
RGB := (others => '0');
@ -192,7 +204,7 @@ begin
RGB := "1" & "1" & "0";
end if;
-- Por si queremos dibujar más mierda va aqui
-- Por si queremos dibujar ms mierda va aqui
if(writestrobe = '1' AND portid=x"FE") then
case outport is
@ -236,6 +248,18 @@ begin
yCount>=cube_y_min AND yCount<cube_y_max) then
RGB := "0" & "1" & "1";
end if;
-- Test lectura de rom
if xCount >= 100 AND xCount < 108 AND yCount >= 10 AND yCount < 18 then
row := (xCount - 100) mod 8;
col := (yCount - 10) mod 8;
rowData := BALL_ROM(row);
if rowData(col) = '1' then
RGB := COLOR_ROM(0);
end if;
end if;
-- Prueba de todos los colores. Rayas de 2px de arriba a abajo.
-- if xCount >= 310 AND xCount < 312 then
@ -271,7 +295,7 @@ begin
end if;
end process;
--registra el bit tx del puerto de salida, por si éste cambia
--registra el bit tx del puerto de salida, por si ste cambia
-- Usamos el puerto FF.
txbuff:process(reset, clk)
begin
@ -284,7 +308,7 @@ begin
end if;
end process;
--añade 7ceros a rx para meterlos al puerto de entrada cuando se lea
--aade 7ceros a rx para meterlos al puerto de entrada cuando se lea
-- Usamos el puerto FF.
rxbuff:process(reset, clk)
begin

Loading…
Cancel
Save