OpenCores
URL https://opencores.org/ocsvn/wb_vga/wb_vga/trunk

Subversion Repositories wb_vga

[/] [wb_vga/] [trunk/] [sync_gen.vhd] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tantos
--
2
--  Programmable sync generator.
3
--
4
--  (c) Copyright Andras Tantos <andras_tantos@yahoo.com> 2001/03/31
5
--  This code is distributed under the terms and conditions of the GNU General Public Lince.
6
--
7
 
8
-- Standard library.
9
library IEEE;
10
use IEEE.std_logic_1164.all;
11
use IEEE.numeric_std.all;
12
 
13 4 tantos
library wb_tk;
14
use wb_tk.technology.all;
15 2 tantos
 
16
entity sync_gen is
17
        port (
18
                clk: in std_logic;
19
                clk_en: in std_logic;
20
                reset: in std_logic := '0';
21
 
22
                bs: in std_logic_vector(7 downto 0);
23
                ss: in std_logic_vector(7 downto 0);
24
                se: in std_logic_vector(7 downto 0);
25
                total: in std_logic_vector(7 downto 0);
26
 
27
                sync: out std_logic;
28
                blank: out std_logic;
29
                tc: out std_logic;
30
 
31
                count: out std_logic_vector (7 downto 0)
32
        );
33
end sync_gen;
34
 
35
architecture sync_gen of sync_gen is
36
begin
37
        -- And the sequential machine generating the output signals.
38
        generator: process is
39
                variable state: std_logic_vector(7 downto 0);
40
        begin
41
                wait until clk'event and clk='1';
42
                if (reset = '1') then
43
                        tc <= '0';
44
                        state := (others => '0');
45
                        sync <= '0';
46
                        tc <= '0';
47
                        blank <= '1';
48
                else
49
                        if  (clk_en='1') then
50
                                if (state = bs) then
51
                                        sync <= '0';
52
                                        blank <= '1';
53
                                        tc <= '0';
54
                                        state := add_one(state);
55
                                elsif (state = ss) then
56
                                        sync <= '1';
57
                                        blank <= '1';
58
                                        tc <= '1';
59
                                        state := add_one(state);
60
                                elsif (state = se) then
61
                                        sync <= '0';
62
                                        blank <= '1';
63
                                        tc <= '0';
64
                                        state := add_one(state);
65
                                elsif (state = total) then
66
                                        sync <= '0';
67
                                        blank <= '0';
68
                                        tc <= '0';
69
                                        state := (others => '0');
70
                                else
71
                                        tc <= '0';
72
                                        state := add_one(state);
73
                                end if;
74
                                count <= state;
75
                        else
76
                                tc <= '0';
77
                        end if;
78
                end if;
79
        end process;
80
end sync_gen;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.