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

Subversion Repositories raytrac

[/] [raytrac/] [trunk/] [uf.vhd] - Blame information for rev 50

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

Line No. Rev Author Line
1 22 jguarin200
--! @file raytrac.vhd
2
--! @brief Descripción del sistema aritmetico usado por raytrac.
3
--! @author Julián Andrés Guarín Reyes.
4 8 jguarin200
-- RAYTRAC
5
-- Author Julian Andres Guarin
6
-- uf.vhd
7
-- This file is part of raytrac.
8
-- 
9
--     raytrac is free software: you can redistribute it and/or modify
10
--     it under the terms of the GNU General Public License as published by
11
--     the Free Software Foundation, either version 3 of the License, or
12
--     (at your option) any later version.
13
-- 
14
--     raytrac is distributed in the hope that it will be useful,
15
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
16
--     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
--     GNU General Public License for more details.
18
-- 
19
--     You should have received a copy of the GNU General Public License
20
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>.
21
 
22 22 jguarin200
--! Libreria de definicion de senales y tipos estandares, comportamiento de operadores aritmeticos y logicos.\n Signal and types definition library. This library also defines 
23 2 jguarin200
library ieee;
24 22 jguarin200
--! Paquete de definicion estandard de logica. Standard logic definition pack.
25 2 jguarin200
use ieee.std_logic_1164.all;
26 27 jguarin200
 
27
--! Paquete para el manejo de aritmŽtica con signo sobre el tipo std_logic_vector 
28
use ieee.std_logic_signed.all;
29
 
30 50 jguarin200
--! Paquete estandar de texto
31
use std.textio.all;
32
 
33 22 jguarin200
--! Se usaran en esta descripcion los componentes del package arithpack.vhd.\n It will be used in this description the components on the arithpack.vhd package. 
34 2 jguarin200
use work.arithpack.all;
35
 
36 22 jguarin200
 
37
--! uf es la descripción del circuito que realiza la aritmética del Rt Engine.
38
 
39
--! La entrada opcode indica la operación que se está realizando, en los sumadores, es la misma señal que se encuentra en la entidad opcoder, que selecciona si se está realizando un producto punto o un producto cruz. Dentro de la arquitectura de uf, la señal opcode selecciona en la primera etapa de sumadores, si la operación a realizar será una resta o una suma. 
40
--! Los resultados estarán en distintas salidas dependiendo de la operación, lo cual es apenas natural: El producto cruz tiene por resultado un vector, mientras que el producto punto tiene por resultado un escalar. 
41
--! Esta entidad utiliza las señales de control clk y rst.}
42
--! \n\n
43
--! La característica fundamental de uf, es que puede realizar 2 operaciones de producto punto al mimso tiempo ó una operación de producto cruz al mismo tiempo. La otra característica importante es que el pipe de producto punto es mas largo que el pipe de producto cruz: el producto punto tomará 3 clocks para realizarse, mientras que el procto punto tomara 4 clocks para realizarse.    
44
 
45 27 jguarin200
entity uf is
46
        generic (
47 32 jguarin200
                        use_std_logic_signed : string := "NO";
48 50 jguarin200
                        testbench_generation : string := "NO";
49 32 jguarin200
                        carry_logic : string := "CLA"
50 27 jguarin200
        );
51 2 jguarin200
        port (
52 22 jguarin200
                opcode          : in std_logic; --! Entrada que dentro de la arquitectura funciona como selector de la operación que se lleva a cabo en la primera etapa de sumadores/restadores. 
53
                m0f0,m0f1,m1f0,m1f1,m2f0,m2f1,m3f0,m3f1,m4f0,m4f1,m5f0,m5f1 : in std_logic_vector(17 downto 0); --! Entradas que van conectadas a los multiplicadores en la primera etapa de la descripción.  
54
                cpx,cpy,cpz,dp0,dp1 : out std_logic_vector(31 downto 0); --! Salidas donde se registran los resultados de las operaciones aritméticas: cpx,cpy,cpz serán los componentes del vector que da por resultado el producto cruz entre los vectores AxB ó CxD.  
55
                clk,rst         : in std_logic --! Las entradas de control usuales.  
56 2 jguarin200
        );
