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

Subversion Repositories raytrac

[/] [raytrac/] [branches/] [fp_sgdma/] [ap_n_dpc.vhd] - Blame information for rev 248

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

Line No. Rev Author Line
1 219 jguarin200
--! @file ap_n_dpc.vhd
2 196 jguarin200
--! @brief Decodificador de operacién. Sistema de decodificación de los \kdatapaths, cuyo objetivo es a partir del par´ametro de entrada DCS.\nSon 4 las posibles configuraciones de \kdatapaths que existen. Los valores de los bits DC son los que determinan y decodifican la interconexión entre los componentes aritméticos. El componente S determina el signo de la operación cuando es una suma la que operación se es&eacutea; ejecutando en el momento.  
3 128 jguarin200
--! @author Julián Andrés Guarín Reyes
4 122 jguarin200
--------------------------------------------------------------
5
-- RAYTRAC
6
-- Author Julian Andres Guarin
7 219 jguarin200
-- ap_n_dpc.vhd
8 122 jguarin200
-- This file is part of raytrac.
9
-- 
10
--     raytrac is free software: you can redistribute it and/or modify
11
--     it under the terms of the GNU General Public License as published by
12
--     the Free Software Foundation, either version 3 of the License, or
13
--     (at your option) any later version.
14
-- 
15
--     raytrac is distributed in the hope that it will be useful,
16
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
17
--     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
--     GNU General Public License for more details.
19
-- 
20
--     You should have received a copy of the GNU General Public License
21
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>.
22
 
23
library ieee;
24
use ieee.std_logic_1164.all;
25 212 jguarin200
use ieee.std_logic_unsigned.all;
26 151 jguarin200
use work.arithpack.all;
27 134 jguarin200
 
28 212 jguarin200
library altera_mf;
29
use altera_mf.altera_mf_components.all;
30 158 jguarin200
 
31 212 jguarin200
 
32 219 jguarin200
entity ap_n_dpc is
33 152 jguarin200
 
34 122 jguarin200
        port (
35 229 jguarin200
 
36 248 jguarin200
                p0,p1,p2,p3,p4,p5,p6,p7,p8: out std_logic_vector(31 downto 0);
37 242 jguarin200
 
38
 
39 204 jguarin200
                clk                                             : in    std_logic;
40
                rst                                             : in    std_logic;
41
 
42 229 jguarin200
                ax                                              : in    std_logic_vector(31 downto 0);
43
                ay                                              : in    std_logic_vector(31 downto 0);
44
                az                                              : in    std_logic_vector(31 downto 0);
45
                bx                                              : in    std_logic_vector(31 downto 0);
46
                by                                              : in    std_logic_vector(31 downto 0);
47
                bz                                              : in    std_logic_vector(31 downto 0);
48
                vx                                              : out   std_logic_vector(31 downto 0);
49
                vy                                              : out   std_logic_vector(31 downto 0);
50
                vz                                              : out   std_logic_vector(31 downto 0);
51
                sc                                              : out   std_logic_vector(31 downto 0);
52
                ack                                             : in    std_logic;
53
                empty                                   : out   std_logic;
54 204 jguarin200
 
55 229 jguarin200
                 --paraminput                           : in    vectorblock06;  --! Vectores A,B
56 204 jguarin200
 
57 229 jguarin200
                dcs                                             : in    std_logic_vector(2 downto 0);            --! Bit con el identificador del bloque AB vs CD e identificador del sub bloque (A/B) o (C/D). 
58
 
59 212 jguarin200
                sync_chain_1                    : in    std_logic;              --! Se&ntilde;al de dato valido que se va por toda la cadena de sincronizacion.
60 229 jguarin200
                pipeline_pending                : out   std_logic               --! Se&ntilde;al para indicar si hay datos en el pipeline aritm&eacute;tico.    
61 204 jguarin200
 
62 229 jguarin200
 
63
 
64
                --qresult_d                             : out   vectorblock04   --! 4 salidas de resultados, pues lo m&aacute;ximo que podr&aacute; calcularse por cada clock son 2 vectores. 
65
 
66 204 jguarin200
 
67
 
68 122 jguarin200
        );
