summaryrefslogtreecommitdiffstats
path: root/fpga/hp_lcd_driver/tmds_output_artix7.vhdl
blob: 7370bb77a5ac0cef8648f6fd11374564e3218302 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
library ieee;
use ieee.std_logic_1164.all;
use IEEE.NUMERIC_STD.all;

library UNISIM;
use UNISIM.vcomponents.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 phy_reset : std_logic;
    signal b         : natural := 0;


begin
    phy_reset <= not sys_rst_n;         -- or not pll_locked;

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


    phy_c : entity work.tmds_phy_artix7
        port map (
            reset      => phy_reset,
            pix_clk    => pclk,
            phy_clk    => 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_artix7
        port map (
            reset      => phy_reset,
            pix_clk    => pclk,
            phy_clk    => 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_artix7
        port map (
            reset      => phy_reset,
            pix_clk    => pclk,
            phy_clk    => 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_artix7
        port map (
            reset      => phy_reset,
            pix_clk    => pclk,
            phy_clk    => pclk_phy,
            b          =>b,
            din        => b_p10,
            tmds_out_p => tmds_b_out_p,
            tmds_out_n => tmds_b_out_n
            );


--        tmds_c_out_p <= '0';
--        tmds_c_out_n <= '0';
--        tmds_r_out_p <= '0';
--        tmds_r_out_n <= '0';
--        tmds_g_out_p <= '0';
--        tmds_g_out_n <= '0';
--        tmds_b_out_p <= '0';
--        tmds_b_out_n <= '0';
--     

end beh;