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

Subversion Repositories mkjpeg

[/] [mkjpeg/] [branches/] [16rgb/] [trunk/] [design/] [mdct/] [MDCT.VHD] - Blame information for rev 67

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

Line No. Rev Author Line
1 25 mikel262
--------------------------------------------------------------------------------
2
--                                                                            --
3
--                          V H D L    F I L E                                --
4
--                          COPYRIGHT (C) 2006-2009                           --
5
--                                                                            --
6
--------------------------------------------------------------------------------
7
--
8
-- Title       : DCT
9
-- Design      : MDCT Core
10
-- Author      : Michal Krepa
11
-- Company     : None
12
--
13
--------------------------------------------------------------------------------
14
--
15
-- File        : MDCT.VHD
16
-- Created     : Sat Feb 25 16:12 2006
17
--
18
--------------------------------------------------------------------------------
19
--
20
--  Description : Discrete Cosine Transform - chip top level (w/ memories)
21
--
22
--------------------------------------------------------------------------------
23
 
24
 
25
library IEEE;
26
  use IEEE.STD_LOGIC_1164.all;
27
 
28
library WORK;
29
  use WORK.MDCT_PKG.all;
30
 
31
 
32
entity MDCT is
33
        port(
34
                clk          : in STD_LOGIC;
35
                rst          : in std_logic;
36
    dcti         : in std_logic_vector(IP_W-1 downto 0);
37
    idv          : in STD_LOGIC;
38
 
39
    odv          : out STD_LOGIC;
40
    dcto         : out std_logic_vector(COE_W-1 downto 0);
41
    -- debug
42
    odv1         : out STD_LOGIC;
43
    dcto1        : out std_logic_vector(OP_W-1 downto 0)
44
 
45
                );
46
end MDCT;
47
 
48
architecture RTL of MDCT is
49
 
50
  signal ramdatao_s           : STD_LOGIC_VECTOR(RAMDATA_W-1 downto 0);
51
  signal ramraddro_s          : STD_LOGIC_VECTOR(RAMADRR_W-1 downto 0);
52
  signal ramwaddro_s          : STD_LOGIC_VECTOR(RAMADRR_W-1 downto 0);
53
  signal ramdatai_s           : STD_LOGIC_VECTOR(RAMDATA_W-1 downto 0);
54
  signal ramwe_s              : STD_LOGIC;
55
 
56
  signal romedatao_s          : T_ROM1DATAO;
57
  signal romodatao_s          : T_ROM1DATAO;
58
  signal romeaddro_s          : T_ROM1ADDRO;
59
  signal romoaddro_s          : T_ROM1ADDRO;
60
 
61
  signal rome2datao_s         : T_ROM2DATAO;
62
  signal romo2datao_s         : T_ROM2DATAO;
63
  signal rome2addro_s         : T_ROM2ADDRO;
64
  signal romo2addro_s         : T_ROM2ADDRO;
65
 
66
  signal odv2_s                : STD_LOGIC;
67
  signal dcto2_s               : STD_LOGIC_VECTOR(OP_W-1 downto 0);
68
  signal trigger2_s            : STD_LOGIC;
69
  signal trigger1_s            : STD_LOGIC;
70
  signal ramdatao1_s           : STD_LOGIC_VECTOR(RAMDATA_W-1 downto 0);
71
  signal ramdatao2_s           : STD_LOGIC_VECTOR(RAMDATA_W-1 downto 0);
72
  signal ramwe1_s              : STD_LOGIC;
73
  signal ramwe2_s              : STD_LOGIC;
74
  signal memswitchrd_s         : STD_LOGIC;
75
  signal memswitchwr_s         : STD_LOGIC;
76
  signal wmemsel_s             : STD_LOGIC;
77
  signal rmemsel_s             : STD_LOGIC;
78
  signal dataready_s           : STD_LOGIC;
79
  signal datareadyack_s        : STD_LOGIC;
80
 
81
begin
82
 