69 153 jguarin200
end entity;
70 122 jguarin200
 
71 219 jguarin200
architecture ap_n_dpc_arch of ap_n_dpc is
72 228 jguarin200
        --!Constantes de apoyo
73 248 jguarin200
        constant ssync_chain_max : integer :=32;
74 228 jguarin200
        constant ssync_chain_min : integer :=2;
75 125 jguarin200
 
76 235 jguarin200
        --! Tunnning delay
77
        constant adder2_delay: integer := 1;
78 242 jguarin200
        constant adder1_delay : integer := 1;
79 228 jguarin200
 
80 161 jguarin200
        --!TBXSTART:FACTORS_N_ADDENDS
81 242 jguarin200
        signal sfactor0 : std_logic_vector(31 downto 0);
82
        signal sfactor1 : std_logic_vector(31 downto 0);
83
        signal sfactor2 : std_logic_vector(31 downto 0);
84
        signal sfactor3 : std_logic_vector(31 downto 0);
85
        signal sfactor4 : std_logic_vector(31 downto 0);
86
        signal sfactor5 : std_logic_vector(31 downto 0);
87
        signal sfactor6 : std_logic_vector(31 downto 0);
88
        signal sfactor7 : std_logic_vector(31 downto 0);
89
        signal sfactor8 : std_logic_vector(31 downto 0);
90
        signal sfactor9 : std_logic_vector(31 downto 0);
91 229 jguarin200
        signal sfactor10        : std_logic_vector(31 downto 0);
92
        signal sfactor11        : std_logic_vector(31 downto 0);
93
        --signal sfactor                : vectorblock12;
94
 
95
        signal ssumando0        : std_logic_vector(31 downto 0);
96
        signal ssumando1        : std_logic_vector(31 downto 0);
97
        signal ssumando2        : std_logic_vector(31 downto 0);
98
        signal ssumando3        : std_logic_vector(31 downto 0);
99
        signal ssumando4        : std_logic_vector(31 downto 0);
100
        signal ssumando5        : std_logic_vector(31 downto 0);
101
        --signal ssumando               : vectorblock06;
102
 
103
        signal sq0_q            : std_logic_vector(31 downto 0);
104 161 jguarin200
        --!TBXEND
105 163 jguarin200
 
106
 
107
        --!TBXSTART:ARITHMETIC_RESULTS
108 229 jguarin200
 
109
        signal sp0                      : std_logic_vector(31 downto 0);
110
        signal sp1                      : std_logic_vector(31 downto 0);
111
        signal sp2                      : std_logic_vector(31 downto 0);
112
        signal sp3                      : std_logic_vector(31 downto 0);
113
        signal sp4                      : std_logic_vector(31 downto 0);
114
        signal sp5                      : std_logic_vector(31 downto 0);
115
        --signal sprd32blk      : vectorblock06;
116
 
117
        signal sa0                      : std_logic_vector(31 downto 0);
118
        signal sa1                      : std_logic_vector(31 downto 0);
119
        signal sa2                      : std_logic_vector(31 downto 0);
120
 
121
        --signal sadd32blk      : vectorblock03;
122
 
123
        signal ssq32    : std_logic_vector(31 downto 0);
124
        signal sinv32   : std_logic_vector(31 downto 0);
125
 
126
        signal sqx_q            : std_logic_vector(31 downto 0);
127
        signal sqy_q            : std_logic_vector(31 downto 0);
128
        signal sqz_q            : std_logic_vector(31 downto 0);
129
        --signal sqxyz_q                : vectorblock03;
130
 
131
        signal sq1_e            : std_logic;
