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 37

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 37 gedra
-- Revision 1.6  2004/06/23 18:10:17  gedra
49
-- Added Wishbone bus cycle decoder.
50
--
51 30 gedra
-- Revision 1.5  2004/06/16 19:03:45  gedra
52
-- Changed status reg. declaration
53
--
54 25 gedra
-- Revision 1.4  2004/06/13 18:08:09  gedra
55
-- Added frame decoder and sample extractor
56
--
57 19 gedra
-- Revision 1.3  2004/06/10 18:57:36  gedra
58
-- Cleaned up lint warnings.
59
--
60 17 gedra
-- Revision 1.2  2004/06/09 19:24:50  gedra
61
-- Added dual port ram.
62
--
63 16 gedra
-- Revision 1.1  2004/06/07 18:06:00  gedra
64
-- Receiver component declarations.
65 14 gedra
--
66 16 gedra
--
67 14 gedra
 
68
library IEEE;
69
use IEEE.std_logic_1164.all;
70
 
71
package rx_package is
72
 
73
-- type declarations
74
  type bus_array is array (0 to 7) of std_logic_vector(31 downto 0);
75
 
76
-- components
77
  component rx_ver_reg
78
    generic (DATA_WIDTH: integer;
79
             ADDR_WIDTH: integer;
80
             CH_ST_CAPTURE: integer);
81
    port (
82
      ver_rd: in std_logic; -- version register read
83
      ver_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0)); -- read data
84
  end component;
85
 
86
  component gen_control_reg
87
    generic (DATA_WIDTH: integer;
88
             -- note that this vector is (0 to xx), reverse order
89
             ACTIVE_BIT_MASK: std_logic_vector);
90
    port (
91
      clk: in std_logic;         -- clock  
92
      rst: in std_logic; -- reset
93
      ctrl_wr: in std_logic; -- control register write  
94
      ctrl_rd: in std_logic; -- control register read
95
      ctrl_din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
96
      ctrl_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0);
97
      ctrl_bits: out std_logic_vector(DATA_WIDTH - 1 downto 0));
98
  end component;
99
 
100
  component rx_status_reg
101
    generic (DATA_WIDTH: integer);
102
    port (
103 25 gedra
      wb_clk_i: in std_logic;             -- clock
104 14 gedra
      status_rd: in std_logic;            -- status register read
105 25 gedra
      lock: in std_logic;                 -- signal lock status
106
      chas: in std_logic;                 -- channel A or B select
107
      rx_frame_start: in std_logic;       -- start of frame signal
108
      ch_data: in std_logic;              -- channel status/user data
109
      cs_a_en: in std_logic;              -- channel status ch. A enable
110
      cs_b_en: in std_logic;              -- channel status ch. B enable
111
      status_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
112 14 gedra
  end component;
113
 
114
  component gen_event_reg
115
    generic (DATA_WIDTH: integer);
116
    port (
117
      clk: in std_logic;         -- clock  
118
      rst: in std_logic; -- reset
119
      evt_wr: in std_logic; -- event register write     
120
      evt_rd: in std_logic; -- event register read
121
      evt_din: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- write data
122
      event: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- event vector
123
      evt_mask: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- irq mask
124
      evt_en: in std_logic;               -- irq enable
125
      evt_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0); -- read data
126
      evt_irq: out std_logic); -- interrupt  request
127
  end component;
128
 
129
  component rx_cap_reg
130
    port (
131
      clk: in std_logic;                  -- clock
132
      rst: in std_logic; -- reset
133
      cap_ctrl_wr: in std_logic; -- control register write      
134
      cap_ctrl_rd: in std_logic; -- control register read
135
      cap_data_rd: in std_logic;          -- data register read
136
      cap_din: in std_logic_vector(31 downto 0); -- write data
137
      frame_rst: in std_logic; -- start of frame signal
138
      ch_data: in std_logic;  -- channel status/user data
139
      ud_a_en: in std_logic;            -- user data ch. A enable
140
      ud_b_en: in std_logic;              -- user data ch. B enable
141
      cs_a_en: in std_logic;              -- channel status ch. A enable
142
      cs_b_en: in std_logic;              -- channel status ch. B enable
143
      cap_dout: out std_logic_vector(31 downto 0); -- read data
144
      cap_evt: out std_logic);             -- capture event (interrupt)
145
  end component;
146
 
147
  component rx_phase_det
148 19 gedra
    generic (WISHBONE_FREQ: natural := 33);   -- WishBone frequency in MHz
