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

Subversion Repositories raytrac

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

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

Line No. Rev Author Line
1 123 jguarin200
--! @file dpc.vhd
2 122 jguarin200
--! @brief Decodificador de operacion. 
3 128 jguarin200
--! @author Julián Andrés Guarín Reyes
4 122 jguarin200
--------------------------------------------------------------
5
-- RAYTRAC
6
-- Author Julian Andres Guarin
7 123 jguarin200
-- 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 134 jguarin200
 
26 123 jguarin200
entity dpc is
27 122 jguarin200
        generic (
28 132 jguarin200
                width : integer := 32
29
                --!external_readable_widthad    : integer := integer(ceil(log(real(external_readable_blocks),2.0))))                    
30 122 jguarin200
        );
31
        port (
32 143 jguarin200
                clk,rst                                 : in    std_logic;
33 127 jguarin200
                paraminput                              : in    std_logic_vector ((12*width)-1 downto 0);        --! Vectores A,B,C,D
34
                prd32blko                               : in    std_logic_vector ((06*width)-1 downto 0);        --! Salidas de los 6 multiplicadores.
35
                add32blko                               : in    std_logic_vector ((04*width)-1 downto 0);        --! Salidas de los 4 sumadores.
36 136 jguarin200
                sqr32blko,inv32blko             : in    std_logic_vector (width-1 downto 0);             --! Salidas de la raiz cuadradas y el inversor.
37 138 jguarin200
                fifo32x23_q                             : in    std_logic_vector (03*width-1 downto 0);          --! Salida de la cola intermedia.
38 127 jguarin200
                fifo32x09_q                             : in    std_logic_vector (02*width-1 downto 0);  --! Salida de las colas de producto punto. 
39
                unary,crossprod,addsub  : in    std_logic;                                                                      --! Bit con el identificador del bloque AB vs CD e identificador del sub bloque (A/B) o (C/D). 
40 142 jguarin200
                sync_chain_d                    : in    std_logic;                                                                      --! Señal de dato valido que se va por toda la cadena de sincronizacion.
41 136 jguarin200
                sqr32blki,inv32blki             : out   std_logic_vector (width-1 downto 0);             --! Salidas de las 2 raices cuadradas y los 2 inversores.
42 127 jguarin200
                fifo32x26_d                             : out   std_logic_vector (03*width-1 downto 0);          --! Entrada a la cola intermedia para la normalizaci&oacute;n.
43
                fifo32x09_d                             : out   std_logic_vector (02*width-1 downto 0);          --! Entrada a las colas intermedias del producto punto.         
44
                prd32blki                               : out   std_logic_vector ((12*width)-1 downto 0);        --! Entrada de los 12 factores en el bloque de multiplicaci&oacute;n respectivamente.
45
                add32blki                               : out   std_logic_vector ((08*width)-1 downto 0);        --! Entrada de los 8 sumandos del bloque de 4 sumadores.  
46 143 jguarin200
                res567w,res13w,res2w    : out   std_logic;                                                                      --! Salidas de escritura y lectura en las colas de resultados.
47
                res0w,res4w,fifo32x09_w : out   std_logic;
48
                fifo32x23_w,fifo32x09_r : out   std_logic;
49
                fifo32x23_r                             : out   std_logic;
50
                res567f,res13f                  : in    std_logic;                                                                      --! Entradas de la se&ntilde;al de full de las colas de resultados. 
51
                res2f,res0f                             : in    std_logic;
52
                resf                                    : out   std_logic;                                                                      --! Salida decodificada que indica que la cola de resultados de la operaci&oacute;n est&aacute; en curso.
53 140 jguarin200
                resultoutput                    : out   std_logic_vector ((08*width)-1 downto 0)         --! 8 salidas de resultados, pues lo m&aacute;ximo que podr&aacute; calcularse por cada clock son 2 vectores. 
54 122 jguarin200
        );
55 123 jguarin200
end dpc;
56 122 jguarin200
 
57 123 jguarin200
architecture dpc_arch of dpc is
58 125 jguarin200
 