132 163 jguarin200
        --!TBXEND
133
 
134 160 jguarin200
 
135
        --!TBXSTART:SYNC_CHAIN
136 228 jguarin200
        signal ssync_chain      : std_logic_vector(ssync_chain_max downto ssync_chain_min);
137 171 jguarin200
        --!TBXEND
138 212 jguarin200
 
139 229 jguarin200
        --signal qxyzd          : std_logic_vector(95 downto 0);
140
 
141
        --signal qxyzq          : std_logic_vector(95 downto 0);
142
 
143 228 jguarin200
        signal sq2_d            : std_logic_vector(31 downto 0);
144
        signal sq2_q            : std_logic_vector(31 downto 0);
145
        signal sq2_w            : std_logic;
146
        signal sq2_e            : std_logic;
147 219 jguarin200
 
148 229 jguarin200
        signal sqr_e            : std_logic;
149
        signal sqr_w            : std_logic;            --! Salidas de escritura y lectura en las colas de resultados.
150
        signal sqr_dx           : std_logic_vector(31 downto 0);
151
        signal sqr_dy           : std_logic_vector(31 downto 0);
152
        signal sqr_dz           : std_logic_vector(31 downto 0);
153
        signal sqr_dsc          : std_logic_vector(31 downto 0);
154
 
155 219 jguarin200
 
156
 
157 229 jguarin200
        signal sa0o                     : std_logic_vector(31 downto 0);
158
        signal sa1o                     : std_logic_vector(31 downto 0);
159
        signal sa2o                     : std_logic_vector(31 downto 0);
160
        --signal sadd32blko     : vectorblock03;        --! Salidas de los 3 sumadores.
161 163 jguarin200
 
162 229 jguarin200
        signal sp0o                     : std_logic_vector(31 downto 0);
163
        signal sp1o                     : std_logic_vector(31 downto 0);
164
        signal sp2o                     : std_logic_vector(31 downto 0);
165
        signal sp3o                     : std_logic_vector(31 downto 0);
166
        signal sp4o                     : std_logic_vector(31 downto 0);
167
        signal sp5o                     : std_logic_vector(31 downto 0);
168
        --signal sprd32blko     : vectorblock06;        --! Salidas de los 6 multiplicadores.
169
 
170
        signal sinv32o  : std_logic_vector(31 downto 0);         --! Salidas de la raiz cuadradas y el inversor.
171
        signal ssq32o   : std_logic_vector(31 downto 0);         --! Salidas de la raiz cuadradas y el inversor.
172
 
173 219 jguarin200
        --! Bloque Aritmetico de Sumadores y Multiplicadores (madd)
174
        component arithblock
175
        port (
176
 
177
                clk     : in std_logic;
178
                rst : in std_logic;
179
 
180
                sign            : in std_logic;
181 229 jguarin200
 
182
                factor0         : in std_logic_vector(31 downto 0);
183
                factor1         : in std_logic_vector(31 downto 0);
184
                factor2         : in std_logic_vector(31 downto 0);
185
                factor3         : in std_logic_vector(31 downto 0);
186
                factor4         : in std_logic_vector(31 downto 0);
187
                factor5         : in std_logic_vector(31 downto 0);
188
                factor6         : in std_logic_vector(31 downto 0);
189
                factor7         : in std_logic_vector(31 downto 0);
190
                factor8         : in std_logic_vector(31 downto 0);
191
                factor9         : in std_logic_vector(31 downto 0);
192
                factor10        : in std_logic_vector(31 downto 0);
193
                factor11        : in std_logic_vector(31 downto 0);
194
                --prd32blki     : in vectorblock06;
195 219 jguarin200
 
196 229 jguarin200
                sumando0        : in std_logic_vector(31 downto 0);
197
                sumando1        : in std_logic_vector(31 downto 0);
198
                sumando2        : in std_logic_vector(31 downto 0);
199
                sumando3        : in std_logic_vector(31 downto 0);
200
                sumando4        : in std_logic_vector(31 downto 0);
201
                sumando5        : in std_logic_vector(31 downto 0);
202
                --add32blki     : in vectorblock06;
203 219 jguarin200
 
204 229 jguarin200
                a0                      : out std_logic_vector(31 downto 0);
205
                a1                      : out std_logic_vector(31 downto 0);
206
                a2                      : out std_logic_vector(31 downto 0);
207
                --add32blko     : out vectorblock03;
208 219 jguarin200
 
209 229 jguarin200
                p0                      : out std_logic_vector(31 downto 0);
210
                p1                      : out std_logic_vector(31 downto 0);
211
                p2                      : out std_logic_vector(31 downto 0);
212
                p3                      : out std_logic_vector(31 downto 0);
213
                p4                      : out std_logic_vector(31 downto 0);
214
                p5                      : out std_logic_vector(31 downto 0);
215
                --prd32blko     : out vectorblock06;
216
 
217
                sq32o           : out std_logic_vector(31 downto 0);
218
                inv32o          : out std_logic_vector(31 downto 0)
219 219 jguarin200
 
220
        );
