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

Subversion Repositories raytrac

[/] [raytrac/] [branches/] [fp/] [arithblock.vhd] - Blame information for rev 152

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
--     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
 
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
                dpc : in std_logic;
35
 
36
                f       : in std_logic_vector (12*32-1 downto 0);
37
                a       : in std_logic_vector (8*32-1 downto 0);
38
 
39
                s       : out std_logic_vector (4*32-1 downto 0);
40
                p       : out std_logic_vector (6*32-1 downto 0)
41
 
42
        );
43
end entity;
44
 
45
architecture arithblock_arch of arithblock is
46 152 jguarin200
 
47
 
48
 
49
 
50 150 jguarin200
begin
51
        --! 4 sumadores.        
52 152 jguarin200
--      arithblock:
53
--      for i in 3 downto 0 generate
54
--              adder_i : fadd32 
55
--              port map (
56
--                      clk => clk,
57
--                      dpc => dpc,
58
--                      a32 => a( ((i*2)+1)*32-1        downto (i*2)*32),
59
--                      b32 => a( ((i*2)+2)*32-1        downto ((i*2)+1)*32),
60
--                      c32 => s( (i+1)*32-1            downto 32*i)
61
--              );
62
--      end generate arithblock;
63 150 jguarin200
        --! 6 multiplicadores.
64 152 jguarin200
--      mulblock:
65
--      for i in 5 downto 0 generate
66
--              mul_i   : fmul32
67
--              port map (
68
--                      clk => clk,
69
--                      a32 => f( ((i*2)+1)*32-1        downto (i*2)*32),
70
--                      b32 => f( ((i*2)+2)*32-1        downto ((i*2)+1)*32),
71
--                      p32 => p( (i+1)*32-1            downto 32*i)
72
--              );
73
--      end generate mulblock;
74
        --!TBXINSTANCESTART
75
        adder_i_0 : fadd32
76
        port map (
77
                clk => clk,
78
                dpc => dpc,
79
                a32 => a( 31    downto 0),
80
                b32 => a( 63    downto 32),
81
                c32 => s( 31    downto 0)
82
        );
83
        --!TBXINSTANCESTART
84
        adder_i_1 : fadd32
85
        port map (
86
                clk => clk,
87
                dpc => dpc,
88
                a32 => a( 95    downto 64),
89
                b32 => a( 127   downto 96),
90
                c32 => s( 63    downto 32)
91
        );
92
        --!TBXINSTANCESTART
93
        adder_i_2 : fadd32
94
        port map (
95
                clk => clk,
96
                dpc => dpc,
97
                a32 => a( 159   downto 128),
98
                b32 => a( 191   downto 160),
99
                c32 => s( 95    downto 64)
100
        );
101
        --!TBXINSTANCESTART
102
        adder_i_3 : fadd32
103
        port map (
104
                clk => clk,
105
                dpc => dpc,
106
                a32 => a( 223   downto 192),
107
                b32 => a( 255   downto 224),
108
                c32 => s( 127   downto 96)
109
        );
110
        --!TBXINSTANCESTART
111
        mul_i_0 : fmul32
112
        port map (
113
                clk => clk,
114
                dpc => dpc,
115
                a32 => a( 95    downto 64),
116
                b32 => a( 127   downto 96),
117
                c32 => s( 63    downto 32)
118
        );
119
        --!TBXINSTANCESTART
120
        mul_i_1 : fmul32
121
        port map (
122
                clk => clk,
123
                dpc => dpc,
124
                a32 => a( 159   downto 128),
125
                b32 => a( 191   downto 160),
126
                c32 => s( 95    downto 64)
127
        );
128
        --!TBXINSTANCESTART
129
        mul_i_2 : fmul32
130
        port map (
131
                clk => clk,
132
                dpc => dpc,
133
                a32 => a( 223   downto 192),
134
                b32 => a( 255   downto 224),
135
                c32 => s( 127   downto 96)
136
        );
137
        --!TBXINSTANCESTART
138
        mul_i_3 : fmul32
139
        port map (
140
                clk => clk,
141
                dpc => dpc,
142
                a32 => a( 95    downto 64),
143
                b32 => a( 127   downto 96),
144
                c32 => s( 63    downto 32)
145
        );
146
        --!TBXINSTANCESTART
147
        mul_i_4 : fmul32
148
        port map (
149
                clk => clk,
150
                dpc => dpc,
151
                a32 => a( 159   downto 128),
152
                b32 => a( 191   downto 160),
153
                c32 => s( 95    downto 64)
154
        );
155
        --!TBXINSTANCESTART
156
        mul_i_5 : fmul32
157
        port map (
158
                clk => clk,
159
                dpc => dpc,
160
                a32 => a( 223   downto 192),
161
                b32 => a( 255   downto 224),
162
                c32 => s( 127   downto 96)
163
        );
164
 
165
 
166
 
167 150 jguarin200
end architecture;
168
 
169
 
170
 

powered by: WebSVN 2.1.0

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