spriteflyer_pkg.vhd 3.08 KB
Newer Older
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
library ieee;
    use ieee.std_logic_1164.all;
    use ieee.numeric_std.all;

package spriteflyer_pkg is

    constant C_HFP            : natural := 16;
    constant C_HSYNC          : natural := 96;
    constant C_HVISIBLE       : natural := 640;
    constant C_HBP            : natural := 48;
    constant C_HVISIBLE_START : natural := C_HBP+C_HSYNC;
    constant C_VFP            : natural := 10;
    constant C_VSYNC          : natural := 2;
    constant C_VVISIBLE       : natural := 480;
    constant C_VBP            : natural := 33;
    constant C_VVISIBLE_START : natural := C_VBP+C_VSYNC;

    component spriteflyer_voter is
        generic (
            G_WIDTH : natural
        );
        port (
            s_en_i   : in std_logic;
            s_data_i : in std_logic_vector(3*G_WIDTH-1 downto 0);
            s_data_o : out std_logic_vector(G_WIDTH-1 downto 0);
            s_err_o  : out std_logic
        );
    end component spriteflyer_voter;

    component spriteflyer_input_sync_debounce is
        generic (
            G_CLK_FREQUENCY : natural
        );
        port (
            s_clk_i       : in  std_logic;
            s_reset_n_i   : in  std_logic;
            s_data_i      : in  std_logic;
            s_data_sync_o : out std_logic;
            s_data_deb_o  : out std_logic
        );
    end component spriteflyer_input_sync_debounce;

    component spriteflyer_vga is
        generic (
            G_HSYNC_ACT   : std_logic;
            G_VSYNC_ACT   : std_logic
        );
        port (
            s_clk_i         : in std_logic;
            s_reset_n_i        : in std_logic;
            s_ce25_i           : in std_logic;
            s_line_count_o     : out unsigned (9 downto 0);
            s_column_count_o   : out unsigned (9 downto 0);
            s_blank_o          : out std_logic;
            s_image_finished_o : out std_logic;
            s_hsync_o          : out std_logic;
            s_vsync_o          : out std_logic
        );
    end component spriteflyer_vga;

    component spriteflyer_sprite
         generic (
              G_RED_WIDTH   : natural;
              G_GREEN_WIDTH : natural;
              G_BLUE_WIDTH  : natural
          );
        port (
            s_clk_i   : in std_logic;
            s_reset_n_i  : in std_logic;
            s_ce25_i            : in std_logic;
            s_column_count_i    : in unsigned(9 downto 0);
            s_line_count_i      : in unsigned(9 downto 0);
            s_blank_i           : in std_logic;
            s_image_finished_i  : in std_logic;
            s_red_o      : out std_logic_vector(G_RED_WIDTH-1 downto 0);
            s_green_o    : out std_logic_vector(G_GREEN_WIDTH-1 downto 0);
            s_blue_o     : out std_logic_vector(G_BLUE_WIDTH-1 downto 0)
        );
    end component spriteflyer_sprite;

    component spriteflyer_clkgen is
        port (
            s_clk_i     : in std_logic;
            s_reset_x_i : in std_logic;
            s_clk_o  : out std_logic;
            s_ce25_o    : out std_logic;
            s_reset_n_o : out std_logic
        );
    end component spriteflyer_clkgen;

end package spriteflyer_pkg;