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 30

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

powered by: WebSVN 2.1.0

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