149 14 gedra
    port (
150
      wb_clk_i: in std_logic;
151
      rxen: in std_logic;
152
      spdif: in std_logic;
153
      lock: out std_logic;
154
      rx_data: out std_logic;
155
      rx_data_en: out std_logic;
156
      rx_block_start: out std_logic;
157
      rx_frame_start: out std_logic;
158
      rx_channel_a: out std_logic;
159
      rx_error: out std_logic;
160
      ud_a_en: out std_logic;              -- user data ch. A enable
161
      ud_b_en: out std_logic;              -- user data ch. B enable
162
      cs_a_en: out std_logic;              -- channel status ch. A enable
163
      cs_b_en: out std_logic);             -- channel status ch. B enable);            
164
  end component;
165 16 gedra
 
166
  component dpram
167
    generic (DATA_WIDTH: positive;
168 17 gedra
             RAM_WIDTH: positive);
169 16 gedra
    port (
170
      clk: in std_logic;
171
      rst: in std_logic; -- reset is optional, not used here
172
      din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
173
      wr_en: in std_logic;
174
      rd_en: in std_logic;
175 17 gedra
      wr_addr: in std_logic_vector(RAM_WIDTH - 1 downto 0);
176
      rd_addr: in std_logic_vector(RAM_WIDTH - 1 downto 0);
177 16 gedra
      dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
178 19 gedra
  end component;
179
 
180
  component rx_decode
181
    generic (DATA_WIDTH: integer range 16 to 32;
182
             ADDR_WIDTH: integer range 8 to 64);
183
    port (
184
      wb_clk_i: in std_logic;
185
      conf_rxen: in std_logic;
186
      conf_sample: in std_logic;
187
      conf_valid: in std_logic;
188
      conf_mode: in std_logic_vector(3 downto 0);
189
      conf_blken: in std_logic;
190
      conf_valen: in std_logic;
191
      conf_useren: in std_logic;
192
      conf_staten: in std_logic;
193
      conf_paren: in std_logic;
194
      lock: in std_logic;
195
      rx_data: in std_logic;
196
      rx_data_en: in std_logic;
197
      rx_block_start: in std_logic;
198
      rx_frame_start: in std_logic;
199
      rx_channel_a: in std_logic;
200
      wr_en: out std_logic;
201
      wr_addr: out std_logic_vector(ADDR_WIDTH - 2 downto 0);
202 37 gedra
      wr_data: out std_logic_vector(DATA_WIDTH - 1 downto 0);
203 19 gedra
      stat_paritya: out std_logic;
204
      stat_parityb: out std_logic;
205
      stat_lsbf: out std_logic;
206
      stat_hsbf: out std_logic);
207
  end component;
208 30 gedra
 
209
  component rx_wb_decoder
210
    generic (DATA_WIDTH: integer;
211
             ADDR_WIDTH: integer);
212
    port (
213
      wb_clk_i: in std_logic;             -- wishbone clock
214
      wb_rst_i: in std_logic;             -- reset signal
215
      wb_sel_i: in std_logic;             -- select input
216
      wb_stb_i: in std_logic;             -- strobe input
217
      wb_we_i: in std_logic;              -- write enable
218
      wb_cyc_i: in std_logic;             -- cycle input
219
      wb_bte_i: in std_logic_vector(1 downto 0);  -- burts type extension
220
      wb_adr_i: in std_logic_vector(ADDR_WIDTH - 1 downto 0);  -- address
221
      wb_cti_i: in std_logic_vector(2 downto 0);  -- cycle type identifier
222
      data_out: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- internal bus
223
      wb_ack_o: out std_logic;            -- acknowledge
224
      wb_dat_o: out std_logic_vector(DATA_WIDTH - 1 downto 0);  -- data out
225
      version_rd: out std_logic;          -- Version register read 
226
      config_rd: out std_logic;           -- Config register read
227
      config_wr: out std_logic;           -- Config register write
228
      status_rd: out std_logic;           -- Status register read
229
      intmask_rd: out std_logic;          -- Interrupt mask register read
230
      intmask_wr: out std_logic;          -- Interrupt mask register write
231
      intstat_rd: out std_logic;          -- Interrupt status register read
232
      intstat_wr: out std_logic;          -- Interrupt status register read
233
      mem_rd: out std_logic;              -- Sample memory read
234
      mem_addr: out std_logic_vector(ADDR_WIDTH - 2 downto 0);  -- memory addr.
235
      ch_st_cap_rd: out std_logic_vector(7 downto 0);  -- Ch. status cap. read
236
      ch_st_cap_wr: out std_logic_vector(7 downto 0);  -- Ch. status cap. write
237
      ch_st_data_rd: out std_logic_vector(7 downto 0)); -- Ch. status data read
238
  end component;
239 37 gedra
 
240 14 gedra
end rx_package;

powered by: WebSVN 2.1.0

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