59
        constant qz : integer := 00;constant qy : integer := 01;constant qx : integer := 02;
60 123 jguarin200
        constant az : integer := 00;constant ay : integer := 01;constant ax : integer := 02;constant bz : integer := 03;constant by : integer := 04;constant bx : integer := 05;
61
        constant cz : integer := 06;constant cy : integer := 07;constant cx : integer := 08;constant dz : integer := 09;constant dy : integer := 10;constant dx : integer := 11;
62
        constant f0     : integer := 00;constant f1 : integer := 01;constant f2 : integer := 02;constant f3 : integer := 03;constant f4 : integer := 04;constant f5 : integer := 05;
63
        constant f6     : integer := 06;constant f7 : integer := 07;constant f8 : integer := 08;constant f9 : integer := 09;constant f10: integer := 10;constant f11: integer := 11;
64
        constant s0     : integer := 00;constant s1 : integer := 01;constant s2 : integer := 02;constant s3 : integer := 03;constant s4 : integer := 04;constant s5 : integer := 05;
65 127 jguarin200
        constant s6     : integer := 06;constant s7 : integer := 07;
66
        constant a0     : integer := 00;constant a1 : integer := 01;constant a2 : integer := 02;constant aa : integer := 03;
67 123 jguarin200
        constant p0     : integer := 00;constant p1 : integer := 01;constant p2 : integer := 02;constant p3 : integer := 03;constant p4 : integer := 04;constant p5 : integer := 05;
68 127 jguarin200
 
69 124 jguarin200
        constant dpfifoab : integer := 00;
70
        constant dpfifocd : integer := 01;
71
 
72 122 jguarin200
 
73 123 jguarin200
        type    vectorblock12 is array (11 downto 0) of std_logic_vector(width-1 downto 0);
74 127 jguarin200
        type    vectorblock08 is array (07 downto 0) of std_logic_vector(width-1 downto 0);
75 123 jguarin200
        type    vectorblock06 is array (05 downto 0) of std_logic_vector(width-1 downto 0);
76 127 jguarin200
        type    vectorblock04 is array (03 downto 0) of std_logic_vector(width-1 downto 0);
77 124 jguarin200
        type    vectorblock03 is array (02 downto 0) of std_logic_vector(width-1 downto 0);
78 123 jguarin200
        type    vectorblock02 is array (01 downto 0) of std_logic_vector(width-1 downto 0);
79 122 jguarin200
 
80 127 jguarin200
 
81 143 jguarin200
 
82 127 jguarin200
        signal sparaminput,sfactor                      : vectorblock12;
83
        signal ssumando,sresult                         : vectorblock08;
84
        signal sprd32blk                                        : vectorblock06;
85
        signal sadd32blk                                        : vectorblock04;
86 125 jguarin200
        signal snormfifo_q,snormfifo_d          : vectorblock03;
87 127 jguarin200
        signal sdpfifo_q                                        : vectorblock02;
88
        signal ssqr32blk,sinv32blk                      : std_logic_vector(width-1 downto 0);
89 142 jguarin200
        signal ssync_chain                                      : std_logic_vector(28 downto 0);
90 143 jguarin200
        signal ssync_chain_d                            : std_logic;
91
 
92
 
93 140 jguarin200
        constant rstMasterValue : std_logic := '0';
94
 
95 123 jguarin200
begin
96 122 jguarin200
 
97 142 jguarin200
        --! Cadena de sincronizaci&oacute;n: 29 posiciones.
98
        ssync_chain_d <= sync_chain_d;
99 140 jguarin200
        sync_chain_proc:
100
        process(clk,rst)
101
        begin
102
                if rst=rstMasterValue then
103 142 jguarin200
                        ssync_chain <= (others => '0');
104 140 jguarin200
                elsif clk'event and clk='1' then
105 142 jguarin200
                        ssync_chain(0) <= ssync_chain_d;
106
                        for i in 28 downto 1 loop
107
                                ssync_chain(i) <= ssync_chain(i-1);
