OpenCores
URL https://opencores.org/ocsvn/spdif_interface/spdif_interface/trunk

Subversion Repositories spdif_interface

[/] [spdif_interface/] [trunk/] [rtl/] [vhdl/] [rx_package.vhd] - Blame information for rev 25

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
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 25 gedra
-- Revision 1.4  2004/06/13 18:08:09  gedra
49
-- Added frame decoder and sample extractor
50
--
51 19 gedra
-- Revision 1.3  2004/06/10 18:57:36  gedra
52
-- Cleaned up lint warnings.
53
--
54 17 gedra
-- Revision 1.2  2004/06/09 19:24:50  gedra
55
-- Added dual port ram.
56
--
57 16 gedra
-- Revision 1.1  2004/06/07 18:06:00  gedra
58
-- Receiver component declarations.
59 14 gedra
--
60 16 gedra
--
61 14 gedra
 
62
library IEEE;
63
use IEEE.std_logic_1164.all;
64
 
65
package rx_package is
66
 
67
-- type declarations
68
  type bus_array is array (0 to 7) of std_logic_vector(31 downto 0);
69
 
70
-- components
71
  component rx_ver_reg
72
    generic (DATA_WIDTH: integer;
73
             ADDR_WIDTH: integer;
74
             CH_ST_CAPTURE: integer);
75
    port (
76
      ver_rd: in std_logic; -- version register read
77
      ver_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0)); -- read data
78
  end component;
79
 
80
  component gen_control_reg
81
    generic (DATA_WIDTH: integer;
82
             -- note that this vector is (0 to xx), reverse order
83
             ACTIVE_BIT_MASK: std_logic_vector);
84
    port (
85
      clk: in std_logic;         -- clock  
86
      rst: in std_logic; -- reset
87
      ctrl_wr: in std_logic; -- control register write  
88
      ctrl_rd: in std_logic; -- control register read
89
      ctrl_din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
90
      ctrl_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0);
91
      ctrl_bits: out std_logic_vector(DATA_WIDTH - 1 downto 0));
92
  end component;
93
 
94
  component rx_status_reg
95
    generic (DATA_WIDTH: integer);
96
    port (
97 25 gedra
      wb_clk_i: in std_logic;             -- clock
98 14 gedra
      status_rd: in std_logic;            -- status register read
99 25 gedra
      lock: in std_logic;                 -- signal lock status
100
      chas: in std_logic;                 -- channel A or B select
101
      rx_frame_start: in std_logic;       -- start of frame signal
102
      ch_data: in std_logic;              -- channel status/user data
103
      cs_a_en: in std_logic;              -- channel status ch. A enable
104
      cs_b_en: in std_logic;              -- channel status ch. B enable
105
      status_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
106 14 gedra
  end component;
107
 
108
  component gen_event_reg
109
    generic (DATA_WIDTH: integer);
110
    port (
111
      clk: in std_logic;         -- clock  
112
      rst: in std_logic; -- reset
113
      evt_wr: in std_logic; -- event register write     
114
      evt_rd: in std_logic; -- event register read
115
      evt_din: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- write data
116
      event: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- event vector
117
      evt_mask: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- irq mask
118
      evt_en: in std_logic;               -- irq enable
119
      evt_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0); -- read data
120
      evt_irq: out std_logic); -- interrupt  request
121
  end component;
122
 
123
  component rx_cap_reg
124
    port (
125
      clk: in std_logic;                  -- clock
126
      rst: in std_logic; -- reset
127
      cap_ctrl_wr: in std_logic; -- control register write      
128
      cap_ctrl_rd: in std_logic; -- control register read
129
      cap_data_rd: in std_logic;          -- data register read
130
      cap_din: in std_logic_vector(31 downto 0); -- write data
131
      frame_rst: in std_logic; -- start of frame signal
132
      ch_data: in std_logic;  -- channel status/user data
133
      ud_a_en: in std_logic;            -- user data ch. A enable
134
      ud_b_en: in std_logic;              -- user data ch. B enable
135
      cs_a_en: in std_logic;              -- channel status ch. A enable
136
      cs_b_en: in std_logic;              -- channel status ch. B enable
137
      cap_dout: out std_logic_vector(31 downto 0); -- read data
138
      cap_evt: out std_logic);             -- capture event (interrupt)
139
  end component;
140
 
141
  component rx_phase_det
142 19 gedra
    generic (WISHBONE_FREQ: natural := 33);   -- WishBone frequency in MHz
143 14 gedra
    port (
144
      wb_clk_i: in std_logic;
145
      rxen: in std_logic;
146
      spdif: in std_logic;
147
      lock: out std_logic;
148
      rx_data: out std_logic;
149
      rx_data_en: out std_logic;
150
      rx_block_start: out std_logic;
151
      rx_frame_start: out std_logic;
152
      rx_channel_a: out std_logic;
153
      rx_error: out std_logic;
154
      ud_a_en: out std_logic;              -- user data ch. A enable
155
      ud_b_en: out std_logic;              -- user data ch. B enable
156
      cs_a_en: out std_logic;              -- channel status ch. A enable
157
      cs_b_en: out std_logic);             -- channel status ch. B enable);            
158
  end component;
159 16 gedra
 
160
  component dpram
161
    generic (DATA_WIDTH: positive;
162 17 gedra
             RAM_WIDTH: positive);
163 16 gedra
    port (
164
      clk: in std_logic;
165
      rst: in std_logic; -- reset is optional, not used here
166
      din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
167
      wr_en: in std_logic;
168
      rd_en: in std_logic;
169 17 gedra
      wr_addr: in std_logic_vector(RAM_WIDTH - 1 downto 0);
170
      rd_addr: in std_logic_vector(RAM_WIDTH - 1 downto 0);
171 16 gedra
      dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
172 19 gedra
  end component;
173
 
174
  component rx_decode
175
    generic (DATA_WIDTH: integer range 16 to 32;
176
             ADDR_WIDTH: integer range 8 to 64);
177
    port (
178
      wb_clk_i: in std_logic;
179
      conf_rxen: in std_logic;
180
      conf_sample: in std_logic;
181
      conf_valid: in std_logic;
182
      conf_mode: in std_logic_vector(3 downto 0);
183
      conf_blken: in std_logic;
184
      conf_valen: in std_logic;
185
      conf_useren: in std_logic;
186
      conf_staten: in std_logic;
187
      conf_paren: in std_logic;
188
      lock: in std_logic;
189
      rx_data: in std_logic;
190
      rx_data_en: in std_logic;
191
      rx_block_start: in std_logic;
192
      rx_frame_start: in std_logic;
193
      rx_channel_a: in std_logic;
194
      wr_en: out std_logic;
195
      wr_addr: out std_logic_vector(ADDR_WIDTH - 2 downto 0);
196
      wr_data: out std_logic_vector(DATA_WIDTH downto 0);
197
      stat_paritya: out std_logic;
198
      stat_parityb: out std_logic;
199
      stat_lsbf: out std_logic;
200
      stat_hsbf: out std_logic);
201
  end component;
202 14 gedra
 
203
end rx_package;

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.