221
        end component;
222
 
223 123 jguarin200
begin
224 204 jguarin200
 
225 219 jguarin200
        --! Bloque Aritm&eacute;tico
226
        ap : arithblock
227
        port map (
228
                clk             => clk,
229
                rst                     => rst,
230 204 jguarin200
 
231 229 jguarin200
                sign            => dcs(0),
232 219 jguarin200
 
233 229 jguarin200
                factor0 =>sfactor0,
234
                factor1 =>sfactor1,
235
                factor2 =>sfactor2,
236
                factor3 =>sfactor3,
237
                factor4 =>sfactor4,
238
                factor5 =>sfactor5,
239
                factor6 =>sfactor6,
240
                factor7 =>sfactor7,
241
                factor8 =>sfactor8,
242
                factor9 =>sfactor9,
243
                factor10=>sfactor10,
244
                factor11=>sfactor11,
245
                --prd32blki     => sfactor,
246
 
247
                sumando0=>ssumando0,
248
                sumando1=>ssumando1,
249
                sumando2=>ssumando2,
250
                sumando3=>ssumando3,
251
                sumando4=>ssumando4,
252
                sumando5=>ssumando5,
253
                --add32blki     => ssumando,
254 219 jguarin200
 
255 229 jguarin200
                a0=>sa0o,
256
                a1=>sa1o,
257
                a2=>sa2o,
258
                --add32blko     => sadd32blko, 
259 219 jguarin200
 
260 229 jguarin200
                p0=>sp0o,
261
                p1=>sp1o,
262
                p2=>sp2o,
263
                p3=>sp3o,
264
                p4=>sp4o,
265
                p5=>sp5o,
266
                --prd32blko     => sprd32blko,
267
 
268
                sq32o=> ssq32o,
269
                inv32o=> sinv32o
270 219 jguarin200
        );
271 122 jguarin200
 
272 142 jguarin200
        --! Cadena de sincronizaci&oacute;n: 29 posiciones.
273 229 jguarin200
        pipeline_pending <= sync_chain_1 or not(sq2_e) or not(sq1_e) or not(sqr_e);
274
        empty <= sqr_e;
275 140 jguarin200
        sync_chain_proc:
276 212 jguarin200
        process(clk,rst,sync_chain_1)
277 140 jguarin200
        begin
278
                if rst=rstMasterValue then
279 228 jguarin200
                        ssync_chain(ssync_chain_max downto ssync_chain_min) <= (others => '0');
280 230 jguarin200
 
281 242 jguarin200
                        p0 <= (others => '0');
282
                        p1 <= (others => '0');
283
                        p2 <= (others => '0');
284
 
285 229 jguarin200
                elsif clk'event and clk='1' then