57
end uf;
58
 
59
architecture uf_arch of uf is
60
 
61 8 jguarin200
        -- Stage 0 signals
62 2 jguarin200
 
63 22 jguarin200
        signal stage0mf00,stage0mf01,stage0mf10,stage0mf11,stage0mf20,stage0mf21,stage0mf30,stage0mf31,stage0mf40,stage0mf41,stage0mf50,stage0mf51 : std_logic_vector(17 downto 0); --! Señales que conectan los operandos seleccionados en opcode a las entradas de los multiplicadores.
64
        signal stage0p0,stage0p1, stage0p2, stage0p3, stage0p4, stage0p5 : std_logic_vector(31 downto 0); --! Señales / buses, con los productos de los multiplicadores. 
65 28 jguarin200
        signal stageMopcode : std_logic; --! Señal de atraso del opcode. Revisar el diagrama de bloques para mayor claridad.
66 2 jguarin200
 
67 8 jguarin200
        --Stage 1 signals 
68 2 jguarin200
 
69 22 jguarin200
        signal stage1p0, stage1p1, stage1p2, stage1p3, stage1p4, stage1p5 : std_logic_vector (31 downto 0); --! Señales provenientes de los productos de la etapa previa de multiplicadores.
70
        signal stage1a0, stage1a1, stage1a2 : std_logic_vector (31 downto 0); --! Señales / buses, con los resultados de los sumadores. 
71 28 jguarin200
        signal stageSRopcode : std_logic; --! Señal proveniente del opcode que selecciona si los sumadores deben ejecutar una resta o una suma dependiendo de la operación que se ejecute en ese momento del pipe.  
72 2 jguarin200
 
73 8 jguarin200
        -- Some support signals
74 22 jguarin200
        signal stage1_internalCarry     : std_logic_vector(2 downto 0); --! Cada uno de los 3 sumadores de la etapa de sumadores está compuesto de una cascada de 2 sumadores Carry Look Ahead: aXhigh y aXlow. El carry out del componente low y el carry in del componente high, se conectará a través de las señales internal carry.   
75
        signal stage2_internalCarry : std_logic_vector(1 downto 0); --! Cada uno de los 2 sumadores de la última etapa de sumadores está compuesto de una cascada de 2 sumadores Carry Look AheadÑ: aXhigh y aXlow. El carry out del componente low y el carry in del componente high, se conectará a través de las señales internal carry.  
76 2 jguarin200
 
77 22 jguarin200
        --Stage 2 signals       
78
        signal stage2a0, stage2a2, stage2a3, stage2a4, stage2p2, stage2p3 : std_logic_vector (31 downto 0); --! Estas señales corresponden a los sumandos derivados de la primera etapa de multiplicadores (stage2p2, stage2p3) y a los sumandos derivados del resultado de las sumas en la primera etapa de sumadores. 
79 8 jguarin200
 
80
 
81
 
82 2 jguarin200
begin
83
 
84 8 jguarin200
        -- Multiplicator Instantiation (StAgE 0)
85 22 jguarin200
        --! Multiplicador 0 
86 50 jguarin200
        m0 : lpm_mult
87
        generic map (
88
                lpm_hint =>  "DEDICATED_MULTIPLIER_CIRCUITRY=YES,MAXIMIZE_SPEED=9",
89
                lpm_pipeline =>  2,
90
                lpm_representation => "SIGNED",
91
                lpm_type => "LPM_MULT",
92
                lpm_widtha => 18,
93
                lpm_widthb => 18,
94
                lpm_widthp => 32
95
        )
