1 |
14 |
gedra |
----------------------------------------------------------------------
|
2 |
|
|
---- ----
|
3 |
|
|
---- WISHBONE SPDIF IP Core ----
|
4 |
|
|
---- ----
|
5 |
|
|
---- This file is part of the SPDIF project ----
|
6 |
|
|
---- http://www.opencores.org/cores/spdif_interface/ ----
|
7 |
|
|
---- ----
|
8 |
|
|
---- Description ----
|
9 |
|
|
---- SPDIF receiver component package. ----
|
10 |
|
|
---- ----
|
11 |
|
|
---- ----
|
12 |
|
|
---- To Do: ----
|
13 |
|
|
---- - ----
|
14 |
|
|
---- ----
|
15 |
|
|
---- Author(s): ----
|
16 |
|
|
---- - Geir Drange, gedra@opencores.org ----
|
17 |
|
|
---- ----
|
18 |
|
|
----------------------------------------------------------------------
|
19 |
|
|
---- ----
|
20 |
|
|
---- Copyright (C) 2004 Authors and OPENCORES.ORG ----
|
21 |
|
|
---- ----
|
22 |
|
|
---- This source file may be used and distributed without ----
|
23 |
|
|
---- restriction provided that this copyright statement is not ----
|
24 |
|
|
---- removed from the file and that any derivative work contains ----
|
25 |
|
|
---- the original copyright notice and the associated disclaimer. ----
|
26 |
|
|
---- ----
|
27 |
|
|
---- This source file is free software; you can redistribute it ----
|
28 |
|
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
29 |
|
|
---- Public License as published by the Free Software Foundation; ----
|
30 |
|
|
---- either version 2.1 of the License, or (at your option) any ----
|
31 |
|
|
---- later version. ----
|
32 |
|
|
---- ----
|
33 |
|
|
---- This source is distributed in the hope that it will be ----
|
34 |
|
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
35 |
|
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
36 |
|
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
37 |
|
|
---- details. ----
|
38 |
|
|
---- ----
|
39 |
|
|
---- You should have received a copy of the GNU Lesser General ----
|
40 |
|
|
---- Public License along with this source; if not, download it ----
|
41 |
|
|
---- from http://www.opencores.org/lgpl.shtml ----
|
42 |
|
|
---- ----
|
43 |
|
|
----------------------------------------------------------------------
|
44 |
|
|
--
|
45 |
|
|
-- CVS Revision History
|
46 |
|
|
--
|
47 |
|
|
-- $Log: not supported by cvs2svn $
|
48 |
17 |
gedra |
-- Revision 1.2 2004/06/09 19:24:50 gedra
|
49 |
|
|
-- Added dual port ram.
|
50 |
|
|
--
|
51 |
16 |
gedra |
-- Revision 1.1 2004/06/07 18:06:00 gedra
|
52 |
|
|
-- Receiver component declarations.
|
53 |
14 |
gedra |
--
|
54 |
16 |
gedra |
--
|
55 |
14 |
gedra |
|
56 |
|
|
library IEEE;
|
57 |
|
|
use IEEE.std_logic_1164.all;
|
58 |
|
|
|
59 |
|
|
package rx_package is
|
60 |
|
|
|
61 |
|
|
-- type declarations
|
62 |
|
|
type bus_array is array (0 to 7) of std_logic_vector(31 downto 0);
|
63 |
|
|
|
64 |
|
|
-- components
|
65 |
|
|
component rx_ver_reg
|
66 |
|
|
generic (DATA_WIDTH: integer;
|
67 |
|
|
ADDR_WIDTH: integer;
|
68 |
|
|
CH_ST_CAPTURE: integer);
|
69 |
|
|
port (
|
70 |
|
|
ver_rd: in std_logic; -- version register read
|
71 |
|
|
ver_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0)); -- read data
|
72 |
|
|
end component;
|
73 |
|
|
|
74 |
|
|
component gen_control_reg
|
75 |
|
|
generic (DATA_WIDTH: integer;
|
76 |
|
|
-- note that this vector is (0 to xx), reverse order
|
77 |
|
|
ACTIVE_BIT_MASK: std_logic_vector);
|
78 |
|
|
port (
|
79 |
|
|
clk: in std_logic; -- clock
|
80 |
|
|
rst: in std_logic; -- reset
|
81 |
|
|
ctrl_wr: in std_logic; -- control register write
|
82 |
|
|
ctrl_rd: in std_logic; -- control register read
|
83 |
|
|
ctrl_din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
|
84 |
|
|
ctrl_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0);
|
85 |
|
|
ctrl_bits: out std_logic_vector(DATA_WIDTH - 1 downto 0));
|
86 |
|
|
end component;
|
87 |
|
|
|
88 |
|
|
component rx_status_reg
|
89 |
|
|
generic (DATA_WIDTH: integer);
|
90 |
|
|
port (
|
91 |
|
|
status_rd: in std_logic; -- status register read
|
92 |
|
|
status_vector: in std_logic_vector(DATA_WIDTH - 1 downto 0);
|
93 |
|
|
status_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
|
94 |
|
|
end component;
|
95 |
|
|
|
96 |
|
|
component gen_event_reg
|
97 |
|
|
generic (DATA_WIDTH: integer);
|
98 |
|
|
port (
|
99 |
|
|
clk: in std_logic; -- clock
|
100 |
|
|
rst: in std_logic; -- reset
|
101 |
|
|
evt_wr: in std_logic; -- event register write
|
102 |
|
|
evt_rd: in std_logic; -- event register read
|
103 |
|
|
evt_din: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- write data
|
104 |
|
|
event: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- event vector
|
105 |
|
|
evt_mask: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- irq mask
|
106 |
|
|
evt_en: in std_logic; -- irq enable
|
107 |
|
|
evt_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0); -- read data
|
108 |
|
|
evt_irq: out std_logic); -- interrupt request
|
109 |
|
|
end component;
|
110 |
|
|
|
111 |
|
|
component rx_cap_reg
|
112 |
|
|
port (
|
113 |
|
|
clk: in std_logic; -- clock
|
114 |
|
|
rst: in std_logic; -- reset
|
115 |
|
|
cap_ctrl_wr: in std_logic; -- control register write
|
116 |
|
|
cap_ctrl_rd: in std_logic; -- control register read
|
117 |
|
|
cap_data_rd: in std_logic; -- data register read
|
118 |
|
|
cap_din: in std_logic_vector(31 downto 0); -- write data
|
119 |
|
|
frame_rst: in std_logic; -- start of frame signal
|
120 |
|
|
ch_data: in std_logic; -- channel status/user data
|
121 |
|
|
ud_a_en: in std_logic; -- user data ch. A enable
|
122 |
|
|
ud_b_en: in std_logic; -- user data ch. B enable
|
123 |
|
|
cs_a_en: in std_logic; -- channel status ch. A enable
|
124 |
|
|
cs_b_en: in std_logic; -- channel status ch. B enable
|
125 |
|
|
cap_dout: out std_logic_vector(31 downto 0); -- read data
|
126 |
|
|
cap_evt: out std_logic); -- capture event (interrupt)
|
127 |
|
|
end component;
|
128 |
|
|
|
129 |
|
|
component rx_phase_det
|
130 |
|
|
generic (WISH_BONE_FREQ: natural := 33); -- WishBone frequency in MHz
|
131 |
|
|
port (
|
132 |
|
|
wb_clk_i: in std_logic;
|
133 |
|
|
rxen: in std_logic;
|
134 |
|
|
spdif: in std_logic;
|
135 |
|
|
lock: out std_logic;
|
136 |
|
|
rx_data: out std_logic;
|
137 |
|
|
rx_data_en: out std_logic;
|
138 |
|
|
rx_block_start: out std_logic;
|
139 |
|
|
rx_frame_start: out std_logic;
|
140 |
|
|
rx_channel_a: out std_logic;
|
141 |
|
|
rx_error: out std_logic;
|
142 |
|
|
ud_a_en: out std_logic; -- user data ch. A enable
|
143 |
|
|
ud_b_en: out std_logic; -- user data ch. B enable
|
144 |
|
|
cs_a_en: out std_logic; -- channel status ch. A enable
|
145 |
|
|
cs_b_en: out std_logic); -- channel status ch. B enable);
|
146 |
|
|
end component;
|
147 |
16 |
gedra |
|
148 |
|
|
component dpram
|
149 |
|
|
generic (DATA_WIDTH: positive;
|
150 |
17 |
gedra |
RAM_WIDTH: positive);
|
151 |
16 |
gedra |
port (
|
152 |
|
|
clk: in std_logic;
|
153 |
|
|
rst: in std_logic; -- reset is optional, not used here
|
154 |
|
|
din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
|
155 |
|
|
wr_en: in std_logic;
|
156 |
|
|
rd_en: in std_logic;
|
157 |
17 |
gedra |
wr_addr: in std_logic_vector(RAM_WIDTH - 1 downto 0);
|
158 |
|
|
rd_addr: in std_logic_vector(RAM_WIDTH - 1 downto 0);
|
159 |
16 |
gedra |
dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
|
160 |
|
|
end component;
|
161 |
14 |
gedra |
|
162 |
|
|
end rx_package;
|