286 228 jguarin200
                        for i in ssync_chain_max downto ssync_chain_min+1 loop
287 142 jguarin200
                                ssync_chain(i) <= ssync_chain(i-1);
288 140 jguarin200
                        end loop;
289 228 jguarin200
                        ssync_chain(ssync_chain_min) <= sync_chain_1;
290 242 jguarin200
 
291
                        --! Salida de los multiplicadores p0 p1 p2 
292 248 jguarin200
                        if ssync_chain(23)='1' then
293
                                p0 <= ssq32; -- El resultado quedara consignado en VZ1=BASE+1
294
                        elsif ssync_chain(28)='1' then
295
                                p1 <= sq2_q; -- El resultado quedara consignado en VX1=BASE+3
296
                        elsif ssync_chain(24)='1' then
297
                                p2 <= sinv32; -- El resutlado quedara consignado en VY1=BASE+2
298
                                p3 <= sqx_q;
299
                                p4 <= sqy_q;
300
                                p5 <= sqz_q;
301
                        elsif ssync_chain(28)='1' then
302
                                p6 <= sp3o;
303
                                p7 <= sp4o;
304
                                p8 <= sp5o;
305 242 jguarin200
                        end if;
306
 
307 140 jguarin200
                end if;
308
        end process sync_chain_proc;
309 144 jguarin200
 
310 163 jguarin200
 
311 158 jguarin200
 
312
 
313 124 jguarin200
 
314 140 jguarin200
        --! El siguiente c&oacute;digo sirve para conectar arreglos a se&ntilde;ales std_logic_1164, son abstracciones de c&oacute;digo tambi&eacute;n, sin embargo se realizan a trav&eacute;s de registros. 
315
        register_products_outputs:
316
        process (clk)
317
        begin
318
                if clk'event and clk='1' then
319 229 jguarin200
                        sp0 <= sp0o;
320
                        sp1 <= sp1o;
321
                        sp2 <= sp2o;
322
                        sp3 <= sp3o;
323
                        sp4 <= sp4o;
324
                        sp5 <= sp5o;
325
                        sa0 <= sa0o;
326
                        sa1 <= sa1o;
327
                        sa2 <= sa2o;
328
                        sinv32 <= sinv32o;
329
                        ssq32 <= ssq32o;
330 140 jguarin200
                end if;
331
        end process;
332 148 jguarin200
 
333 196 jguarin200
        --! Decodificaci&oacute;n del Datapath.
334 229 jguarin200
        datapathproc:process(dcs,ax,bx,ay,by,az,bz,sinv32,sp0,sp1,sp2,sp3,sp4,sp5,sa0,sa1,sa2,sq0_q,sqx_q,sqy_q,sqz_q,ssync_chain,ssq32,sq2_q)
335 196 jguarin200
        begin
336 229 jguarin200
 
337
                case dcs is
338
                        when "011"  =>
339
 
340
                                sq2_w <= '0';
341
                                sq2_d <= ssq32;
342
 
343
                                sfactor0 <= ay;
344
                                sfactor1 <= bz;
345
                                sfactor2 <= az;
346
                                sfactor3 <= by;
347
                                sfactor4 <= az;
348
                                sfactor5 <= bx;
349
                                sfactor6 <= ax;
350
                                sfactor7 <= bz;
351
                                sfactor8 <= ax;
352
                                sfactor9 <= by;
353
                                sfactor10 <= ay;
354
                                sfactor11 <= bx;
355
 
356
                                ssumando0 <= sp0;
357
                                ssumando1 <= sp1;
358
                                ssumando2 <= sp2;
359
                                ssumando3 <= sp3;
360
                                ssumando4 <= sp4;
361
                                ssumando5 <= sp5;
362
 
363
                                sqr_dx <= sa0;
364
                                sqr_dy <= sa1;
365
                                sqr_dz <= sa2;
366
 
