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

Subversion Repositories raytrac

[/] [raytrac/] [branches/] [fp_sgdma/] [arith/] [wide/] [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 238 jguarin200
        --! Altera Compiler Directive, to avoid m9k autoinferring thanks to the guys at http://www.alteraforum.com/forum/archive/index.php/t-30784.html .... 
82
        attribute altera_attribute : string;
83
        attribute altera_attribute of arithblock_arch : architecture is "-name AUTO_SHIFT_REGISTER_RECOGNITION OFF";
84
 
85
 
86 229 jguarin200
        signal sadd32blko_01 : std_logic_vector(31 downto 0);
87
        signal ssq32o : std_logic_vector(31 downto 0);
88 206 jguarin200
 
89 219 jguarin200
        --! Componentes Aritm&eacute;ticos
90 228 jguarin200
        component fadd32long
91 219 jguarin200
        port (
92
                clk : in std_logic;
93
                dpc : in std_logic;
94 229 jguarin200
                a32 : in std_logic_vector(31 downto 0);
95
                b32 : in std_logic_vector(31 downto 0);
96
                c32 : out std_logic_vector(31 downto 0)
97 219 jguarin200
        );
98
        end component;
99
        component fmul32
100
        port (
101 238 jguarin200
                factor0 : in std_logic_vector(31 downto 0);
102
                factor1 : in std_logic_vector(31 downto 0);
103
                factor2 : in std_logic_vector(31 downto 0);
104
                factor3 : in std_logic_vector(31 downto 0);
105
                factor4 : in std_logic_vector(31 downto 0);
106
                factor5 : in std_logic_vector(31 downto 0);
107
                factor6 : in std_logic_vector(31 downto 0);
108
                factor7 : in std_logic_vector(31 downto 0);
109
                factor8 : in std_logic_vector(31 downto 0);
110
                factor9 : in std_logic_vector(31 downto 0);
111
                factor10: in std_logic_vector(31 downto 0);
112
                factor11: in std_logic_vector(31 downto 0);
113
                p0: out std_logic_vector(31 downto 0);
114
                p1: out std_logic_vector(31 downto 0);
115
                p2: out std_logic_vector(31 downto 0);
116
                p3: out std_logic_vector(31 downto 0);
117
                p4: out std_logic_vector(31 downto 0);
118
                p5: out std_logic_vector(31 downto 0);
119
 
120 219 jguarin200
        );
121
        end component;
122
        --! Bloque de Raiz Cuadrada
123
        component sqrt32
124
        port (
125
 
126
                clk     : in std_logic;
127 229 jguarin200
                rd32: in std_logic_vector(31 downto 0);
128
                sq32: out std_logic_vector(31 downto 0)
129 219 jguarin200
        );
130
        end component;
131
        --! Bloque de Inversores.
132
        component invr32
133
        port (
134
 
135
                clk             : in std_logic;
136 229 jguarin200
                dvd32   : in std_logic_vector(31 downto 0);
137
                qout32  : out std_logic_vector(31 downto 0)
138 219 jguarin200
        );
139
        end component;
140 152 jguarin200
 
141
 
142 150 jguarin200
begin
143 206 jguarin200
 
144
        sq32o <= ssq32o;
145 229 jguarin200
        a1 <= sadd32blko_01;
146 206 jguarin200
 
147 152 jguarin200
        --!TBXINSTANCESTART
148 228 jguarin200
        adder_i_0 : fadd32long
149 152 jguarin200
        port map (
150
                clk => clk,
151 206 jguarin200
                dpc => sign,
152 229 jguarin200
                a32 => sumando0,
153
                b32 => sumando1,
154
                c32 => a0
155 152 jguarin200
        );
156
        --!TBXINSTANCESTART
157 228 jguarin200
        adder_i_1 : fadd32long
158 152 jguarin200
        port map (
159
                clk => clk,
160 206 jguarin200
                dpc => sign,
161 229 jguarin200
                a32 => sumando2,
162
                b32 => sumando3,
163 219 jguarin200
                c32 => sadd32blko_01
164 152 jguarin200
        );
165
        --!TBXINSTANCESTART
166 228 jguarin200
        adder_i_2 : fadd32long
167 152 jguarin200
        port map (
168
                clk => clk,
169 206 jguarin200
                dpc => sign,
170 229 jguarin200
                a32 => sumando4,
171
                b32 => sumando5,
172
                c32 => a2
173 152 jguarin200
        );
174
        --!TBXINSTANCESTART
175
        mul_i_0 : fmul32
176
        port map (
177
                clk => clk,
178 238 jguarin200
                factor0 => factor0,
179
                factor1 => factor1,
180
                factor2 => factor2,
181
                factor3 => factor3,
182
                factor4 => factor4,
183
                factor5 => factor5,
184
                factor6 => factor6,
185
                factor7 => factor7,
186
                factor8 => factor8,
187
                factor9 => factor9,
188
                factor10 => factor10,
189
                factor11 => factor11,
190
                p0 => p0,
191
                p1 => p1,
192
                p2 => p2,
193
                p3 => p3,
194
                p4 => p4,
195
                p5 => p5
196 152 jguarin200
        );
197
        --!TBXINSTANCESTART
198 206 jguarin200
        square_root : sqrt32
199
        port map (
200
                clk     => clk,
201
                rd32    => sadd32blko_01,
202
                sq32    => ssq32o
203
        );
204
        --!TBXINSTANCESTART
205
        inversion_block : invr32
206
        port map (
207
                clk             => clk,
208
                dvd32   => ssq32o,
209
                qout32  => inv32o
210
        );
211 152 jguarin200
 
212
 
213
 
214 206 jguarin200
 
215
 
216 150 jguarin200
end architecture;
217
 
218
 
219
 

powered by: WebSVN 2.1.0

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