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

Subversion Repositories raytrac

[/] [raytrac/] [branches/] [fp_sgdma/] [arith/] [single/] [arithblock.vhd] - Blame information for rev 238

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

Line No. Rev Author Line
1 150 jguarin200
--! @file arithblock.vhd
2
--! @brief Bloque Aritmético de 4 sumadores y 6 multiplicadores. 
3
--! @author Julián Andrés Guarín Reyes
4
--------------------------------------------------------------
5
-- RAYTRAC
6
-- Author Julian Andres Guarin
7
-- memblock.vhd
8
-- 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 206 jguarin200
--     MERCHANTABILITY or FITNESS FOR a PARTICULAR PURPOSE.  See the
18 150 jguarin200
--     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
 
24
library ieee;
25
use ieee.std_logic_1164.all;
26 152 jguarin200
use work.arithpack.all;
27 150 jguarin200
 
28
entity arithblock is
29
        port (
30
 
31
                clk     : in std_logic;
32
                rst : in std_logic;
33
 
34 206 jguarin200
                sign : in std_logic;
35 150 jguarin200
 
36 229 jguarin200
                factor0         : in std_logic_vector(31 downto 0);
37
                factor1         : in std_logic_vector(31 downto 0);
38
                factor2         : in std_logic_vector(31 downto 0);
39
                factor3         : in std_logic_vector(31 downto 0);
40
                factor4         : in std_logic_vector(31 downto 0);
41
                factor5         : in std_logic_vector(31 downto 0);
42
                factor6         : in std_logic_vector(31 downto 0);
43
                factor7         : in std_logic_vector(31 downto 0);
44
                factor8         : in std_logic_vector(31 downto 0);
45
                factor9         : in std_logic_vector(31 downto 0);
46
                factor10        : in std_logic_vector(31 downto 0);
47
                factor11        : in std_logic_vector(31 downto 0);
48
                --factor        : in vectorblock06;
49
 
50
                sumando0        : in std_logic_vector(31 downto 0);
51
                sumando1        : in std_logic_vector(31 downto 0);
52
                sumando2        : in std_logic_vector(31 downto 0);
53
                sumando3        : in std_logic_vector(31 downto 0);
54
                sumando4        : in std_logic_vector(31 downto 0);
55
                sumando5        : in std_logic_vector(31 downto 0);
56
                --add32blki     : in vectorblock06;
57 150 jguarin200
 
58 229 jguarin200
                a0                      : out std_logic_vector(31 downto 0);
59
                a1                      : out std_logic_vector(31 downto 0);
60
                a2                      : out std_logic_vector(31 downto 0);
61
                --add32blko     : out vectorblock03;
62 206 jguarin200
 
63 229 jguarin200
                p0                      : out std_logic_vector(31 downto 0);
64
                p1                      : out std_logic_vector(31 downto 0);
65
                p2                      : out std_logic_vector(31 downto 0);
66
                p3                      : out std_logic_vector(31 downto 0);
67
                p4                      : out std_logic_vector(31 downto 0);
68
                p5                      : out std_logic_vector(31 downto 0);
69
                --p     : out vectorblock06;
70 206 jguarin200
 
71 229 jguarin200
                sq32o           : out std_logic_vector(31 downto 0);
72
                inv32o          : out std_logic_vector(31 downto 0)
73 206 jguarin200
 
74 229 jguarin200
 
75 150 jguarin200
 
76
        );
77
end entity;
78
 
79
architecture arithblock_arch of arithblock is
80 152 jguarin200
 
81 229 jguarin200
        signal sadd32blko_01 : std_logic_vector(31 downto 0);
82
        signal ssq32o : std_logic_vector(31 downto 0);
83 206 jguarin200
 
84 219 jguarin200
        --! Componentes Aritm&eacute;ticos
85 228 jguarin200
        component fadd32long
86 219 jguarin200
        port (
87
                clk : in std_logic;
88
                dpc : in std_logic;
89 229 jguarin200
                a32 : in std_logic_vector(31 downto 0);
90
                b32 : in std_logic_vector(31 downto 0);
91
                c32 : out std_logic_vector(31 downto 0)
92 219 jguarin200
        );
93
        end component;
94
        component fmul32
95
        port (
96
                clk : in std_logic;
97 229 jguarin200
                a32 : in std_logic_vector(31 downto 0);
98
                b32 : in std_logic_vector(31 downto 0);
99
                p32 : out std_logic_vector(31 downto 0)
100 219 jguarin200
        );