367 230 jguarin200
                                sqr_w <= ssync_chain(13+adder2_delay);
368 229 jguarin200
 
369
                        when"000"|"001" =>
370
 
371
                                sq2_w <= '0';
372
                                sq2_d <= ssq32;
373
 
374
                                sfactor0 <= ay;
375
                                sfactor1 <= bz;
376
                                sfactor2 <= az;
377
                                sfactor3 <= by;
378
                                sfactor4 <= az;
379
                                sfactor5 <= bx;
380
                                sfactor6 <= ax;
381
                                sfactor7 <= bz;
382
                                sfactor8 <= ax;
383
                                sfactor9 <= by;
384
                                sfactor10 <= ay;
385
                                sfactor11 <= bx;
386
 
387
 
388
                                ssumando0 <= ax;
389
                                ssumando1 <= bx;
390
                                ssumando2 <= ay;
391
                                ssumando3 <= by;
392
                                ssumando4 <= az;
393
                                ssumando5 <= bz;
394
 
395
                                sqr_dx <= sa0;
396
                                sqr_dy <= sa1;
397
                                sqr_dz <= sa2;
398
 
399 230 jguarin200
                                sqr_w <= ssync_chain(9+adder2_delay);
400 229 jguarin200
 
401
                        when"110" |"100" =>
402
 
403
 
404
 
405
                                sfactor0 <= ax;
406
                                sfactor1 <= bx;
407
                                sfactor2 <= ay;
408
                                sfactor3 <= by;
409
                                sfactor4 <= az;
410
                                sfactor5 <= bz;
411
 
412
                                sfactor6 <= sinv32;
413
                                sfactor7 <= sqx_q;
414
                                sfactor8 <= sinv32;
415
                                sfactor9 <= sqy_q;
416
                                sfactor10 <= sinv32;
417
                                sfactor11 <= sqz_q;
418
 
419
 
420
                                ssumando0 <= sp0;
421
                                ssumando1 <= sp1;
422
                                ssumando2 <= sa0;
423
                                ssumando3 <= sq0_q;
424
                                ssumando4 <= az;
425
                                ssumando5 <= bz;
426
 
427
                                if dcs(1)='1' then
428
                                        sq2_d <= ssq32;
429 242 jguarin200
                                        sq2_w <= ssync_chain(22+adder1_delay);
430 229 jguarin200
                                else
431
                                        sq2_d <= sa1;
432 242 jguarin200
                                        sq2_w <= ssync_chain(21+adder1_delay);
433 229 jguarin200
                                end if;
434
 
435
                                sqr_dx <= sp3;
436
                                sqr_dy <= sp4;
437
                                sqr_dz <= sp5;
438
 
439 248 jguarin200
                                sqr_w <= ssync_chain(27+adder1_delay);
440 229 jguarin200
 
441
                        when others =>
442
 
443
                                sq2_w <= '0';
444
                                sq2_d <= ssq32;
445
 
446
                                sfactor0 <= ax;
447
                                sfactor1 <= bx;
448
                                sfactor2 <= ay;
449
                                sfactor3 <= by;
450
                                sfactor4 <= az;
451
                                sfactor5 <= bz;
452
 
453
                                sfactor6 <= ax;
454
                                sfactor7 <= bx;
455
                                sfactor8 <= ay;
456
                                sfactor9 <= by;
457
                                sfactor10 <= az;
458
                                sfactor11 <= bz;
459
 
460
                                ssumando0 <= sp0;
461
                                ssumando1 <= sp1;
462
                                ssumando2 <= sa0;
463
                                ssumando3 <= sq0_q;
464
                                ssumando4 <= az;
465
                                ssumando5 <= bz;
466
 
467
                                sqr_dx <= sp3;
468
                                sqr_dy <= sp4;
469
                                sqr_dz <= sp5;
470
 
471
                                sqr_w <= ssync_chain(5);
