summaryrefslogtreecommitdiffstats
path: root/fpga/hp_lcd_driver/tmds_output_cyclone4.vhdl
blob: 8d71bd8360fcbeab6d67ce05385547314436a8da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
library ieee;
use ieee.std_logic_1164.all;
use IEEE.NUMERIC_STD.all;

entity tmds_output is
    port (
        sys_rst_n   : in std_logic;
        pclk_locked : in std_logic;
        pclk        : in std_logic;
        pclk_x2     : in std_logic;
        pclk_phy    : in std_logic;

        r_p10 : in std_logic_vector(9 downto 0);
        g_p10 : in std_logic_vector(9 downto 0);
        b_p10 : in std_logic_vector(9 downto 0);
        c_p10 : in std_logic_vector(9 downto 0);


        tmds_c_out_p : out std_logic;
        tmds_c_out_n : out std_logic;
        tmds_r_out_p : out std_logic;
        tmds_r_out_n : out std_logic;
        tmds_g_out_p : out std_logic;
        tmds_g_out_n : out std_logic;
        tmds_b_out_p : out std_logic;
        tmds_b_out_n : out std_logic
        );
end tmds_output;


architecture beh of tmds_output is

    signal b : natural := 0;

begin



    process (pclk_phy, b, sys_rst_n)
    begin
        if sys_rst_n = '0' then
            b <= 0;
        elsif rising_edge(pclk_phy) then
            if b = 4 then
                b <= 0;
            else
                b <= b+1;
            end if;
        end if;
    end process;


    phy_c : entity work.tmds_phy_cyclone4
        port map (
            sys_rst_n  => sys_rst_n,
            pclk_phy   => pclk_phy,
            b          => b,
            din        => c_p10,
            tmds_out_p => tmds_c_out_p,
            tmds_out_n => tmds_c_out_n
            );

    phy_r : entity work.tmds_phy_cyclone4
        port map (
            sys_rst_n  => sys_rst_n,
            pclk_phy   => pclk_phy,
            b          => b,
            din        => r_p10,
            tmds_out_p => tmds_r_out_p,
            tmds_out_n => tmds_r_out_n
            );


    phy_g : entity work.tmds_phy_cyclone4
        port map (
            sys_rst_n  => sys_rst_n,
            pclk_phy   => pclk_phy,
            b          => b,
            din        => g_p10,
            tmds_out_p => tmds_g_out_p,
            tmds_out_n => tmds_g_out_n
            );


    phy_b : entity work.tmds_phy_cyclone4
        port map (
            sys_rst_n  => sys_rst_n,
            pclk_phy   => pclk_phy,
            b          => b,
            din        => b_p10,
            tmds_out_p => tmds_b_out_p,
            tmds_out_n => tmds_b_out_n
            );

end beh;