Well this is Xilinx specific but take a look at the three modules below: overlay,vga_dump_ram
What I remember is that the row and column registers point to both the dump RAM and the font ROM at the same time. With the lower bits going to the font ROM. Your idea of using
8 by 8 fonts is a good one, even if you don't use all the rows or columns of the font.
These modules create a one bit output that must be anded into your video stream.
Sorry I wrote these before I was inferring RAMs and ROMs but I think the Altera switch should be straight forward.
You also mentioned that you want to spit out the values of a register which will take some doing because you will need to mux the nibbles somehow.
Good Luck,
Brad Smallridge AiVision
library IEEE; use IEEE.STD_LOGIC_1164.ALL;
entity overlay is port( vga_clk : in std_logic; vga_reset : in std_logic; vga_row : in std_logic_vector( 8 downto 0); vga_col : in std_logic_vector(11 downto 0); q : out std_logic; wr_clk : in std_logic; wr_reset : in std_logic; wr_en : in std_logic; wr_stop : in std_logic; wr_addr : in std_logic_vector(11 downto 0); wr_data : in std_logic_vector( 7 downto 0) ); end overlay;
architecture behave of overlay is
component vga_dump_ram is port ( rst : in std_logic; clk_a : in std_logic; wr_a : in std_logic; data_a : in std_logic_vector(7 downto 0); addr_a : in std_logic_vector(11 downto 0); clk_b : in std_logic; addr_b : in std_logic_vector(11 downto 0); high_b : in std_logic; -- high nibble dout_b : out std_logic_vector(3 downto 0) ); end component;
signal vga_nibble_addr : std_logic_vector(11 downto 0); signal vga_nibble_high : std_logic; signal vga_nibble : std_logic_vector( 3 downto 0);
component vga_font is port ( clk : in std_logic; rst : in std_logic; addr : in std_logic_vector(14 downto 0); q : out std_logic ); end component;
signal vga_font_addr : std_logic_vector(14 downto 0); signal vga_font_row_1 : std_logic_vector( 2 downto 0); signal vga_font_row_2 : std_logic_vector( 2 downto 0); signal vga_font_col_1 : std_logic_vector( 2 downto 0); signal vga_font_col_2 : std_logic_vector( 2 downto 0); signal vga_font_bit : std_logic; signal vga_font_bit_1 : std_logic; signal vga_font_bit_2 : std_logic; signal vga_font_bit_3 : std_logic; signal vga_font_bit_4 : std_logic;
-- added for wr_stop timing signal wr_data_1 : std_logic_vector( 7 downto 0); signal wr_data_2 : std_logic_vector( 7 downto 0); signal wr_addr_1 : std_logic_vector(11 downto 0); signal wr_addr_2 : std_logic_vector(11 downto 0); signal wr_en_1 : std_logic; signal wr_en_2 : std_logic;
begin
-- This process adds two clock delays to the -- address font look-up-table and compensates -- for the character nibble look-up-table delay vga_font_addr_process: process(vga_clk) begin if(vga_clk'event and vga_clk='1') then vga_font_row_1 "READ_FIRST", -- WRITE_FIRST, READ_FIRST or NO_CHANGE WRITE_WIDTH_A => 9, -- Valid values are 1,2,4,9,18 or 36 WRITE_WIDTH_B => 9) -- Valid values are 1,2,4,9,18 or 36
port map ( CASCADEOUTA => open, -- 1-bit cascade output CASCADEOUTB => open, -- 1-bit cascade output DOA => open, -- 32-bit A port Data Output DOB => dob, -- 32-bit B port Data Output DOPA => open, -- 4-bit A port Parity Output DOPB => open, -- 4-bit B port Parity Output ADDRA => addra, -- 15-bit A port Address Input ADDRB => addrb, -- 15-bit B port Address Input CASCADEINA => '0', -- 1-bit cascade A input CASCADEINB => '0', -- 1-bit cascade B input CLKA => clk_a, -- Port A Clock CLKB => clk_b, -- Port B Clock DIA => dia, -- 32-bit A port Data Input DIB => (others=>'1'), -- 32-bit B port Data Input DIPA => (others=>'1'), -- 4-bit A port parity Input DIPB => (others=>'1'), -- 4-bit B port parity Input ENA => '1', -- 1-bit A port Enable Input ENB => '1', -- 1-bit B port Enable Input REGCEA => '1', -- 1-bit A port register enable input REGCEB => '1', -- 1-bit B port register enable input SSRA => '0', -- 1-bit A port Synchronous Set/Reset Input SSRB => '0', -- 1-bit B port Synchronous Set/Reset Input WEA => wea, -- 4-bit A port Write Enable Input WEB => (others=>'0') ); -- 4-bit B port Write Enable Input
dout_b