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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.accelerator/] [dctqidct/] [1.0/] [hdl/] [dct/] [DCT1D_DA.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
------------------------------------------------------------------------------
2
-- Author        : Timo Alho
3
-- e-mail        : timo.a.alho@tut.fi
4
-- Date          : 11.08.2004 13:28:10
5
-- File          : DCT1D_DA.vhd
6
-- Design        : VHDL Entity for dct.DCT1D_DA.symbol
7
-- Generated by Mentor Graphics' HDL Designer 2003.1 (Build 399)
8
------------------------------------------------------------------------------
9
LIBRARY ieee;
10
USE ieee.std_logic_1164.all;
11
USE ieee.std_logic_arith.all;
12
LIBRARY dct;
13
USE dct.DCT_pkg.all;
14
LIBRARY common_da;
15
 
16
ENTITY DCT1D_DA IS
17
   PORT(
18
      clk            : IN     std_logic;
19
      dct_input_data : IN     std_logic_vector (8*DCT_dataw_co-1 DOWNTO 0);
20
      last_bit       : IN     std_logic;
21
      rst_n          : IN     std_logic;
22
      start          : IN     std_logic;
23
      dct1d_out      : OUT    std_logic_vector (8*DCT_dataw_co-1 DOWNTO 0)
24
   );
25
 
26
-- Declarations
27
 
28
END DCT1D_DA ;
29
 
30
------------------------------------------------------------------------------
31
-- Author        : Timo Alho
32
-- e-mail        : timo.a.alho@tut.fi
33
-- Date          : 11.08.2004 13:28:11
34
-- File          : DCT1D_DA.vhd
35
-- Design        : VHDL Architecture for dct.DCT1D_DA.symbol
36
-- Generated by Mentor Graphics' HDL Designer 2003.1 (Build 399)
37
------------------------------------------------------------------------------
38
LIBRARY ieee;
39
USE ieee.std_logic_1164.all;
40
USE ieee.std_logic_arith.all;
41
LIBRARY dct;
42
USE dct.DCT_pkg.all;
43
LIBRARY common_da;
44
 
45
 
46
ARCHITECTURE struct OF DCT1D_DA IS
47
 
48
   -- Architecture declarations
49
 
50
   -- Internal signal declarations
51
   SIGNAL Coeff_sub  : std_logic_vector(4*DCT_coeffw_co-1 DOWNTO 0);
52
   SIGNAL Coeff_sum  : std_logic_vector(4*DCT_coeffw_co-1 DOWNTO 0);
53
   SIGNAL Vec        : std_logic_vector(7 DOWNTO 0);
54
   SIGNAL Vecsub     : std_logic_vector(3 DOWNTO 0);
55
   SIGNAL Vecsum     : std_logic_vector(3 DOWNTO 0);
56
   SIGNAL start_calc : std_logic;
57
 
58
 
59
   -- ModuleWare signal declarations(v1.0) for instance 'I7' of 'adff'
60
   SIGNAL mw_I7creg : std_logic := '0';
61
 
62
   -- Component Declarations
63
   COMPONENT Parallel2Serial
64
   GENERIC (
65
      dataw_g : integer := 18
66
   );
67
   PORT (
68
      clk   : IN     std_logic ;
69
      d_in  : IN     std_logic_vector (dataw_g-1 DOWNTO 0); --parallel input data
70
      load  : IN     std_logic ;                            --'1' => d_in is loaded in
71
      rst_n : IN     std_logic ;
72
      d_out : OUT    std_logic                              --serial output data
73
   );
74
   END COMPONENT;
75
   COMPONENT Serial_adder
76
   PORT (
77
      clk     : IN     std_logic ;
78
      in0     : IN     std_logic ; --serial data input 0
79
      in1     : IN     std_logic ; --serial data input 1
80
      rst_n   : IN     std_logic ;
81
      start   : IN     std_logic ; --start (ignores carrybit)
82
      sum_out : OUT    std_logic   --serial data outuput
83
   );
84
   END COMPONENT;
85
   COMPONENT Serial_multiplier
86
   GENERIC (
87
      coeffw_g    : integer := 14;
88
      i_dataw_g   : integer := 18;
89
      round_val_g : integer := 64
90
   );
91
   PORT (
92
      clk        : IN     std_logic ;
93
      --last_value must be '1', when last bit (MSB) of multiplier is
94
      --processed
95
      last_value : IN     std_logic ;
96
      --multiplicand input
97
      mul_in     : IN     std_logic_vector (coeffw_g-1 DOWNTO 0);
98
      rst_n      : IN     std_logic ;
99
      --start = '1' clears the partial result register
100
      start      : IN     std_logic ;
101
      --result output
102
      mul_out    : OUT    std_logic_vector (i_dataw_g-1 DOWNTO 0)
103
   );
104
   END COMPONENT;
105
   COMPONENT Serial_subtractor
106
   PORT (
107
      clk     : IN     std_logic ;
108
      in0     : IN     std_logic ; --serial data in 0
109
      in1     : IN     std_logic ; --serial data in 1
110
      rst_n   : IN     std_logic ;
111
      start   : IN     std_logic ; --start (ignores borrowbit)
112
      sub_out : OUT    std_logic   --serial data out
113
   );
114
   END COMPONENT;
115
   COMPONENT Rom_dct_sub
116
   GENERIC (
117
      coeffw_g : integer := 14
118
   );
119
   PORT (
120
      addr_in  : IN     std_logic_vector (3 DOWNTO 0);
121
      clk      : IN     std_logic ;
122
      data_out : OUT    std_logic_vector (4*coeffw_g-1 DOWNTO 0)
123
   );
124
   END COMPONENT;
125
   COMPONENT Rom_dct_sum
126
   GENERIC (
127
      coeffw_g : integer := 14
128
   );
129
   PORT (
130
      addr_in  : IN     std_logic_vector (3 DOWNTO 0);
131
      clk      : IN     std_logic ;
132
      data_out : OUT    std_logic_vector (4*coeffw_g-1 DOWNTO 0)
133
   );
134
   END COMPONENT;
135
 
136
 
137
BEGIN
138
 
139
   -- ModuleWare code(v1.0) for instance 'I7' of 'adff'
140
   start_calc <= mw_I7creg;
141
   -- exemplar async_set_reset_local of I7seq "rst_n"
142
   I7seq: PROCESS (clk, rst_n)
143
   BEGIN
144
      IF (rst_n = '0' OR rst_n = 'L') THEN
145
         mw_I7creg <= '0';
146
      ELSIF (clk'EVENT AND clk='1') THEN
147
         mw_I7creg <= start;
148
      END IF;
149
   END PROCESS I7seq;
150
 
151
   -- Instance port mappings.
152
   rom_sub : Rom_dct_sub
153
      GENERIC MAP (
154
         coeffw_g => DCT_coeffw_co
155
      )
156
      PORT MAP (
157
         addr_in  => Vecsub,
158
         clk      => clk,
159
         data_out => Coeff_sub
160
      );
161
   rom_sum : Rom_dct_sum
162
      GENERIC MAP (
163
         coeffw_g => DCT_coeffw_co
164
      )
165
      PORT MAP (
166
         addr_in  => Vecsum,
167
         clk      => clk,
168
         data_out => Coeff_sum
169
      );
170
 
171
   g0: FOR i IN 0 TO 7 GENERATE
172
      input_p2s : Parallel2Serial
173
         GENERIC MAP (
174
            dataw_g => DCT_dataw_co
175
         )
176
         PORT MAP (
177
            clk=>clk,
178
            rst_n=>rst_n,
179
            load=>start,
180
            d_in=> dct_input_data((i+1)*DCT_dataw_co-1 DOWNTO i*DCT_dataw_co),
181
            d_out=>Vec(i)
182
         );
183
   END GENERATE g0;
184
 
185
   g1: FOR i IN 0 TO 3 GENERATE
186
      sumterm_adder : Serial_adder
187
         PORT MAP (
188
            clk=>clk,
189
            rst_n=>rst_n,
190
            start=>start_calc,
191
            in1=> Vec(7-i),
192
            in0=>Vec(i),
193
            sum_out=>Vecsum(i)
194
         );
195
   END GENERATE g1;
196
 
197
   g2: FOR i IN 0 TO 3 GENERATE
198
      subterm_subtractor : Serial_subtractor
199
         PORT MAP (
200
            clk=>clk,
201
            rst_n=>rst_n,
202
            start=>start_calc,
203
            in1=> Vec(7-i),
204
            in0=>Vec(i),
205
            sub_out=>Vecsub(i)
206
         );
207
   END GENERATE g2;
208
 
209
   g3: FOR i IN 0 TO 3 GENERATE
210
      sumterm_mul : Serial_multiplier
211
         GENERIC MAP (
212
            coeffw_g    => DCT_coeffw_co,
213
            i_dataw_g   => DCT_dataw_co,
214
            round_val_g => DCT_rounding_value_co
215
         )
216
         PORT MAP (
217
            clk=>clk,
218
            rst_n=>rst_n,
219
            last_value=>last_bit,
220
            start=>start_calc,
221
            mul_out=>dct1d_out((i*2+1)*DCT_dataw_co-1 DOWNTO (i*2)*DCT_dataw_co),
222
            mul_in=>Coeff_sum((4-i)*DCT_coeffw_co-1 DOWNTO (3-i)*DCT_coeffw_co)
223
         );
224
   END GENERATE g3;
225
 
226
   g4: FOR i IN 0 TO 3 GENERATE
227
      subterm_mul : Serial_multiplier
228
         GENERIC MAP (
229
            coeffw_g    => DCT_coeffw_co,
230
            i_dataw_g   => DCT_dataw_co,
231
            round_val_g => DCT_rounding_value_co
232
         )
233
         PORT MAP (
234
            clk=>clk,
235
            rst_n=>rst_n,
236
            last_value=>last_bit,
237
            start=>start_calc,
238
            mul_out=>dct1d_out((i*2+1+1)*DCT_dataw_co-1 DOWNTO (i*2+1)*DCT_dataw_co),
239
            mul_in=>Coeff_sub((4-i)*DCT_coeffw_co-1 DOWNTO (3-i)*DCT_coeffw_co)
240
         );
241
   END GENERATE g4;
242
 
243
END struct;

powered by: WebSVN 2.1.0

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