1 -------------------------------------------------------------------------------
2 -- Title : vga_control architecture
3 -- Project : LU Digital Design
4 -------------------------------------------------------------------------------
5 -- File : vga_control.vhd
6 -- Author : Thomas Handl
8 -- Created : 2004-12-15
9 -- Last update: 2006-02-24
10 -------------------------------------------------------------------------------
11 -- Description: generation of colors (RGB)
12 -------------------------------------------------------------------------------
13 -- Copyright (c) 2004 TU Wien
14 -------------------------------------------------------------------------------
16 -- Date Version Author Description
17 -- 2004-12-15 1.0 handl Created
18 -- 2006-02-24 2.0 ST revised
19 -------------------------------------------------------------------------------
21 -------------------------------------------------------------------------------
23 -------------------------------------------------------------------------------
26 use IEEE.std_logic_1164.all;
27 use IEEE.std_logic_unsigned.all;
28 use IEEE.std_logic_arith.all;
32 -------------------------------------------------------------------------------
34 -------------------------------------------------------------------------------
36 architecture behav of vga_control is
39 attribute syn_preserve : boolean;
40 attribute syn_preserve of behav : architecture is true;
41 signal r_next, g_next, b_next : std_logic;
44 DRAW_SQUARE_syn: process(clk, reset)
46 if (reset = RES_ACT) then -- draw black screen upon reset
50 elsif (clk'event and clk = '1') then -- synchronous capture
58 DRAW_SQUARE_next: process (column_counter, v_enable, h_enable)
60 if v_enable = ENABLE and h_enable = ENABLE then
61 if (column_counter >= X_MIN and column_counter < X2_MIN) then -- if pixel within the rectangle borders
65 elsif (column_counter >= X2_MIN and column_counter < X3_MIN) then -- if pixel within the rectangle borders
69 elsif (column_counter >= X3_MIN and column_counter < X_MAX) then -- if pixel within the rectangle borders
73 else -- if somewhere else on screen...
75 g_next <= COLR_OFF; -- ... draw background color
78 else -- if out of screen...
80 g_next <= COLR_OFF; -- ... do not activate any color
81 b_next <= COLR_OFF; -- (black screen)
87 -------------------------------------------------------------------------------
89 -------------------------------------------------------------------------------