108 140 jguarin200
                        end loop;
109
                end if;
110
        end process sync_chain_proc;
111
        --! Escritura en las colas de resultados y escritura/lectura en las colas intermedias mediante cadena de resultados.
112 143 jguarin200
        fifo32x09_w <= ssync_chain(5);
113
        fifo32x23_w <= ssync_chain(1);
114
        fifo32x09_r <= ssync_chain(13);
115
        fifo32x23_r <= ssync_chain(24);
116
        res0w <= ssync_chain(23);
117
        res4w <= ssync_chain(21);
118 140 jguarin200
        sync_chain_comb:
119 142 jguarin200
        process (ssync_chain,addsub,crossprod,unary)
120 140 jguarin200
        begin
121
                if unary='1' then
122 143 jguarin200
                        res567w <= ssync_chain(28);
123 140 jguarin200
                else
124 143 jguarin200
                        res567w <= ssync_chain(4);
125 140 jguarin200
                end if;
126 127 jguarin200
 
127 140 jguarin200
                if addsub='1' then
128 143 jguarin200
                        res13w <= ssync_chain(9);
129
                        res2w <= ssync_chain(9);
130 140 jguarin200
                else
131 143 jguarin200
                        res13w <= ssync_chain(13);
132 140 jguarin200
                        if crossprod='1' then
133 143 jguarin200
                                res2w <= ssync_chain(13);
134 140 jguarin200
                        else
135 143 jguarin200
                                res2w <= ssync_chain(22);
136 140 jguarin200
                        end if;
137
                end if;
138
        end process sync_chain_comb;
139
 
140
 
141
        --! El siguiente c&oacute;digo sirve para conectar arreglos a se&ntilde;ales std_logic_1164, simplemente son abstracciones a nivel de c&oacute;digo y no representar&aacute; cambios en la s&iacute;ntesis.
142 123 jguarin200
        stuff12:
143
        for i in 11 downto 0 generate
144
                sparaminput(i) <= paraminput(i*width+width-1 downto i*width);
145
                prd32blki(i*width+width-1 downto i*width) <= sfactor(i);
146 127 jguarin200
        end generate stuff12;
147
        stuff08:
148
        for i in 07 downto 0 generate
149 123 jguarin200
                add32blki(i*width+width-1 downto i*width) <= ssumando(i);
150 127 jguarin200
                resultoutput(i*width+width-1 downto i*width) <= sresult(i);
151
        end generate stuff08;
152 138 jguarin200
        stuff04:
153
        for i in 03 downto 1 generate
154
                sadd32blk(i)  <= add32blko(i*width+width-1 downto i*width);
155
        end generate stuff04;
156
 
157
 
158 124 jguarin200
        stuff03:
159
        for i in 02 downto 0 generate
160 138 jguarin200
                snormfifo_q(i) <= fifo32x23_q(i*width+width-1 downto i*width);
161 124 jguarin200
                fifo32x26_d(i*width+width-1 downto i*width) <= snormfifo_d(i);
162
        end generate stuff03;
163
 
164 123 jguarin200
        stuff02:
165 127 jguarin200
        for i in 01 downto 0 generate
166
                sdpfifo_q(i)  <= fifo32x09_q(i*width+width-1 downto i*width);
167 123 jguarin200
        end generate stuff02;
168 140 jguarin200
 
169
        --! 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. 
170
        register_products_outputs:
171
        process (clk)
172
        begin
173
                if clk'event and clk='1' then
174
                        for i in 05 downto 0 loop
175
                                sprd32blk(i)  <= prd32blko(i*width+width-1 downto i*width);
176
                        end loop;
177
                end if;
178
        end process;
179
        --! Los productos del multiplicador 2 y 3, ya registrados dentro de dpc van a la cola intermedia del producto punto (fifo32x09_d)
180 124 jguarin200
        fifo32x09_d <= sprd32blk(p3)&sprd32blk(p2);
181 140 jguarin200
        register_adder0_and_inversor_output:
182
        process (clk)
183
        begin