96 8 jguarin200
        port map (
97
                aclr    => rst,
98
                clock   => clk,
99 15 jguarin200
                dataa   => stage0mf00,
100
                datab   => stage0mf01,
101
                result  => stage0p0
102 8 jguarin200
        );
103 22 jguarin200
 
104
        --! Multiplicador 1
105 50 jguarin200
        m1 : lpm_mult
106
        generic map (
107
                lpm_hint =>  "DEDICATED_MULTIPLIER_CIRCUITRY=YES,MAXIMIZE_SPEED=9",
108
                lpm_pipeline =>  2,
109
                lpm_representation => "SIGNED",
110
                lpm_type => "LPM_MULT",
111
                lpm_widtha => 18,
112
                lpm_widthb => 18,
113
                lpm_widthp => 32
114
        )
115 8 jguarin200
        port map (
116
                aclr    => rst,
117
                clock   => clk,
118 15 jguarin200
                dataa   => stage0mf10,
119
                datab   => stage0mf11,
120
                result  => stage0p1
121 8 jguarin200
        );
122 22 jguarin200
 
123
        --! Multiplicador 2
124 50 jguarin200
        m2 : lpm_mult
125
        generic map (
126
                lpm_hint =>  "DEDICATED_MULTIPLIER_CIRCUITRY=YES,MAXIMIZE_SPEED=9",
127
                lpm_pipeline =>  2,
128
                lpm_representation => "SIGNED",
129
                lpm_type => "LPM_MULT",
130
                lpm_widtha => 18,
131
                lpm_widthb => 18,
132
                lpm_widthp => 32
133
        )
134 8 jguarin200
        port map (
135
                aclr    => rst,
136
                clock   => clk,
137 15 jguarin200
                dataa   => stage0mf20,
138
                datab   => stage0mf21,
139
                result  => stage0p2
140 8 jguarin200
        );
141 22 jguarin200
 
142
        --! Multiplicador 3
143 50 jguarin200
        m3 : lpm_mult
144
        generic map (
145
                lpm_hint =>  "DEDICATED_MULTIPLIER_CIRCUITRY=YES,MAXIMIZE_SPEED=9",
146
                lpm_pipeline =>  2,
147
                lpm_representation => "SIGNED",
148
                lpm_type => "LPM_MULT",
149
                lpm_widtha => 18,
150
                lpm_widthb => 18,
151
                lpm_widthp => 32
152
        )
153 8 jguarin200
        port map (
154
                aclr    => rst,
155
                clock   => clk,
156 15 jguarin200
                dataa   => stage0mf30,
157
                datab   => stage0mf31,
158
                result  => stage0p3
159 8 jguarin200
        );
160 22 jguarin200
 
161
        --! Multiplicador 4
162 50 jguarin200
        m4 : lpm_mult
163
        generic map (
164
                lpm_hint =>  "DEDICATED_MULTIPLIER_CIRCUITRY=YES,MAXIMIZE_SPEED=9",
165
                lpm_pipeline =>  2,
166
                lpm_representation => "SIGNED",
167
                lpm_type => "LPM_MULT",
168
                lpm_widtha => 18,
169
                lpm_widthb => 18,
170
                lpm_widthp => 32
171
        )
172 8 jguarin200
        port map (
173
                aclr    => rst,
174
                clock   => clk,
175 15 jguarin200
                dataa   => stage0mf40,
176
                datab   => stage0mf41,
177
                result  => stage0p4
178 8 jguarin200
        );
179 22 jguarin200
 
180
        --! Multiplicador 5
181 50 jguarin200
        m5 : lpm_mult
182
        generic map (
183
                lpm_hint =>  "DEDICATED_MULTIPLIER_CIRCUITRY=YES,MAXIMIZE_SPEED=9",
184
                lpm_pipeline =>  2,
185
                lpm_representation => "SIGNED",
186
                lpm_type => "LPM_MULT",
187
                lpm_widtha => 18,
188
                lpm_widthb => 18,
189
                lpm_widthp => 32
190
        )
