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

Subversion Repositories i2s_interface

[/] [i2s_interface/] [trunk/] [rtl/] [vhdl/] [tx_i2s_pack.vhd] - Blame information for rev 11

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

Line No. Rev Author Line
1 11 gedra
----------------------------------------------------------------------
2
----                                                              ----
3
---- WISHBONE I2S Interface IP Core                               ----
4
----                                                              ----
5
---- This file is part of the I2S Interface project               ----
6
---- http://www.opencores.org/cores/i2s_interface/                ----
7
----                                                              ----
8
---- Description                                                  ----
9
---- I2S transmitter component declarations.                      ----
10
----                                                              ----
11
---- To Do:                                                       ----
12
---- -                                                            ----
13
----                                                              ----
14
---- Author(s):                                                   ----
15
---- - Geir Drange, gedra@opencores.org                           ----
16
----                                                              ----
17
----------------------------------------------------------------------
18
----                                                              ----
19
---- Copyright (C) 2004 Authors and OPENCORES.ORG                 ----
20
----                                                              ----
21
---- This source file may be used and distributed without         ----
22
---- restriction provided that this copyright statement is not    ----
23
---- removed from the file and that any derivative work contains  ----
24
---- the original copyright notice and the associated disclaimer. ----
25
----                                                              ----
26
---- This source file is free software; you can redistribute it   ----
27
---- and/or modify it under the terms of the GNU General          ----
28
---- Public License as published by the Free Software Foundation; ----
29
---- either version 2.0 of the License, or (at your option) any   ----
30
---- later version.                                               ----
31
----                                                              ----
32
---- This source is distributed in the hope that it will be       ----
33
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
34
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
35
---- PURPOSE. See the GNU General Public License for more details.----                                          
36
----                                                              ----
37
---- You should have received a copy of the GNU General           ----
38
---- Public License along with this source; if not, download it   ----
39
---- from http://www.gnu.org/licenses/gpl.txt                     ----
40
----                                                              ----
41
----------------------------------------------------------------------
42
--
43
-- CVS Revision History
44
--
45
-- $Log: not supported by cvs2svn $
46
--
47
--
48
 
49
library ieee;
50
use ieee.std_logic_1164.all;
51
 
52
package tx_i2s_pack is
53
 
54
-- components used in the transmitter
55
 
56
  component gen_control_reg
57
    generic (DATA_WIDTH: integer;
58
             -- note that this vector is (0 to xx), reverse order
59
             ACTIVE_BIT_MASK: std_logic_vector);
60
    port (
61
      clk: in std_logic;         -- clock  
62
      rst: in std_logic; -- reset
63
      ctrl_wr: in std_logic; -- control register write  
64
      ctrl_rd: in std_logic; -- control register read
65
      ctrl_din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
66
      ctrl_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0);
67
      ctrl_bits: out std_logic_vector(DATA_WIDTH - 1 downto 0));
68
  end component;
69
 
70
  component gen_event_reg
71
    generic (DATA_WIDTH: integer);
72
    port (
73
      clk: in std_logic;         -- clock  
74
      rst: in std_logic; -- reset
75
      evt_wr: in std_logic; -- event register write     
76
      evt_rd: in std_logic; -- event register read
77
      evt_din: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- write data
78
      event: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- event vector
79
      evt_mask: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- irq mask
80
      evt_en: in std_logic;               -- irq enable
81
      evt_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0); -- read data
82
      evt_irq: out std_logic); -- interrupt  request
83
  end component;
84
 
85
  component dpram
86
    generic (DATA_WIDTH: positive;
87
             RAM_WIDTH: positive);
88
    port (
89
      clk: in std_logic;
90
      rst: in std_logic; -- reset is optional, not used here
91
      din: in std_logic_vector(DATA_WIDTH - 1 downto 0);
92
      wr_en: in std_logic;
93
      rd_en: in std_logic;
94
      wr_addr: in std_logic_vector(RAM_WIDTH - 1 downto 0);
95
      rd_addr: in std_logic_vector(RAM_WIDTH - 1 downto 0);
96
      dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
97
  end component;
98
 
99
  component i2s_version
100
    generic (DATA_WIDTH: integer;
101
             ADDR_WIDTH: integer;
102
             IS_MASTER: integer);
103
    port (
104
      ver_rd: in std_logic; -- version register read
105
      ver_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
106
  end component;
107
 
108
  component tx_i2s_wbd
109
    generic (DATA_WIDTH: integer;
110
             ADDR_WIDTH: integer);
111
    port (
112
      wb_clk_i: in std_logic;             -- wishbone clock
113
      wb_rst_i: in std_logic;             -- reset signal
114
      wb_sel_i: in std_logic;             -- select input
115
      wb_stb_i: in std_logic;             -- strobe input
116
      wb_we_i: in std_logic;              -- write enable
117
      wb_cyc_i: in std_logic;             -- cycle input
118
      wb_bte_i: in std_logic_vector(1 downto 0);  -- burts type extension
119
      wb_cti_i: in std_logic_vector(2 downto 0);  -- cycle type identifier
120
      wb_adr_i: in std_logic_vector(ADDR_WIDTH - 1 downto 0);  -- address
121
      data_out: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- internal bus
122
      wb_ack_o: out std_logic;            -- acknowledge
123
      wb_dat_o: out std_logic_vector(DATA_WIDTH - 1 downto 0);  -- data out
124
      version_rd: out std_logic;          -- Version register read 
125
      config_rd: out std_logic;           -- Config register read
126
      config_wr: out std_logic;           -- Config register write
127
      intmask_rd: out std_logic;          -- Interrupt mask register read
128
      intmask_wr: out std_logic;          -- Interrupt mask register write
129
      intstat_rd: out std_logic;          -- Interrupt status register read
130
      intstat_wr: out std_logic;          -- Interrupt status register read
131
      mem_wr: out std_logic);             -- Sample memory write
132
  end component;
133
 
134
  component i2s_codec
135
    generic (DATA_WIDTH: integer;
136
             ADDR_WIDTH: integer;
137
             IS_MASTER: integer range 0 to 1;
138
             IS_RECEIVER: integer range 0 to 1);
139
    port (
140
      wb_clk_i: in std_logic;             -- wishbone clock
141
      conf_res: in std_logic_vector(5 downto 0);  -- sample resolution
142
      conf_ratio: in std_logic_vector(7 downto 0); -- clock divider ratio
143
      conf_swap: in std_logic;            -- left/right sample order
144
      conf_inten: in std_logic;           -- interrupt enable
145
      conf_en: in std_logic;              -- transmitter/recevier enable
146
      i2s_sd_i: in std_logic;             -- I2S serial data input
147
      i2s_sck_i: in std_logic;            -- I2S clock input
148
      i2s_ws_i: in std_logic;             -- I2S word select input
149
      sample_dat_i: in std_logic_vector(DATA_WIDTH - 1 downto 0);  -- audio data
150
      sample_dat_o: out std_logic_vector(DATA_WIDTH - 1 downto 0);  -- audio data
151
      mem_rdwr: out std_logic;            -- sample buffer read/write
152
      sample_addr: out std_logic_vector(ADDR_WIDTH - 2 downto 0);  -- address
153
      evt_hsbf: out std_logic;            -- higher sample buf empty event
154
      evt_lsbf: out std_logic;            -- lower sample buf empty event
155
      i2s_sd_o: out std_logic;            -- I2S serial data output
156
      i2s_sck_o: out std_logic;           -- I2S clock output
157
      i2s_ws_o: out std_logic);           -- I2S word select output
158
  end component;
159
 
160
end tx_i2s_pack;

powered by: WebSVN 2.1.0

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