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

Subversion Repositories mdct

[/] [mdct/] [trunk/] [source/] [ROME.VHD] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mikel262
--------------------------------------------------------------------------------
2
--                                                                            --
3
--                          V H D L    F I L E                                --
4
--                          COPYRIGHT (C) 2006                                --
5
--                                                                            --
6
--------------------------------------------------------------------------------
7
--
8
-- Title       : DCT
9
-- Design      : MDCT Core
10
-- Author      : Michal Krepa
11
--
12
--------------------------------------------------------------------------------
13
--
14
-- File        : ROME.VHD
15
-- Created     : Sat Mar 5 7:37 2006
16
--
17
--------------------------------------------------------------------------------
18
--
19
--  Description : ROM for DCT matrix constant cosine coefficients (even part)
20
--
21
--------------------------------------------------------------------------------
22
 
23
-- 5:0
24
-- 5:4 = select matrix row (1 out of 4)
25
-- 3:0 = select precomputed MAC ( 1 out of 16)
26
 
27
library IEEE;
28 21 mikel262
  use IEEE.STD_LOGIC_1164.all;
29
  use IEEE.STD_LOGIC_arith.all;
30 2 mikel262
  use WORK.MDCT_PKG.all;
31
 
32
entity ROME is
33
  port(
34 11 mikel262
       addr         : in  STD_LOGIC_VECTOR(ROMADDR_W-1 downto 0);
35
       clk          : in  STD_LOGIC;
36 2 mikel262
 
37
       datao        : out STD_LOGIC_VECTOR(ROMDATA_W-1 downto 0)
38
  );
39
 
40
end ROME;
41
 
42
architecture RTL of ROME is
43
 
44 21 mikel262
  type ROM_TYPE is array (0 to (2**ROMADDR_W)-1)
45 2 mikel262
            of STD_LOGIC_VECTOR(ROMDATA_W-1 downto 0);
46
  constant rom : ROM_TYPE :=
47
    (
48
    (others => '0'),
49 21 mikel262
     conv_std_logic_vector( AP,ROMDATA_W ),
50
     conv_std_logic_vector( AP,ROMDATA_W ),
51
     conv_std_logic_vector( AP+AP,ROMDATA_W ),
52
     conv_std_logic_vector( AP,ROMDATA_W ),
53
     conv_std_logic_vector( AP+AP,ROMDATA_W ),
54
     conv_std_logic_vector( AP+AP,ROMDATA_W ),
55
     conv_std_logic_vector( AP+AP+AP,ROMDATA_W ),
56
     conv_std_logic_vector( AP,ROMDATA_W ),
57
     conv_std_logic_vector( AP+AP,ROMDATA_W ),
58
     conv_std_logic_vector( AP+AP,ROMDATA_W ),
59
     conv_std_logic_vector( AP+AP+AP,ROMDATA_W ),
60
     conv_std_logic_vector( AP+AP,ROMDATA_W ),
61
     conv_std_logic_vector( AP+AP+AP,ROMDATA_W ),
62
     conv_std_logic_vector( AP+AP+AP,ROMDATA_W ),
63
     conv_std_logic_vector( AP+AP+AP+AP,ROMDATA_W ),
64 2 mikel262
 
65
 
66
     (others => '0'),
67 21 mikel262
     conv_std_logic_vector( BM,ROMDATA_W ),
68
     conv_std_logic_vector( CM,ROMDATA_W ),
69
     conv_std_logic_vector( CM+BM,ROMDATA_W ),
70
     conv_std_logic_vector( CP,ROMDATA_W ),
71
     conv_std_logic_vector( CP+BM,ROMDATA_W ),
72 2 mikel262
     (others => '0'),
73 21 mikel262
     conv_std_logic_vector( BM,ROMDATA_W ),
74
     conv_std_logic_vector( BP,ROMDATA_W ),
75 2 mikel262
     (others => '0'),
76 21 mikel262
     conv_std_logic_vector( BP+CM,ROMDATA_W ),
77
     conv_std_logic_vector( CM,ROMDATA_W ),
78
     conv_std_logic_vector( BP+CP,ROMDATA_W ),
79
     conv_std_logic_vector( CP,ROMDATA_W ),
80
     conv_std_logic_vector( BP,ROMDATA_W ),
81 2 mikel262
     (others => '0'),
82
 
83
 
84
     (others => '0'),
85 21 mikel262
     conv_std_logic_vector( AP,ROMDATA_W ),
86
     conv_std_logic_vector( AM,ROMDATA_W ),
87 2 mikel262
     (others => '0'),
88 21 mikel262
     conv_std_logic_vector( AM,ROMDATA_W ),
89 2 mikel262
     (others => '0'),
90 21 mikel262
     conv_std_logic_vector( AM+AM,ROMDATA_W ),
91
     conv_std_logic_vector( AM,ROMDATA_W ),
92
     conv_std_logic_vector( AP,ROMDATA_W ),
93
     conv_std_logic_vector( AP+AP,ROMDATA_W ),
94 2 mikel262
     (others => '0'),
95 21 mikel262
     conv_std_logic_vector( AP,ROMDATA_W ),
96 2 mikel262
     (others => '0'),
97 21 mikel262
     conv_std_logic_vector( AP,ROMDATA_W ),
98
     conv_std_logic_vector( AM,ROMDATA_W ),
99 2 mikel262
     (others => '0'),
100
 
101
 
102
     (others => '0'),
103 21 mikel262
     conv_std_logic_vector( CM,ROMDATA_W ),
104
     conv_std_logic_vector( BP,ROMDATA_W ),
105
     conv_std_logic_vector( BP+CM,ROMDATA_W ),
106
     conv_std_logic_vector( BM,ROMDATA_W ),
107
     conv_std_logic_vector( BM+CM,ROMDATA_W ),
108 2 mikel262
     (others => '0'),
109 21 mikel262
     conv_std_logic_vector( CM,ROMDATA_W ),
110
     conv_std_logic_vector( CP,ROMDATA_W ),
111 2 mikel262
     (others => '0'),
112 21 mikel262
     conv_std_logic_vector( CP+BP,ROMDATA_W ),
113
     conv_std_logic_vector( BP,ROMDATA_W ),
114
     conv_std_logic_vector( CP+BM,ROMDATA_W ),
115
     conv_std_logic_vector( BM,ROMDATA_W ),
116
     conv_std_logic_vector( CP,ROMDATA_W ),
117 2 mikel262
     (others => '0')
118
     );
119 21 mikel262
 
120 2 mikel262
begin
121
 
122 11 mikel262
 
123
  process(clk)
124 2 mikel262
  begin
125 11 mikel262
   if clk = '1' and clk'event then
126 21 mikel262
    datao <= rom(CONV_INTEGER(UNSIGNED(addr)) );
127 11 mikel262
   end if;
128
  end process;
129 2 mikel262
 
130
end RTL;
131
 
132
 
133
 

powered by: WebSVN 2.1.0

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