191 8 jguarin200
        port map (
192
                aclr    => rst,
193
                clock   => clk,
194 15 jguarin200
                dataa   => stage0mf50,
195
                datab   => stage0mf51,
196
                result  => stage0p5
197 8 jguarin200
        );
198
 
199
 
200
 
201 27 jguarin200
        useIeee:
202
        if use_std_logic_signed="YES" generate
203
                -- Adder Instantiation (sTaGe 1)
204
                stage1adderProc:
205 28 jguarin200
                process (stage1p0,stage1p1,stage1p2,stage1p3,stage1p4,stage1p5,stageSRopcode)
206 27 jguarin200
                begin
207 28 jguarin200
                        case (stageSRopcode) is
208 27 jguarin200
                                when '1' =>             -- Cross Product
209
                                        stage1a0 <= stage1p0-stage1p1;
210
                                        stage1a2 <= stage1p4-stage1p5;
211
                                when others =>  -- Dot Product
212
                                        stage1a0 <= stage1p0+stage1p1;
213
                                        stage1a2 <= stage1p4+stage1p5;
214
                        end case;
215
                end process stage1adderProc;
216
                stage1a1 <= stage1p2-stage1p3;  -- This is always going to be a substraction
217
 
218
                -- Adder Instantiation (Stage 2)
219
                stage2a3 <= stage2a0+stage2p2;
220
                stage2a4 <= stage2p3+stage2a2;
221
        end generate useIeee;
222
        dontUseIeee:
223
        if use_std_logic_signed="NO" generate
224
                --! Adder 0, 16 bit carry lookahead low adder.
225
                a0low : adder
226 32 jguarin200
                generic map (16,carry_logic,"YES")      -- Carry Look Ahead Logic (More Gates Used, But Less Time)
227 27 jguarin200
                                                                                -- Yes instantiate Xor gates stage in the adder so we can substract on the opcode signal command.
228 28 jguarin200
                port map        (stage1p0(15 downto 0),stage1p1(15 downto 0),stageSRopcode,'0',stage1a0(15 downto 0),stage1_internalCarry(0));
229 27 jguarin200
                --Adder 0, 16 bit carry lookahead high adder.
230
                a0high : adder
231 32 jguarin200
                generic map (16,carry_logic,"YES")      -- Carry Look Ahead Logic (More Gates Used, But Less Time)
232 27 jguarin200
                                                                                -- Yes instantiate Xor gates stage in the adder so we can substract on the opcode signal command.
233 28 jguarin200
                port map        (stage1p0(31 downto 16),stage1p1(31 downto 16),stageSRopcode,stage1_internalCarry(0),stage1a0(31 downto 16),open);
234 27 jguarin200
                --! Adder 1, 16 bit carry lookahead low adder. 
235
                a1low : adder
236 32 jguarin200
                generic map (16,carry_logic,"YES")      -- Carry Look Ahead Logic (More Gates Used, But Less Time)
237 27 jguarin200
                                                                                -- Yes instantiate Xor gates stage in the adder so we can substract on the opcode signal command.
238
                port map        (stage1p2(15 downto 0),stage1p3(15 downto 0),'1','0',stage1a1(15 downto 0),stage1_internalCarry(1));
239
                --! Adder 1, 16 bit carry lookahead high adder.
240
                a1high : adder
241 32 jguarin200
                generic map (16,carry_logic,"YES")      -- Carry Look Ahead Logic (More Gates Used, But Less Time)
242 27 jguarin200
                                                                                -- Yes instantiate Xor gates stage in the adder so we can substract on the opcode signal command.
243
                port map        (stage1p2(31 downto 16),stage1p3(31 downto 16),'1',stage1_internalCarry(1),stage1a1(31 downto 16),open);
244
                --! Adder 2, 16 bit carry lookahead low adder. 
245
                a2low : adder
246 32 jguarin200
                generic map (16,carry_logic,"YES")      -- Carry Look Ahead Logic (More Gates Used, But Less Time)
