Browse Source

Add multi-letter printing, spams all lines with the same text for testing purposes

master
Pablo 3 years ago
parent
commit
f2d34d8129
  1. 2
      fontROM.vhd
  2. 2
      fuseRelaunch.cmd
  3. 1
      picoblaze.xise
  4. 58
      toplevel.vhd

2
fontROM.vhd

@ -12,7 +12,7 @@ use IEEE.NUMERIC_STD.ALL;
package fontROM is
type font_rom_type is array (0 to 2047) of std_logic_vector(7 downto 0);
type font_rom_type is array (0 to 2047) of std_logic_vector(0 to 7);
-- ROM
constant ROM : font_rom_type := ( -- 2^11-by-8

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"

1
picoblaze.xise

@ -287,6 +287,7 @@
<property xil_pn:name="Priority Encoder Extraction" xil_pn:value="Yes" xil_pn:valueState="default"/>
<property xil_pn:name="Produce Verbose Report" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Project Description" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Project Generator" xil_pn:value="ProjNav" xil_pn:valueState="default"/>
<property xil_pn:name="Property Specification in Project File" xil_pn:value="Store all values" xil_pn:valueState="default"/>
<property xil_pn:name="RAM Extraction" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="RAM Style" xil_pn:value="Auto" xil_pn:valueState="default"/>

58
toplevel.vhd

@ -87,20 +87,6 @@ signal clk_25 : std_logic;
signal ready : std_logic;
signal xCount, yCount : integer;
-- TODO: ROM VGA
type vga_rom_type is array (0 to 7) of std_logic_vector(0 to 7);
constant BALL_ROM : vga_rom_type :=
(
"00111100", -- ****
"01111110", -- ******
"01111110", -- ********
"11111111", -- ********
"11111111", -- ********
"01111110", -- ********
"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 :=
@ -109,9 +95,17 @@ constant COLOR_ROM : color_rom_type :=
"110"
);
signal rom_addr, rom_col: integer := 0;
signal rom_data: std_logic_vector(0 to 7);
signal rom_bit: std_logic;
-- ROM WORDS
type words_rom_type is array (0 to 5) of integer;
constant WORDS_ROM : words_rom_type :=
(
82,
97,
110,
105,
0,
1
);
-- cubo que se mueve por teclado
signal cube_x_min : integer := 300;
@ -183,7 +177,14 @@ begin
variable RGB : std_logic_vector(2 downto 0) := (others => '0');
variable x : integer;
variable y : integer;
variable rowData : std_logic_vector(7 downto 0) := (others => '0');
variable rowData : std_logic_vector(0 to 7) := (others => '0');
variable terminal_column : integer := 0;
variable terminal_row : integer := 0;
variable char_start_x : integer := 0;
variable char_end_x : integer := 0;
variable char_start_y : integer := 0;
variable char_end_y : integer := 0;
begin
if reset = '1' then
RGB := (others => '0');
@ -255,19 +256,28 @@ begin
RGB := "0" & "1" & "1";
end if;
-- Test lectura de rom
if xCount >= 100 AND xCount < 108 AND yCount >= 10 AND yCount < 26 then
x := (xCount - 100) mod 8;
y := (yCount - 10) mod 16;
-- Write current character
-- Get nearest valid char position using magic division/multiplication decimal crush
terminal_column := xCount / 8;
char_start_x := terminal_column * 8;
char_end_x := char_start_x + 8;
terminal_row := yCount / 16;
char_start_y := terminal_row * 16;
char_end_y := char_start_y + 16;
if xCount >= char_start_x AND xCount < char_end_x AND yCount >= char_start_y AND yCount < char_end_y AND terminal_column < WORDS_ROM'LENGTH then
x := (xCount - char_start_x) mod 8;
y := (yCount - char_start_y) mod 16;
--addrA <= y+16*1;
--rowData := dataOutA;
rowData := font_ROM(y+16*1);
rowData := font_ROM(y + 16 * WORDS_ROM(terminal_column));
if rowData(x) = '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

Loading…
Cancel
Save