-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathxupv5_audio_out_top.vhd
157 lines (134 loc) · 3.79 KB
/
xupv5_audio_out_top.vhd
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 13:23:55 08/02/2014
-- Design Name:
-- Module Name: xupv5_audio_out_top - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity xupv5_audio_out_top is port (
CLK_33MHZ: in std_logic;
CPU_RESET_B: in std_logic;
LED_GPIO: out std_logic_vector(7 downto 0);
GPIO_DIP_SW: in std_logic_vector(7 downto 0);
AUDIO_BIT_CLK: in std_logic;
AUDIO_SDATA_IN: in std_logic;
AUDIO_SDATA_OUT: out std_logic;
AUDIO_SYNC: out std_logic;
AUDIO_RESET: out std_logic
); end xupv5_audio_out_top;
architecture Behavioral of xupv5_audio_out_top is
component clksynth port (
CLKIN1_IN : in std_logic; -- 33 MHz
RST_IN : in std_logic;
CLKOUT0_OUT : out std_logic; -- ~ 7.968 MHz
LOCKED_OUT : out std_logic
); end component;
component audio_output_top Port (
clk : in STD_LOGIC; -- about 8 MHz (7.968MHz should be okay)
rst : in STD_LOGIC;
mute_fm: in std_logic_vector(5 downto 0);
-- AC97
audio_bit_clk: in std_logic;
audio_sdata_in: in std_logic;
audio_sdata_out: out std_logic;
audio_sync: out std_logic;
audio_reset: out std_logic
); end component;
signal clk: std_logic;
signal rst: std_logic;
signal rst_async: std_logic;
signal locked: std_logic;
component chipscope_icon is port (
control0: inout std_logic_vector(35 downto 0)
); end component;
signal control0: std_logic_vector(35 downto 0);
component chipscope_ila is port (
control: inout std_logic_vector(35 downto 0);
clk: in std_logic;
trig0: in std_logic_vector(4 downto 0)
); end component;
signal mute_fm: std_logic_vector(5 downto 0);
signal ac97_reset: std_logic;
signal ac97_bit_clk: std_logic;
signal ac97_sdata_in: std_logic;
signal ac97_sdata_out: std_logic;
signal ac97_sync: std_logic;
begin
rst_async <= not CPU_RESET_B;
LED_GPIO(0) <= '0';
LED_GPIO(1) <= '0';
LED_GPIO(2) <= '0';
LED_GPIO(3) <= '0';
LED_GPIO(4) <= '0';
LED_GPIO(5) <= '0';
LED_GPIO(6) <= '0';
LED_GPIO(7) <= locked;
SYNC_GPIO: process(clk, GPIO_DIP_SW)
begin
if(rising_edge(clk)) then
mute_fm(0) <= GPIO_DIP_SW(0);
mute_fm(1) <= GPIO_DIP_SW(1);
mute_fm(2) <= GPIO_DIP_SW(2);
mute_fm(3) <= GPIO_DIP_SW(3);
mute_fm(4) <= GPIO_DIP_SW(4);
mute_fm(5) <= GPIO_DIP_SW(5);
end if;
end process SYNC_GPIO;
PLL: clksynth port map (
CLKIN1_IN => CLK_33MHZ,
RST_IN => rst_async,
CLKOUT0_OUT => clk,
LOCKED_OUT => locked
);
SYNC_RST: process(clk, CPU_RESET_B)
begin
if(rising_edge(clk)) then
rst <= not CPU_RESET_B;
end if;
end process SYNC_RST;
AUDIO_OUT: audio_output_top port map (
clk => clk,
rst => rst,
mute_fm => mute_fm,
audio_bit_clk => ac97_bit_clk,
audio_sdata_in => ac97_sdata_in,
audio_sdata_out => ac97_sdata_out,
audio_sync => ac97_sync,
audio_reset => ac97_reset
);
AUDIO_RESET <= ac97_reset;
ac97_bit_clk <= AUDIO_BIT_CLK;
AUDIO_SYNC <= ac97_sync;
ac97_sdata_in <= AUDIO_SDATA_IN ;
AUDIO_SDATA_OUT <= ac97_sdata_out;
--ICON: chipscope_icon port map ( control0 => control0 );
--ILA: chipscope_ila port map (control => control0,
-- clk => ac97_bit_clk,
-- trig0(0) => ac97_reset,
-- trig0(1) => ac97_sync,
-- trig0(2) => ac97_sdata_in,
-- trig0(3) => ac97_sdata_out,
-- trig0(4) => '0'
--);
end Behavioral;