247 27 jguarin200
                                                                                -- Yes instantiate Xor gates stage in the adder so we can substract on the opcode signal command.
248 28 jguarin200
                port map        (stage1p4(15 downto 0),stage1p5(15 downto 0),stageSRopcode,'0',stage1a2(15 downto 0),stage1_internalCarry(2));
249 27 jguarin200
                --! Adder 2, 16 bit carry lookahead high adder.
250
                a2high : adder
251 32 jguarin200
                generic map (16,carry_logic,"YES")      -- Carry Look Ahead Logic (More Gates Used, But Less Time)
252 27 jguarin200
                                                                                -- Yes instantiate Xor gates stage in the adder so we can substract on the opcode signal command.
253 28 jguarin200
                port map        (stage1p4(31 downto 16),stage1p5(31 downto 16),stageSRopcode,stage1_internalCarry(2),stage1a2(31 downto 16),open);
254 27 jguarin200
                -- Adder Instantiation (Stage 2)
255
                --! Adder 3, 16 bit carry lookahead low adder. 
256
                a3low : adder
257 32 jguarin200
                generic map (16,carry_logic,"NO")               -- Carry Look Ahead Logic (More Gates Used, But Less Time)
258 27 jguarin200
                                                                                -- Dont instantiate Xor gates stage in the adder.
259
                port map        (stage2a0(15 downto 0),stage2p2(15 downto 0),'0','0',stage2a3(15 downto 0),stage2_internalCarry(0));
260
                --Adder 3, 16 bit carry lookahead high adder.
261
                a3high : adder
262 32 jguarin200
                generic map (16,carry_logic,"NO")               -- Carry Look Ahead Logic (More Gates Used, But Less Time)
263 27 jguarin200
                                                                                -- Dont instantiate Xor gates stage in the adder.
264
                port map        (stage2a0(31 downto 16),stage2p2(31 downto 16),'0',stage2_internalCarry(0),stage2a3(31 downto 16),open);
265
                --! Adder 4, 16 bit carry lookahead low adder. 
266
                a4low : adder
267 32 jguarin200
                generic map (16,carry_logic,"NO")               -- Carry Look Ahead Logic (More Gates Used, But Less Time)
268 27 jguarin200
                                                                                -- Dont instantiate Xor gates stage in the adder.
269
                port map        (stage2p3(15 downto 0),stage2a2(15 downto 0),'0','0',stage2a4(15 downto 0),stage2_internalCarry(1));
270
                --! Adder 4, 16 bit carry lookahead high adder.
271
                a4high : adder
272 32 jguarin200
                generic map (16,carry_logic,"NO")               -- Carry Look Ahead Logic (More Gates Used, But Less Time)
273 27 jguarin200
                                                                                -- Dont instantiate Xor gates stage in the adder.
274
                port map        (stage2p3(31 downto 16),stage2a2(31 downto 16),'0',stage2_internalCarry(1),stage2a4(31 downto 16),open);
275
 
276
        end generate dontUseIeee;
277 8 jguarin200
        -- Incoming from opcoder.vhd signals into pipeline's stage 0.
278 15 jguarin200
        stage0mf00 <= m0f0;
279
        stage0mf01 <= m0f1;
280
        stage0mf10 <= m1f0;
281
        stage0mf11 <= m1f1;
282
        stage0mf20 <= m2f0;
283
        stage0mf21 <= m2f1;
284
        stage0mf30 <= m3f0;
285
        stage0mf31 <= m3f1;
286
        stage0mf40 <= m4f0;
287
        stage0mf41 <= m4f1;
288
        stage0mf50 <= m5f0;
289
        stage0mf51 <= m5f1;
290 8 jguarin200
 
291
        -- Signal sequencing: as the multipliers use registered output and registered input is not necessary to write the sequence of stage 0 signals to stage 1 signals.
