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 38

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