472
 
473
                end case;
474
 
475
 
476
 
477
 
478 123 jguarin200
        end process;
479
 
480 204 jguarin200
        --! Colas internas de producto punto, ubicada en el pipe line aritm&eacute;co. Paralelo a los sumadores a0 y a2.  
481
        q0 : scfifo --! Debe ir registrada la salida.
482
        generic map (
483 212 jguarin200
                allow_rwcycle_when_full => "ON",
484 229 jguarin200
                lpm_widthu                              => 4,
485
                lpm_numwords                    => 16,
486 204 jguarin200
                lpm_showahead                   => "ON",
487
                lpm_width                               => 32,
488
                overflow_checking               => "ON",
489
                underflow_checking              => "ON",
490 228 jguarin200
                use_eab                                 => "ON"
491 204 jguarin200
        )
492
        port    map (
493 212 jguarin200
                sclr            => '0',
494
                clock           => clk,
495 228 jguarin200
                rdreq           => ssync_chain(13),
496 242 jguarin200
                wrreq           => ssync_chain(5),
497 229 jguarin200
                data            => sp2,
498
                q                       => sq0_q
499 204 jguarin200
        );
500 212 jguarin200
        --! Colas internas de producto punto, ubicada en el pipe line aritm&eacute;co. Paralelo a los sumadores a0 y a2.  
501 228 jguarin200
        q2 : scfifo --! Debe ir registrada la salida.
502 212 jguarin200
        generic map (
503
                allow_rwcycle_when_full => "ON",
504 229 jguarin200
                lpm_widthu                              => 4,
505
                lpm_numwords                    => 16,
506 212 jguarin200
                lpm_showahead                   => "ON",
507
                lpm_type                                => "SCIFIFO",
508
                lpm_width                               => 32,
509
                overflow_checking               => "ON",
510
                underflow_checking              => "ON",
511 228 jguarin200
                use_eab                                 => "ON"
512 212 jguarin200
        )
513
        port map (
514 248 jguarin200
                rdreq           => ssync_chain(28),
515 212 jguarin200
                sclr            => '0',
516
                clock           => clk,
517 228 jguarin200
                empty           => sq2_e,
518 229 jguarin200
                q                       => sqr_dsc,
519 228 jguarin200
                wrreq           => sq2_w,
520
                data            => sq2_d
521 212 jguarin200
        );
522 123 jguarin200
 
523 204 jguarin200
        --! Cola interna de normalizaci&oacute;n de vectores, ubicada entre el pipeline aritm&eacute;tico
524 229 jguarin200
        qx : scfifo
525 204 jguarin200
        generic map (
526 212 jguarin200
                allow_rwcycle_when_full => "ON",
527
                lpm_widthu                              => 5,
528 204 jguarin200
                lpm_numwords                    => 32,
529 212 jguarin200
                lpm_showahead                   => "ON",
530 229 jguarin200
                lpm_width                               => 32,
531 204 jguarin200
                overflow_checking               => "ON",
532
                underflow_checking              => "ON",
533
                use_eab                                 => "ON"
534
        )
535
        port    map (
536
                aclr            => '0',
537
                clock           => clk,
538 229 jguarin200
                empty           => sq1_e,
539 248 jguarin200
                rdreq           => ssync_chain(23+adder1_delay),
540 212 jguarin200
                wrreq           => sync_chain_1,
541 229 jguarin200
                data            => ax,
542
                q                       => sqx_q
543 204 jguarin200
        );
544 229 jguarin200
        qy : scfifo
545
        generic map (
546
                allow_rwcycle_when_full => "ON",
547
                lpm_widthu                              => 5,
548
                lpm_numwords                    => 32,
549
                lpm_showahead                   => "ON",
550
                lpm_width                               => 32,
551
                overflow_checking               => "ON",
552
                underflow_checking              => "ON",
553
                use_eab                                 => "ON"
554
        )
