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 |
|
|
--
|
49 |
|
|
|
50 |
|
|
library IEEE;
|
51 |
|
|
use IEEE.std_logic_1164.all;
|
52 |
|
|
|
53 |
|
|
package rx_package is
|
54 |
|
|
|
55 |
|
|
-- type declarations
|
56 |
|
|
type bus_array is array (0 to 7) of std_logic_vector(31 downto 0);
|
57 |
|
|
|
58 |
|
|
-- components
|
59 |
|
|
component rx_ver_reg
|
60 |
|
|
generic (DATA_WIDTH: integer;
|
61 |
|
|
ADDR_WIDTH: integer;
|
62 |
|
|
CH_ST_CAPTURE: integer);
|
63 |
|
|
port (
|
64 |
|
|
ver_rd: in std_logic; -- version register read
|
65 |
|
|
ver_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0)); -- read data
|
66 |
|
|
end component;
|
67 |
|
|
|
68 |
|
|
component gen_control_reg
|
69 |
|
|
generic (DATA_WIDTH: integer;
|
70 |
|
|
-- note that this vector is (0 to xx), reverse order
|
71 |
|
|
ACTIVE_BIT_MASK: std_logic_vector);
|
72 |
|
|
port (
|
73 |
|
|
clk: in std_logic; -- clock
|
74 |
|
|
rst: in std_logic; -- reset
|
75 |
|
|
ctrl_wr: in std_logic; -- control register write
|
76 |
|
|
ctrl_rd: in std_logic; -- control register read
|
77 |
|
|
ctrl_din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
|
78 |
|
|
ctrl_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0);
|
79 |
|
|
ctrl_bits: out std_logic_vector(DATA_WIDTH - 1 downto 0));
|
80 |
|
|
end component;
|
81 |
|
|
|
82 |
|
|
component rx_status_reg
|
83 |
|
|
generic (DATA_WIDTH: integer);
|
84 |
|
|
port (
|
85 |
|
|
status_rd: in std_logic; -- status register read
|
86 |
|
|
status_vector: in std_logic_vector(DATA_WIDTH - 1 downto 0);
|
87 |
|
|
status_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
|
88 |
|
|
end component;
|
89 |
|
|
|
90 |
|
|
component gen_event_reg
|
91 |
|
|
generic (DATA_WIDTH: integer);
|
92 |
|
|
port (
|
93 |
|
|
clk: in std_logic; -- clock
|
94 |
|
|
rst: in std_logic; -- reset
|
95 |
|
|
evt_wr: in std_logic; -- event register write
|
96 |
|
|
evt_rd: in std_logic; -- event register read
|
97 |
|
|
evt_din: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- write data
|
98 |
|
|
event: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- event vector
|
99 |
|
|
evt_mask: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- irq mask
|
100 |
|
|
evt_en: in std_logic; -- irq enable
|
101 |
|
|
evt_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0); -- read data
|
102 |
|
|
evt_irq: out std_logic); -- interrupt request
|
103 |
|
|
end component;
|
104 |
|
|
|
105 |
|
|
component rx_cap_reg
|
106 |
|
|
port (
|
107 |
|
|
clk: in std_logic; -- clock
|
108 |
|
|
rst: in std_logic; -- reset
|
109 |
|
|
cap_ctrl_wr: in std_logic; -- control register write
|
110 |
|
|
cap_ctrl_rd: in std_logic; -- control register read
|
111 |
|
|
cap_data_rd: in std_logic; -- data register read
|
112 |
|
|
cap_din: in std_logic_vector(31 downto 0); -- write data
|
113 |
|
|
frame_rst: in std_logic; -- start of frame signal
|
114 |
|
|
ch_data: in std_logic; -- channel status/user data
|
115 |
|
|
ud_a_en: in std_logic; -- user data ch. A enable
|
116 |
|
|
ud_b_en: in std_logic; -- user data ch. B enable
|
117 |
|
|
cs_a_en: in std_logic; -- channel status ch. A enable
|
118 |
|
|
cs_b_en: in std_logic; -- channel status ch. B enable
|
119 |
|
|
cap_dout: out std_logic_vector(31 downto 0); -- read data
|
120 |
|
|
cap_evt: out std_logic); -- capture event (interrupt)
|
121 |
|
|
end component;
|
122 |
|
|
|
123 |
|
|
component rx_phase_det
|
124 |
|
|
generic (WISH_BONE_FREQ: natural := 33); -- WishBone frequency in MHz
|
125 |
|
|
port (
|
126 |
|
|
wb_clk_i: in std_logic;
|
127 |
|
|
rxen: in std_logic;
|
128 |
|
|
spdif: in std_logic;
|
129 |
|
|
lock: out std_logic;
|
130 |
|
|
rx_data: out std_logic;
|
131 |
|
|
rx_data_en: out std_logic;
|
132 |
|
|
rx_block_start: out std_logic;
|
133 |
|
|
rx_frame_start: out std_logic;
|
134 |
|
|
rx_channel_a: out std_logic;
|
135 |
|
|
rx_error: out std_logic;
|
136 |
|
|
ud_a_en: out std_logic; -- user data ch. A enable
|
137 |
|
|
ud_b_en: out std_logic; -- user data ch. B enable
|
138 |
|
|
cs_a_en: out std_logic; -- channel status ch. A enable
|
139 |
|
|
cs_b_en: out std_logic); -- channel status ch. B enable);
|
140 |
|
|
end component;
|
141 |
|
|
|
142 |
|
|
end rx_package;
|