1 -------------------------------------------------------------------------
\r
3 -- Filename: textmode_vga_component_pkg.vhd
\r
6 -- Short Description:
\r
7 -- ==================
\r
8 -- This package contains the declaration of all componets
\r
9 -- used within the textmode VGA controller implementation.
\r
11 -------------------------------------------------------------------------
\r
14 use ieee.std_logic_1164.all;
15 use ieee.numeric_std.all;
16 use work.math_pkg.all;
17 use work.textmode_vga_pkg.all;
18 use work.font_pkg.all;
19 use work.textmode_vga_platform_dependent_pkg.all;
21 package textmode_vga_component_pkg is
22 component textmode_vga_h_sm is
25 sys_clk, sys_res_n : in std_logic;
27 background_color : in std_logic_vector(RED_BITS + GREEN_BITS + BLUE_BITS - 1 downto 0);
29 char_cnt : out std_logic_vector(log2c(COLUMN_COUNT) - 1 downto 0);
30 char_line_cnt : in std_logic_vector(log2c(LINE_COUNT) - 1 downto 0);
31 cursor_column : in std_logic_vector(log2c(COLUMN_COUNT) - 1 downto 0);
32 cursor_line : in std_logic_vector(log2c(LINE_COUNT) - 1 downto 0);
33 cursor_color : in std_logic_vector(RED_BITS + GREEN_BITS + BLUE_BITS - 1 downto 0);
34 cursor_state : in CURSOR_STATE_TYPE;
35 decoded_char : in std_logic_vector(0 to CHAR_WIDTH - 1);
36 color : in std_logic_vector(RED_BITS + GREEN_BITS + BLUE_BITS - 1 downto 0);
38 is_data_line : in std_logic;
39 is_eol : out std_logic;
41 hsync_n : out std_logic;
42 rgb : out std_logic_vector(RED_BITS + GREEN_BITS + BLUE_BITS - 1 downto 0);
45 end component textmode_vga_h_sm;
47 component textmode_vga_v_sm is
50 sys_clk, sys_res_n : in std_logic;
52 is_data_line : out std_logic;
53 char_line_cnt : out std_logic_vector(log2c(LINE_COUNT) - 1 downto 0);
54 char_height_pixel : out std_logic_vector(log2c(CHAR_HEIGHT) - 1 downto 0);
55 is_eol : in std_logic;
57 vsync_n : out std_logic
59 end component textmode_vga_v_sm;
61 component textmode_vga is
64 VGA_CLK_FREQ : integer;
65 BLINK_INTERVAL_MS : integer;
70 sys_clk, sys_res_n : in std_logic;
71 command : in std_logic_vector(COMMAND_SIZE - 1 downto 0);
72 command_data : in std_logic_vector(3 * COLOR_SIZE + CHAR_SIZE - 1 downto 0);
75 vga_clk, vga_res_n : in std_logic;
76 vsync_n : out std_logic;
77 hsync_n : out std_logic;
78 r : out std_logic_vector(RED_BITS - 1 downto 0);
79 g : out std_logic_vector(GREEN_BITS - 1 downto 0);
80 b : out std_logic_vector(BLUE_BITS - 1 downto 0)
82 end component textmode_vga;
84 component video_memory is
88 ROW_ADDR_WIDTH : integer;
89 COL_ADDR_WIDTH : integer
93 vga_clk : in std_logic;
94 vga_row_address : in std_logic_vector(ROW_ADDR_WIDTH - 1 downto 0);
95 vga_col_address : in std_logic_vector(COL_ADDR_WIDTH - 1 downto 0);
96 vga_data : out std_logic_vector(DATA_WIDTH - 1 downto 0);
97 sm_row_address : in std_logic_vector(ROW_ADDR_WIDTH - 1 downto 0);
98 sm_col_address : in std_logic_vector(COL_ADDR_WIDTH - 1 downto 0);
99 sm_data : in std_logic_vector(DATA_WIDTH - 1 downto 0);
100 sm_wr : in std_logic;
101 sm_scroll_address : in std_logic_vector(ROW_ADDR_WIDTH - 1 downto 0)
103 end component video_memory;
108 inclk0 : in std_logic;
113 component console_sm is
116 vga_clk, vga_res_n : in std_logic;
117 command : in std_logic_vector(COMMAND_SIZE - 1 downto 0);
118 command_data : in std_logic_vector(3 * COLOR_SIZE + CHAR_SIZE - 1 downto 0);
119 command_req : in std_logic;
122 column_address : out std_logic_vector(log2c(COLUMN_COUNT) - 1 downto 0);
123 row_address : out std_logic_vector(log2c(LINE_COUNT) - 1 downto 0);
124 data : out std_logic_vector(RED_BITS + GREEN_BITS + BLUE_BITS + CHAR_SIZE - 1 downto 0);
126 scroll_address : out std_logic_vector(log2c(LINE_COUNT) - 1 downto 0);
127 background_color : out std_logic_vector(RED_BITS + GREEN_BITS + BLUE_BITS - 1 downto 0);
128 cursor_color : out std_logic_vector(RED_BITS + GREEN_BITS + BLUE_BITS - 1 downto 0);
129 cursor_state : out CURSOR_STATE_TYPE
131 end component console_sm;
133 component font_rom is
136 vga_clk : in std_logic;
137 char : in std_logic_vector(log2c(CHAR_COUNT) - 1 downto 0);
138 char_height_pixel : in std_logic_vector(log2c(CHAR_HEIGHT) - 1 downto 0);
139 decoded_char : out std_logic_vector(0 to CHAR_WIDTH - 1)
141 end component font_rom;
143 component console_sm_sync is
146 SYNC_STAGES : integer
150 sys_clk, sys_res_n : in std_logic;
151 command_sys : in std_logic_vector(COMMAND_SIZE - 1 downto 0);
152 command_data_sys : in std_logic_vector(3 * COLOR_SIZE + CHAR_SIZE - 1 downto 0);
153 free_sys : out std_logic;
155 vga_clk, vga_res_n : in std_logic;
156 command_vga : out std_logic_vector(COMMAND_SIZE - 1 downto 0);
157 command_data_vga : out std_logic_vector(3 * COLOR_SIZE + CHAR_SIZE - 1 downto 0);
158 command_req_vga : out std_logic;
159 ack_vga : in std_logic
161 end component console_sm_sync;
163 component interval is
167 INTERVAL_TIME_MS : integer
172 res_n : in std_logic;
173 active : out std_logic
175 end component interval;
176 end package textmode_vga_component_pkg;