184
                if clk'event and clk='1' then
185
                        sadd32blk(a0)  <= add32blko(a0*width+width-1 downto a0*width);
186
                        sinv32blk <= inv32blko;
187
                end if;
188
        end process;
189 122 jguarin200
 
190 127 jguarin200
 
191
 
192 140 jguarin200
 
193
 
194 127 jguarin200
        ssqr32blk <= sqr32blko;
195
 
196 136 jguarin200
        --! Colas de salida de los distintos resultados;
197 127 jguarin200
        sresult(0) <= ssqr32blk;
198
        sresult(1) <= sadd32blk(a0);
199
        sresult(2) <= sadd32blk(a1);
200
        sresult(3) <= sadd32blk(a2);
201
        sresult(4) <= sadd32blk(aa);
202
        sresult(5) <= sprd32blk(p3);
203
        sresult(6) <= sprd32blk(p4);
204
        sresult(7) <= sprd32blk(p5);
205
 
206
        --! Cola de normalizacion
207
        snormfifo_d(qx) <= sparaminput(ax);
208
        snormfifo_d(qy) <= sparaminput(ay);
209
        snormfifo_d(qz) <= sparaminput(az);
210
 
211
 
212
 
213 136 jguarin200
        --! La entrada al inversor SIEMPRE viene con la salida de la raiz cuadrada
214
        inv32blki <= sqr32blko;
215 139 jguarin200
        --! La entrada de la ra�z cuadrada SIEMPRE viene con la salida del sumador 1.
216 136 jguarin200
        sqr32blki <= sadd32blk(a1);
217 127 jguarin200
 
218
 
219 136 jguarin200
 
220
        --! Conectar las entradas del sumador a, a la salida 
221
        ssumando(s6) <= sadd32blk(a2);
222
        ssumando(s7) <= sdpfifo_q(dpfifocd);
223
 
224
 
225 143 jguarin200
        fullQ:process(res0f,res13f,res2f,res567f,unary,crossprod,addsub)
226
        begin
227
                if unary='0' then
228
                        if crossprod='1' or addsub='1' then
229
                                resf <= res13f;
230
                        else
231
                                resf <= res2f;
232
                        end if;
233
                elsif crossprod='1' or addsub='1' then
234
                        resf <= res567f;
235
                else
236
                        resf <= res0f;
237
                end if;
238
        end process;
239
 
240
 
241 142 jguarin200
        mul:process(unary,addsub,crossprod,sparaminput,sinv32blk,sprd32blk,sadd32blk,sdpfifo_q,snormfifo_q)
242 123 jguarin200
        begin
243 124 jguarin200
 
244 142 jguarin200
                sfactor(f4) <= sparaminput(az);
245 127 jguarin200
                if unary='1' then
246
                        --! Magnitud y normalizacion
247
                        sfactor(f0) <= sparaminput(ax);
248
                        sfactor(f1) <= sparaminput(ax);
249
                        sfactor(f2) <= sparaminput(ay);
250
                        sfactor(f3) <= sparaminput(ay);
251 142 jguarin200
 
252 127 jguarin200
                        sfactor(f5) <= sparaminput(az);
253 142 jguarin200
                        if crossprod='1' and addsub='1' then
254
                                sfactor(f6) <= sparaminput(cx);
255
                                sfactor(f7) <= sparaminput(dx);
256
                                sfactor(f8) <= sparaminput(cy);
257
                                sfactor(f9) <= sparaminput(dx);
258
                                sfactor(f10) <= sparaminput(cz);
259
                                sfactor(f11) <= sparaminput(dx);
260
                        else
261
                                sfactor(f6) <= snormfifo_q(ax);
262
                                sfactor(f7) <= sinv32blk;
263
                                sfactor(f8) <= snormfifo_q(ay);
264
                                sfactor(f9) <= sinv32blk;
265
                                sfactor(f10) <= snormfifo_q(az);
266
                                sfactor(f11) <= sinv32blk;
267
                        end if;
268
 
269
 
270
                elsif addsub='0' then