83
------------------------------
84
-- 1D DCT port map
85
------------------------------
86
U_DCT1D : entity work.DCT1D
87
  port map(
88
      clk          => clk,
89
      rst          => rst,
90
      dcti         => dcti,
91
      idv          => idv,
92
      romedatao    => romedatao_s,
93
      romodatao    => romodatao_s,
94
 
95
      odv          => odv1,
96
      dcto         => dcto1,
97
      romeaddro    => romeaddro_s,
98
      romoaddro    => romoaddro_s,
99
      ramwaddro    => ramwaddro_s,
100
      ramdatai     => ramdatai_s,
101
      ramwe        => ramwe_s,
102
      wmemsel      => wmemsel_s
103
                );
104
 
105
------------------------------
106
-- 1D DCT port map
107
------------------------------
108
U_DCT2D : entity work.DCT2D
109
  port map(
110
      clk          => clk,
111
      rst          => rst,
112
      romedatao    => rome2datao_s,
113
      romodatao    => romo2datao_s,
114
      ramdatao     => ramdatao_s,
115
      dataready    => dataready_s,
116
 
117
      odv          => odv,
118
      dcto         => dcto,
119
      romeaddro    => rome2addro_s,
120
      romoaddro    => romo2addro_s,
121
      ramraddro    => ramraddro_s,
122
      rmemsel      => rmemsel_s,
123
      datareadyack => datareadyack_s
124
                );
125
 
126
------------------------------
127
-- RAM1 port map
128
------------------------------
129
U1_RAM : entity work.RAM
130
  port map (
131
        d          => ramdatai_s,
132
        waddr      => ramwaddro_s,
133
        raddr      => ramraddro_s,
134
        we         => ramwe1_s,
135
        clk        => clk,
136
 
137
        q          => ramdatao1_s
138
  );
139
 
140
------------------------------
141
-- RAM2 port map
142
------------------------------
143
U2_RAM : entity work.RAM
144
  port map (
145
        d          => ramdatai_s,
146
        waddr      => ramwaddro_s,
147
        raddr      => ramraddro_s,
148
        we         => ramwe2_s,
149
        clk        => clk,
150
 
151
        q          => ramdatao2_s
152
  );
153
 
154
-- double buffer switch
155
ramwe1_s     <= ramwe_s when memswitchwr_s = '0' else '0';
156
ramwe2_s     <= ramwe_s when memswitchwr_s = '1' else '0';
157
ramdatao_s   <= ramdatao1_s when memswitchrd_s = '0' else ramdatao2_s;
158
 
159
------------------------------
160
-- DBUFCTL
161
------------------------------
162
U_DBUFCTL : entity work.DBUFCTL
163
        port map(
164
                clk            => clk,
165
                rst            => rst,
166
    wmemsel        => wmemsel_s,
167
    rmemsel        => rmemsel_s,
168
    datareadyack   => datareadyack_s,
169
 
170
    memswitchwr    => memswitchwr_s,
171
    memswitchrd    => memswitchrd_s,
172
    dataready      => dataready_s
173
                );
174
 
175
------------------------------
176
-- 1st stage ROMs
177
------------------------------
178
 
179
G_ROM_ST1 : for i in 0 to 8 generate
180
  U1_ROME : entity work.ROME
181
  port map(
182
       addr        => romeaddro_s(i),
183
       clk         => clk,
184
 
185
       datao       => romedatao_s(i)
186
  );
187
 
188
  U1_ROMO : entity work.ROMO
189
  port map(
190
       addr        => romoaddro_s(i),
191
       clk         => clk,
192
 
193
       datao       => romodatao_s(i)
194
  );
195
end generate G_ROM_ST1;
196
 
197
------------------------------
198
-- 2nd stage ROMs
199
------------------------------
200
G_ROM_ST2 : for i in 0 to 10 generate
201
  U2_ROME : entity work.ROME
202
  port map(
203
       addr        => rome2addro_s(i),
204
       clk         => clk,
205
 
206
       datao       => rome2datao_s(i)
207
  );
208
 
209
  U2_ROMO : entity work.ROMO
210
  port map(
211
       addr        => romo2addro_s(i),
212
       clk         => clk,
213
 
214
       datao       => romo2datao_s(i)
215
  );
216
 
217
end generate G_ROM_ST2;
218
 
219
end RTL;

powered by: WebSVN 2.1.0

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