292
        -- so the simplistic path is taken: simply connect stage 0 to stage 1 lines. However this would not apply for the opcode signal
293 15 jguarin200
        stage1p0 <= stage0p0;
294
        stage1p1 <= stage0p1;
295
        stage1p2 <= stage0p2;
296
        stage1p3 <= stage0p3;
297
        stage1p4 <= stage0p4;
298
        stage1p5 <= stage0p5;
299 8 jguarin200
 
300
 
301
        --Outcoming to the rest of the system (by the time i wrote this i dont know where this leads to... jeje)
302 15 jguarin200
        cpx <= stage1a0;
303
        cpy <= stage1a1;
304
        cpz <= stage1a2;
305
        dp0 <= stage2a3;
306
        dp1 <= stage2a4;
307 8 jguarin200
 
308
        -- Looking into the design the stage 1 to stage 2 are the sequences pipe stages that must be controlled in this particular HDL.
309 22 jguarin200
        --! Este proceso describe la manera en que se organizan las etapas de pipe.
310 28 jguarin200
        --! Todas las señales internas en las etapas de pipe, en el momento en que la entrada rst alcanza el nivel rstMasterValue, se colocan en '0'. Nótese que, salvo stageMopcode<=stageSRopcode, las señales que vienen desde la entrada hacia los multiplicadores en la etapa 0 y desde la salida de los multiplicadores desde la etapa0 hacia la etapa 1, no están siendo descritas en este proceso, la explicación de es simple: Los multiplicadores que se están instanciado tienen registros a la entrada y la salida, permitiendo así, registrar las entradas y registrar los productos o salidas de los  multiplicadores, hacia la etapa 1 o etapa de sumadores/restadores. 
311 22 jguarin200
 
312
        uf_seq: process (clk,rst)
313 8 jguarin200
        begin
314
 
315
                if rst=rstMasterValue then
316 28 jguarin200
                        stageMopcode    <= '0';
317
                        stageSRopcode   <= '0';
318 3 jguarin200
 
319 15 jguarin200
                        stage2a2 <= (others => '0');
320
                        stage2p3 <= (others => '0');
321
                        stage2p2 <= (others => '0');
322
                        stage2a0 <= (others => '0');
323 8 jguarin200
 
324
                elsif clk'event and clk = '1' then
325
 
326 15 jguarin200
                        stage2a2 <= stage1a2;
327
                        stage2p3 <= stage1p3;
328
                        stage2p2 <= stage1p2;
329
                        stage2a0 <= stage1a0;
330 3 jguarin200
 
331 8 jguarin200
                        -- Opcode control sequence
332 28 jguarin200
                        stageMopcode <= opcode;
333
                        stageSRopcode <= stageMopcode;
334 8 jguarin200
 
335
                end if;
336
        end process uf_seq;
337 15 jguarin200
 
338 50 jguarin200
        --! Codigo generado para realizar test bench
339
        tbgen:
340
        if testbench_generation="YES" generate
341
                tbproc0:
342
                process
343
                        variable buff : line;
344
                        file mbuff : text open write_mode is "TRACE_multiplier_content";
345
                begin