271
                        --! Solo productos punto o cruz
272
                        if crossprod='1' then
273
 
274
                                sfactor(f0) <= sparaminput(ay);
275
                                sfactor(f1) <= sparaminput(bz);
276
                                sfactor(f2) <= sparaminput(az);
277
                                sfactor(f3) <= sparaminput(by);
278
 
279
                                sfactor(f5) <= sparaminput(bx);
280
                                sfactor(f6) <= sparaminput(ax);
281
                                sfactor(f7) <= sparaminput(bz);
282
                                sfactor(f8) <= sparaminput(ax);
283
                                sfactor(f9) <= sparaminput(by);
284
                                sfactor(f10) <= sparaminput(ay);
285
                                sfactor(f11) <= sparaminput(bx);
286
 
287
                        else
288
 
289
                                sfactor(f0) <=  sparaminput(ax) ;
290
                                sfactor(f1) <=  sparaminput(bx) ;
291
                                sfactor(f2) <=  sparaminput(ay) ;
292
                                sfactor(f3) <=  sparaminput(by) ;
293
                                sfactor(f5) <=  sparaminput(bz) ;
294
                                sfactor(f6) <=  sparaminput(cx) ;
295
                                sfactor(f7) <=  sparaminput(dx) ;
296
                                sfactor(f8) <=  sparaminput(cy) ;
297
                                sfactor(f9) <=  sparaminput(dy) ;
298
                                sfactor(f10) <= sparaminput(cz) ;
299
                                sfactor(f11) <= sparaminput(dz) ;
300
                        end if;
301
 
302 127 jguarin200
                else
303
                        sfactor(f0) <=  sparaminput(ax) ;
304
                        sfactor(f1) <=  sparaminput(bx) ;
305
                        sfactor(f2) <=  sparaminput(ay) ;
306
                        sfactor(f3) <=  sparaminput(by) ;
307
                        sfactor(f5) <=  sparaminput(bz) ;
308
                        sfactor(f6) <=  sparaminput(cx) ;
309
                        sfactor(f7) <=  sparaminput(dx) ;
310
                        sfactor(f8) <=  sparaminput(cy) ;
311
                        sfactor(f9) <=  sparaminput(dx) ;
312
                        sfactor(f10) <= sparaminput(cz) ;
313
                        sfactor(f11) <= sparaminput(dx) ;
314 125 jguarin200
                end if;
315 127 jguarin200
 
316 136 jguarin200
 
317 127 jguarin200
                if addsub='1' then
318
                        ssumando(s0) <= sparaminput(ax);
319
                        ssumando(s1) <= sparaminput(bx);
320
                        ssumando(s2) <= sparaminput(ay);
321
                        ssumando(s3) <= sparaminput(by);
322
                        ssumando(s4) <= sparaminput(az);
323
                        ssumando(s5) <= sparaminput(bz);
324
                else
325
                        ssumando(s0) <= sprd32blk(p0);
326
                        ssumando(s1) <= sprd32blk(p1);
327 132 jguarin200
                        if crossprod='0' then
328
                                ssumando(s2) <= sadd32blk(a0);
329
                                ssumando(s3) <= sdpfifo_q(dpfifoab);
330
                        else
331
                                ssumando(s2) <= sprd32blk(p2);
332
                                ssumando(s3) <= sprd32blk(p3);
333
                        end if;
334 127 jguarin200
                        ssumando(s4) <= sprd32blk(p4);
335
                        ssumando(s5) <= sprd32blk(p5);
336
                end if;
337 123 jguarin200
        end process;
338
 
339
 
340 127 jguarin200
 
341
 