555
        port    map (
556
                aclr            => '0',
557
                clock           => clk,
558 248 jguarin200
                rdreq           => ssync_chain(23+adder1_delay),
559 229 jguarin200
                wrreq           => sync_chain_1,
560
                data            => ay,
561
                q                       => sqy_q
562
        );
563
        qz : scfifo
564
        generic map (
565
                allow_rwcycle_when_full => "ON",
566
                lpm_widthu                              => 5,
567
                lpm_numwords                    => 32,
568
                lpm_showahead                   => "ON",
569
                lpm_width                               => 32,
570
                overflow_checking               => "ON",
571
                underflow_checking              => "ON",
572
                use_eab                                 => "ON"
573
        )
574
        port    map (
575
                aclr            => '0',
576
                clock           => clk,
577 248 jguarin200
                rdreq           => ssync_chain(23+adder1_delay),
578 229 jguarin200
                wrreq           => sync_chain_1,
579
                data            => az,
580
                q                       => sqz_q
581
        );
582
--!***********************************************************************************************************
583
--!Q RESULT
584
--!***********************************************************************************************************
585 196 jguarin200
 
586 229 jguarin200
        --Colas de resultados
587
        rx : scfifo
588
        generic map (
589
                allow_rwcycle_when_full => "ON",
590
                lpm_widthu                              => 5,
591
                lpm_numwords                    => 32,
592
                lpm_showahead                   => "ON",
593
                lpm_width                               => 32,
594
                overflow_checking               => "ON",
595
                underflow_checking              => "ON",
596
                use_eab                                 => "ON"
597
        )
598
        port    map (
599
                aclr            => '0',
600
                clock           => clk,
601
                empty           => sqr_e,
602
                rdreq           => ack,
603
                wrreq           => sqr_w,
604
                data            => sqr_dx,
605
                q                       => vx
606
        );
607
        ry : scfifo
608
        generic map (
609
                allow_rwcycle_when_full => "ON",
610
                lpm_widthu                              => 5,
611
                lpm_numwords                    => 32,
612
                lpm_showahead                   => "ON",
613
                lpm_width                               => 32,
614
                overflow_checking               => "ON",
615
                underflow_checking              => "ON",
616
                use_eab                                 => "ON"
617
        )
618
        port    map (
619
                aclr            => '0',
620
                clock           => clk,
621
                rdreq           => ack,
622
                wrreq           => sqr_w,
623
                data            => sqr_dy,
624
                q                       => vy
625
        );
626
        rz : scfifo
627
        generic map (
628
                allow_rwcycle_when_full => "ON",
629
                lpm_widthu                              => 5,
630
                lpm_numwords                    => 32,
631
                lpm_showahead                   => "ON",
632
                lpm_width                               => 32,
633
                overflow_checking               => "ON",
634
                underflow_checking              => "ON",
635
                use_eab                                 => "ON"
636
        )
637
        port    map (
638
                aclr            => '0',
639
                clock           => clk,
640
                rdreq           => ack,
641
                wrreq           => sqr_w,
642
                data            => sqr_dz,
643
                q                       => vz
644
        );
645
        rsc : scfifo
646
        generic map (
647
                allow_rwcycle_when_full => "ON",
648
                lpm_widthu                              => 5,
649
                lpm_numwords                    => 32,
650
                lpm_showahead                   => "ON",
651
                lpm_width                               => 32,
652
                overflow_checking               => "ON",
653
                underflow_checking              => "ON",
654
                use_eab                                 => "ON"
655
        )
656
        port    map (
657
                aclr            => '0',
658
                clock           => clk,
659
                rdreq           => ack,
660
                wrreq           => sqr_w,
661
                data            => sqr_dsc,
662
                q                       => sc
663
        );
664 204 jguarin200
 
665
 
666 153 jguarin200
end architecture;

powered by: WebSVN 2.1.0

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