346
                write(buff,string'("UF multipliers test benching"));
347
                writeline(mbuff, buff);
348
                wait for 5 ns;
349
                wait until rst=not(rstMasterValue);
350
                wait until clk='1';
351
                wait for tclk2+tclk4; --! Garantizar la estabilidad de los datos que se van a observar en la salida.
352
                displayRom:
353
                loop
354
                        write (buff,now,unit =>ns);
355
                        write (buff,string'(" "));
356
                        hexwrite_0 (buff,stage1p0(31 downto 0));
357
                        write (buff,string'(" "));
358
                        hexwrite_0 (buff,stage1p1(31 downto 0));
359
                        write (buff,string'(" "));
360
                        hexwrite_0 (buff,stage1p2(31 downto 0));
361
                        write (buff,string'(" "));
362
                        hexwrite_0 (buff,stage1p1(31 downto 0));
363
                        write (buff,string'(" "));
364
                        hexwrite_0 (buff,stage1p4(31 downto 0));
365
                        write (buff,string'(" "));
366
                        hexwrite_0 (buff,stage1p5(31 downto 0));
367
                        writeline(mbuff,buff);
368
                        wait for tclk;
369
                end loop displayRom;
370
                end process tbproc0;
371
                tbproc1:
372
                process
373
                        variable buff : line;
374
                        file fbuff : text open write_mode is "TRACE_decoded_factors_content";
375
                begin
376
 
377
                        write(buff,string'("UF factors decoded test benching"));
378
                        writeline(fbuff, buff);
379
                        wait for 5 ns;
380
                        wait until rst=not(rstMasterValue);
381
                        wait until clk='1';
382
                        wait for tclk2+tclk4; --! Garantizar la estabilidad de los datos que se van a observar en la salida.
383
                        displayRom:
384
                        loop
385
                                write (buff,now,unit =>ns);
386
                                write (buff,string'(" {"));
387
                                hexwrite_0 (buff,m0f0(17 downto 0));
388
                                hexwrite_0 (buff,m0f1(17 downto 0));
389
                                write (buff,string'("} {"));
390
                                hexwrite_0 (buff,m1f0(17 downto 0));
391
                                hexwrite_0 (buff,m1f1(17 downto 0));
392
                                write (buff,string'("} {"));
393
                                hexwrite_0 (buff,m2f0(17 downto 0));
394
                                hexwrite_0 (buff,m2f1(17 downto 0));
395
                                write (buff,string'("} {"));
396
                                hexwrite_0 (buff,m3f0(17 downto 0));
397
                                hexwrite_0 (buff,m3f1(17 downto 0));
398
                                write (buff,string'("} {"));
399
                                hexwrite_0 (buff,m4f0(17 downto 0));
400
                                hexwrite_0 (buff,m4f1(17 downto 0));
401
                                write (buff,string'("} {"));
402
                                hexwrite_0 (buff,m5f0(17 downto 0));
403
                                hexwrite_0 (buff,m5f1(17 downto 0));
404
                                write (buff,string'("}"));
405
                                writeline(fbuff,buff);
406
                                wait for tclk;
407
                        end loop displayRom;
408
                end process tbproc1;
409
 
410
                tbproc2:
411
                process
412
                        variable buff : line;
413
                        file rbuff : text open write_mode is "TRACE_results_content";
414
                begin
415
 
416
                        write(buff,string'("UF results test benching"));
417
                        writeline(rbuff, buff);
418
                        wait for 5 ns;
419
                        wait until rst=not(rstMasterValue);
420
                        wait until clk='1';
421
                        wait for tclk2+tclk4; --! Garantizar la estabilidad de los datos que se van a observar en la salida.
422
                        displayRom:
423
                        loop
424
                                write (buff,now,unit =>ns);
425
                                write (buff,string'(" {"));
426
                                hexwrite_0 (buff,stage1a0(31 downto 0));
427
                                write (buff,string'(" "));
428
                                hexwrite_0 (buff,stage1a1(31 downto 0));
429
                                write (buff,string'(" "));
430
                                hexwrite_0 (buff,stage1a2(31 downto 0));
431
                                write (buff,string'("} {dp0: "));
432
                                hexwrite_0 (buff,stage2a3(31 downto 0));
433
                                write (buff,string'(",dp1: "));
434
                                hexwrite_0 (buff,stage2a4(31 downto 0));
435
                                write (buff,string'("}"));
436
                                writeline(rbuff,buff);
437
                                wait for tclk;
438
                        end loop displayRom;
439
                end process tbproc2;
440
 
441
        end generate tbgen;
442 15 jguarin200
 
443
 
444 50 jguarin200
 
445
 
446 2 jguarin200
end uf_arch;

powered by: WebSVN 2.1.0

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