101
        end component;
102
        --! Bloque de Raiz Cuadrada
103
        component sqrt32
104
        port (
105
 
106
                clk     : in std_logic;
107 229 jguarin200
                rd32: in std_logic_vector(31 downto 0);
108
                sq32: out std_logic_vector(31 downto 0)
109 219 jguarin200
        );
110
        end component;
111
        --! Bloque de Inversores.
112
        component invr32
113
        port (
114
 
115
                clk             : in std_logic;
116 229 jguarin200
                dvd32   : in std_logic_vector(31 downto 0);
117
                qout32  : out std_logic_vector(31 downto 0)
118 219 jguarin200
        );
119
        end component;
120 152 jguarin200
 
121
 
122 150 jguarin200
begin
123 206 jguarin200
 
124
        sq32o <= ssq32o;
125 229 jguarin200
        a1 <= sadd32blko_01;
126 206 jguarin200
 
127 152 jguarin200
        --!TBXINSTANCESTART
128 228 jguarin200
        adder_i_0 : fadd32long
129 152 jguarin200
        port map (
130
                clk => clk,
131 206 jguarin200
                dpc => sign,
132 229 jguarin200
                a32 => sumando0,
133
                b32 => sumando1,
134
                c32 => a0
135 152 jguarin200
        );
136
        --!TBXINSTANCESTART
137 228 jguarin200
        adder_i_1 : fadd32long
138 152 jguarin200
        port map (
139
                clk => clk,
140 206 jguarin200
                dpc => sign,
141 229 jguarin200
                a32 => sumando2,
142
                b32 => sumando3,
143 219 jguarin200
                c32 => sadd32blko_01
144 152 jguarin200
        );
145
        --!TBXINSTANCESTART
146 228 jguarin200
        adder_i_2 : fadd32long
147 152 jguarin200
        port map (
148
                clk => clk,
149 206 jguarin200
                dpc => sign,
150 229 jguarin200
                a32 => sumando4,
151
                b32 => sumando5,
152
                c32 => a2
153 152 jguarin200
        );
154
        --!TBXINSTANCESTART
155
        mul_i_0 : fmul32
156
        port map (
157
                clk => clk,
158 229 jguarin200
                a32 => factor0,
159
                b32 => factor1,
160
                p32 => p0
161 152 jguarin200
        );
162
        --!TBXINSTANCESTART
163
        mul_i_1 : fmul32
164
        port map (
165
                clk => clk,
166 229 jguarin200
                a32 => factor2,
167
                b32 => factor3,
168
                p32 => p1
169 152 jguarin200
        );
170
        --!TBXINSTANCESTART
171
        mul_i_2 : fmul32
172
        port map (
173
                clk => clk,
174 229 jguarin200
                a32 => factor4,
175
                b32 => factor5,
176
                p32 => p2
177 152 jguarin200
        );
178
        --!TBXINSTANCESTART
179
        mul_i_3 : fmul32
180
        port map (
181
                clk => clk,
182 229 jguarin200
                a32 => factor6,
183
                b32 => factor7,
184
                p32 => p3
185 152 jguarin200
        );
186
        --!TBXINSTANCESTART
187
        mul_i_4 : fmul32
188
        port map (
189
                clk => clk,
190 229 jguarin200
                a32 => factor8,
191
                b32 => factor9,
192
                p32 => p4
193 152 jguarin200
        );
194
        --!TBXINSTANCESTART
195
        mul_i_5 : fmul32
196
        port map (
197
                clk => clk,
198 229 jguarin200
                a32 => factor10,
199
                b32 => factor11,
200
                p32 => p5
201 152 jguarin200
        );
202 206 jguarin200
        --!TBXINSTANCESTART
203
        square_root : sqrt32
204
        port map (
205
                clk     => clk,
206
                rd32    => sadd32blko_01,
207
                sq32    => ssq32o
208
        );
209
        --!TBXINSTANCESTART
210
        inversion_block : invr32
211
        port map (
212
                clk             => clk,
213
                dvd32   => ssq32o,
214
                qout32  => inv32o
215
        );
216 152 jguarin200
 
217
 
218
 
219 206 jguarin200
 
220
 
221 150 jguarin200
end architecture;
222
 
223
 
224
 

powered by: WebSVN 2.1.0

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