1 |
6 |
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/receiver version register. ----
|
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 General ----
|
29 |
|
|
---- Public License as published by the Free Software Foundation; ----
|
30 |
|
|
---- either version 2.0 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 General Public License for more details.----
|
37 |
|
|
---- ----
|
38 |
|
|
---- You should have received a copy of the GNU General ----
|
39 |
|
|
---- Public License along with this source; if not, download it ----
|
40 |
|
|
---- from http://www.gnu.org/licenses/gpl.txt ----
|
41 |
|
|
---- ----
|
42 |
|
|
----------------------------------------------------------------------
|
43 |
|
|
--
|
44 |
|
|
-- CVS Revision History
|
45 |
|
|
--
|
46 |
|
|
-- $Log: not supported by cvs2svn $
|
47 |
|
|
--
|
48 |
|
|
--
|
49 |
|
|
|
50 |
|
|
library ieee;
|
51 |
|
|
use ieee.std_logic_1164.all;
|
52 |
|
|
use ieee.numeric_std.all;
|
53 |
|
|
|
54 |
|
|
entity i2s_version is
|
55 |
|
|
generic (DATA_WIDTH: integer;
|
56 |
|
|
ADDR_WIDTH: integer;
|
57 |
|
|
IS_MASTER: integer);
|
58 |
|
|
port (
|
59 |
|
|
ver_rd: in std_logic; -- version register read
|
60 |
|
|
ver_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0));
|
61 |
|
|
end i2s_version;
|
62 |
|
|
|
63 |
|
|
architecture rtl of i2s_version is
|
64 |
|
|
|
65 |
|
|
signal version : std_logic_vector(DATA_WIDTH - 1 downto 0);
|
66 |
|
|
|
67 |
|
|
begin
|
68 |
|
|
ver_dout <= version when ver_rd = '1' else (others => '0');
|
69 |
|
|
|
70 |
|
|
-- version vector generation
|
71 |
|
|
version(3 downto 0) <= "0001"; -- version 1
|
72 |
|
|
G32: if DATA_WIDTH = 32 generate
|
73 |
|
|
version(4) <= '1';
|
74 |
|
|
version(31 downto 16) <= (others => '0');
|
75 |
|
|
end generate G32;
|
76 |
|
|
G16: if DATA_WIDTH = 16 generate
|
77 |
|
|
version(4) <= '0';
|
78 |
|
|
end generate G16;
|
79 |
|
|
version(15 downto 13) <= (others => '0');
|
80 |
|
|
version(12 downto 6) <= std_logic_vector(to_unsigned(ADDR_WIDTH, 7));
|
81 |
|
|
version(5) <= '1' when IS_MASTER = 1 else '0';
|
82 |
|
|
|
83 |
|
|
end rtl;
|