342
--      interconnection:process(instr3,hblockslab,abblockslab,cdblockslab,sparaminput,sprd32blk,sadd32blk,sdpfifo_q)
343
--      begin
344
--              --! La cola para la normalizacion de los vectores.
345
--              snormfifo_d(qx) <= (hblockslab and ((cdblockslab and sparaminput(dx))or(not(cdblockslab) and sparaminput(cx)))) or (not(hblockslab) and ((abblockslab and sparaminput(bx))or(not(abblockslab) and sparaminput(ax))));
346
--              snormfifo_d(qy) <= (hblockslab and ((cdblockslab and sparaminput(dy))or(not(cdblockslab) and sparaminput(cy)))) or (not(hblockslab) and ((abblockslab and sparaminput(by))or(not(abblockslab) and sparaminput(ay))));
347
--              snormfifo_d(qz) <= (hblockslab and ((cdblockslab and sparaminput(dz))or(not(cdblockslab) and sparaminput(cz)))) or (not(hblockslab) and ((abblockslab and sparaminput(bz))or(not(abblockslab) and sparaminput(az))));
348
--      
349
--              --! Combinatorio para decidir que operaciones realizan los sumadores / restadores.
350
--              add32blks <= (instr3(0) xor (instr3(1) xor instr3(0)))&(instr3(0) xor (instr3(1) xor instr3(0))) ;
351
--              
352
--              --! Por defecto conectar los sumandos en producto punto/cruz
353
--              ssumando(s0) <= sprd32blk(p0);ssumando(s1) <= sprd32blk(p1);
354
--              ssumando(s6) <= sadd32blk(a0);ssumando(s7) <= sdpfifo_q(dpfifoab);
355
--              ssumando(s10) <= sdpfifo_q(dpfifocd);ssumando(s11) <= sadd32blk(a2);
356
--              ssumando(s4) <= sprd32blk(p4);ssumando(s5) <= sprd32blk(p5);
357
--              ssumando(s2) <= sprd32blk(p2);ssumando(s3) <= sprd32blk(p3);
358
--              
359
--              --! El segundo sumador del segundo bloque siempre sera suma o resta independiente de la operacion
360
--              ssumando(s8) <= sparaminput(cy);ssumando(s9) <= sparaminput(dy);        
361
--
362
--              --! Por defecto conectar los factores en producto punto
363
--              sfactor(f0) <= sparaminput(ax);sfactor(f1) <= sparaminput(bx);
364
--              sfactor(f2) <= sparaminput(ay);sfactor(f3) <= sparaminput(by);
365
--              sfactor(f4) <= sparaminput(az);sfactor(f5) <= sparaminput(bz);
366
--              sfactor(f6) <= sparaminput(bx);sfactor(f7) <= sparaminput(dx);
367
--              sfactor(f8) <= sparaminput(by);sfactor(f9) <= sparaminput(dy);
368
--              sfactor(f10) <= sparaminput(bz);sfactor(f11) <= sparaminput(dz);
369
--              
370
--              --!Los resultados por defecto se acomodan al producto punto y parcialmente a los productos simple y escalar.
371
--              sresult(ax) <= sadd32blk(aa);
372
--              sresult(ay) <= sprd32blk(p1);
373
--              sresult(az) <= sprd32blk(p2);
374
--              sresult(bx) <= sadd32blk(ac);
375
--              sresult(by) <= sprd32blk(p4);
376
--              sresult(bz) <= sprd32blk(p5);
377
--              
378
--              if (instr3(2 downto 1)="11" or instr3="100") then
379
--                      sresult(ax) <= sprd32blk(p0);
380
--                      sresult(bx) <= sprd32blk(p3);
381
--              elsif instr3(0)='1' then
382
--                      sresult(ax) <= sprd32blk(a0);
383
--                      sresult(ay) <= sprd32blk(a1);
384
--                      sresult(az) <= sprd32blk(a2);
385
--                      sresult(bx) <= sadd32blk(aa);
386
--                      sresult(by) <= sprd32blk(ab);
387
--                      sresult(bz) <= sadd32blk(ac);
388
--              elsif instr3(1)='1' then
389
--                      sresult(ax) <= ssqr32blk(sqrt320);
390
--                      sresult(bx) <= ssqr32blk(sqrt321);
391
--              end if;
392
--                      
393
--
394
--              if instr3(0)='1' then   --! Producto Cruz, suma, resta, multiplicacion simple
395
--
396
--                      if (instr3(2) or instr3(1))='1' then --! Suma, Resta, Multiplicacion simple
397
--                              
398
--                              --! Conectar las entradas de los sumadores en suma o resta de vectores 
399
--                              ssumando(s0) <= sparaminput(ax);ssumando(s1) <= sparaminput(bx);
400
--                              ssumando(s2) <= sparaminput(ay);ssumando(s3) <= sparaminput(by);
401
--                              ssumando(s4) <= sparaminput(az);ssumando(s5) <= sparaminput(bz);
402
--                              ssumando(s6) <= sparaminput(cx);ssumando(s7) <= sparaminput(dx);                                
403
--                              ssumando(s10) <= sparaminput(cz);ssumando(s11) <= sparaminput(dz);
404
--                      
405
--                      else --! Producto Cruz!
406
--                              
407
--                              if hblock='1' then      --! Producto crux CxD 
408
--                                      --!Multiplicadores: 
409
--                                      sfactor(f0) <= sparaminput(cy);sfactor(f1) <= sparaminput(dz);sfactor(f2) <= sparaminput(cz);sfactor(f3) <= sparaminput(dy);
410
--                                      sfactor(f4) <= sparaminput(cx);sfactor(f5) <= sparaminput(dz);sfactor(f6) <= sparaminput(cz);sfactor(f7) <= sparaminput(dx);
411
--                                      sfactor(f8) <= sparaminput(cx);sfactor(f9) <= sparaminput(dy);sfactor(f10) <= sparaminput(cy);sfactor(f11) <= sparaminput(dx);
412
--                              else                            --! Producto crux AxD
413
--                                      --!Multiplicadores:                                     
414
--                                      sfactor(f0) <= sparaminput(ay);sfactor(f1) <= sparaminput(bz);sfactor(f2) <= sparaminput(az);sfactor(f3) <= sparaminput(by);
415
--                                      sfactor(f4) <= sparaminput(ax);sfactor(f5) <= sparaminput(bz);sfactor(f6) <= sparaminput(az);sfactor(f7) <= sparaminput(bx);
416
--                                      sfactor(f8) <= sparaminput(ax);sfactor(f9) <= sparaminput(by);sfactor(f10) <= sparaminput(ay);sfactor(f11) <= sparaminput(bx);
417
--                              end if;
418
--
419
--                      end if;
420
--
421
--              else                                    --! Producto Punto, magnitud, producto escalar y normalizacion  
422
--                      if instr3(2)='1' then           --!Producto Escalar (INSTR3(1)=0) o Normalizacion (INSTR3(1)=1) 
423
--                              
424
--                              sfactor(f0) <= (not instr31slab and sparaminput(ax)) or (instr31slab and ((not(hblockslab) and ((not(abblockslab) and sparaminput(ax)) or(abblockslab and sparaminput(bx))))or( hblockslab and snormfifo_q(qx)) ) );
425
--                              sfactor(f1) <= (not instr31slab and sparaminput(bx)) or (instr31slab and ((not(hblockslab) and ((not(abblockslab) and sparaminput(ax)) or(abblockslab and sparaminput(bx))))or( hblockslab and sinv32blk(invr321)) ) );
426
--                              sfactor(f2) <= (not instr31slab and sparaminput(ay)) or (instr31slab and ((not(hblockslab) and ((not(abblockslab) and sparaminput(ay)) or(abblockslab and sparaminput(by))))or( hblockslab and snormfifo_q(qy)) ) );
427
--                              sfactor(f3) <= (not instr31slab and sparaminput(bx)) or (instr31slab and ((not(hblockslab) and ((not(abblockslab) and sparaminput(ay)) or(abblockslab and sparaminput(by))))or( hblockslab and sinv32blk(invr321)) ) );
428
--                              sfactor(f4) <= (not instr31slab and sparaminput(az)) or (instr31slab and ((not(hblockslab) and ((not(abblockslab) and sparaminput(az)) or(abblockslab and sparaminput(bz))))or( hblockslab and snormfifo_q(qz)) ) );
429
--                              sfactor(f5) <= (not instr31slab and sparaminput(bx)) or (instr31slab and ((not(hblockslab) and ((not(abblockslab) and sparaminput(az)) or(abblockslab and sparaminput(bz))))or( hblockslab and sinv32blk(invr321)) ) );
430
--                              sfactor(f6) <= (not instr31slab and sparaminput(cx)) or (instr31slab and ((hblockslab and ((not(cdblockslab) and sparaminput(cx)) or(cdblockslab and sparaminput(dx))))or( not(hblockslab) and snormfifo_q(qx)) ) );
431
--                              sfactor(f7) <= (not instr31slab and sparaminput(dx)) or (instr31slab and ((hblockslab and ((not(cdblockslab) and sparaminput(cx)) or(cdblockslab and sparaminput(dx))))or( not(hblockslab) and sinv32blk(invr320)) ) );
432
--                              sfactor(f8) <= (not instr31slab and sparaminput(cy)) or (instr31slab and ((hblockslab and ((not(cdblockslab) and sparaminput(cy)) or(cdblockslab and sparaminput(dy))))or( not(hblockslab) and snormfifo_q(qy)) ) );
433
--                              sfactor(f9) <= (not instr31slab and sparaminput(dx)) or (instr31slab and ((hblockslab and ((not(cdblockslab) and sparaminput(cy)) or(cdblockslab and sparaminput(dy))))or( not(hblockslab) and sinv32blk(invr320)) ) );
434
--                              sfactor(f10) <= (not instr31slab and sparaminput(cz)) or (instr31slab and ((hblockslab and ((not(cdblockslab) and sparaminput(cz)) or(cdblockslab and sparaminput(dz))))or( not(hblockslab) and snormfifo_q(qz)) ) );
435
--                              sfactor(f11) <= (not instr31slab and sparaminput(dx)) or (instr31slab and ((hblockslab and ((not(cdblockslab) and sparaminput(cz)) or(cdblockslab and sparaminput(dz))))or( not(hblockslab) and sinv32blk(invr320)) ) );
436
--                      elsif instr3(1)='1' then        --!Magnitud. El producto punto no se computa porque los factores estan por defecto configurados en producto punto.                              
437
--                              sfactor(f0) <= (not(abblockslab) and sparaminput(ax))or(abblockslab and sparaminput(bx));
438
--                              sfactor(f1) <= (not(abblockslab) and sparaminput(ax))or(abblockslab and sparaminput(bx));
439
--                              sfactor(f2) <= (not(abblockslab) and sparaminput(ay))or(abblockslab and sparaminput(by));
440
--                              sfactor(f3) <= (not(abblockslab) and sparaminput(ay))or(abblockslab and sparaminput(by));
441
--                              sfactor(f4) <= (not(abblockslab) and sparaminput(az))or(abblockslab and sparaminput(bz));
442
--                              sfactor(f5) <= (not(abblockslab) and sparaminput(az))or(abblockslab and sparaminput(bz));
443
--                              sfactor(f6) <= (not(cdblockslab) and sparaminput(cx))or(cdblockslab and sparaminput(dx));
444
--                              sfactor(f7) <= (not(cdblockslab) and sparaminput(cx))or(cdblockslab and sparaminput(dx));
445
--                              sfactor(f8) <= (not(cdblockslab) and sparaminput(cy))or(cdblockslab and sparaminput(dy));
446
--                              sfactor(f9) <= (not(cdblockslab) and sparaminput(cy))or(cdblockslab and sparaminput(dy));
447
--                              sfactor(f10) <= (not(cdblockslab) and sparaminput(cz))or(cdblockslab and sparaminput(dz));
448
--                              sfactor(f11) <= (not(cdblockslab) and sparaminput(cz))or(cdblockslab and sparaminput(dz));
449
--                                      
450
--                      end if;
451
--              end if;
452
--                              
453
--      end process;
454
--      
455
 
456 123 jguarin200
end dpc_arch;

powered by: WebSVN 2.1.0

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