-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathtop.vhd
More file actions
107 lines (75 loc) · 1.94 KB
/
top.vhd
File metadata and controls
107 lines (75 loc) · 1.94 KB
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
----------------------------------------------------------------------------------
-- Engineer: github.com/YetAnotherElectronicsChannel
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;
entity main is
port (
clk_16mhz : in std_logic;
i2s_mclk_adc : out std_logic;
i2s_bclk_adc : out std_logic;
i2s_lr_adc : out std_logic;
i2s_din : in std_logic;
pwm_p_l : out std_logic;
pwm_n_l : out std_logic;
limit : out std_logic;
gain : in unsigned(1 downto 0);
ns_mux : in std_logic
);
end main;
architecture Behavioral of main is
signal clk : std_logic;
signal pllsreset: std_logic := '0';
component main_pll is
port(
REFERENCECLK: in std_logic;
RESET: in std_logic;
PLLOUTCORE: out std_logic;
PLLOUTGLOBAL: out std_logic;
LOCK: out std_logic
);
end component;
component audiosystem is
port(
clk : in std_logic;
i2s_mclk : out std_logic;
i2s_bclk : out std_logic;
i2s_lr : out std_logic;
i2s_din : in std_logic;
pwm_p_l : out std_logic;
pwm_n_l : out std_logic;
limit : out std_logic;
gain : in unsigned(1 downto 0);
ns_mux : in std_logic
);
end component;
begin
process (clk_16mhz)
begin
if (rising_edge(clk_16mhz)) then
pllsreset <= '1';
end if;
end process;
pll: main_pll
port map(
REFERENCECLK => clk_16mhz,
RESET => pllsreset,
PLLOUTCORE => open,
PLLOUTGLOBAL => clk,
LOCK=> open
);
audiomodule : audiosystem
port map (
clk => clk,
i2s_mclk => i2s_mclk_adc,
i2s_bclk => i2s_bclk_adc,
i2s_lr => i2s_lr_adc,
i2s_din => i2s_din,
pwm_p_l => pwm_p_l,
pwm_n_l => pwm_n_l,
limit => limit,
gain => gain,
ns_mux => ns_mux
);
end Behavioral;