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

Subversion Repositories raytrac

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

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 158 jguarin200
                f       : in vectorblock12;
37
                a       : in vectorblock08;
38 150 jguarin200
 
39 158 jguarin200
                s       : out vectorblock04;
40
                p       : out vectorblock06
41 150 jguarin200
 
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 158 jguarin200
                a32 => a(0),
80
                b32 => a(1),
81
                c32 => s(0)
82 152 jguarin200
        );
83
        --!TBXINSTANCESTART
84
        adder_i_1 : fadd32
85
        port map (
86
                clk => clk,
87
                dpc => dpc,
88 158 jguarin200
                a32 => a(2),
89
                b32 => a(3),
90
                c32 => s(1)
91 152 jguarin200
        );
92
        --!TBXINSTANCESTART
93
        adder_i_2 : fadd32
94
        port map (
95
                clk => clk,
96
                dpc => dpc,
97 158 jguarin200
                a32 => a(4),
98
                b32 => a(5),
99
                c32 => s(2)
100 152 jguarin200
        );
101
        --!TBXINSTANCESTART
102
        adder_i_3 : fadd32
103
        port map (
104
                clk => clk,
105
                dpc => dpc,
106 158 jguarin200
                a32 => a(6),
107
                b32 => a(7),
108
                c32 => s(3)
109 152 jguarin200
        );
110
        --!TBXINSTANCESTART
111
        mul_i_0 : fmul32
112
        port map (
113
                clk => clk,
114 158 jguarin200
                a32 => f(0),
115
                b32 => f(1),
116
                p32 => p(0)
117 152 jguarin200
        );
118
        --!TBXINSTANCESTART
119
        mul_i_1 : fmul32
120
        port map (
121
                clk => clk,
122 158 jguarin200
                a32 => f(2),
123
                b32 => f(3),
124
                p32 => p(1)
125 152 jguarin200
        );
126
        --!TBXINSTANCESTART
127
        mul_i_2 : fmul32
128
        port map (
129
                clk => clk,
130 158 jguarin200
                a32 => f(4),
131
                b32 => f(5),
132
                p32 => p(2)
133 152 jguarin200
        );
134
        --!TBXINSTANCESTART
135
        mul_i_3 : fmul32
136
        port map (
137
                clk => clk,
138 158 jguarin200
                a32 => f(6),
139
                b32 => f(7),
140
                p32 => p(3)
141 152 jguarin200
        );
142
        --!TBXINSTANCESTART
143
        mul_i_4 : fmul32
144
        port map (
145
                clk => clk,
146 158 jguarin200
                a32 => f(8),
147
                b32 => f(9),
148
                p32 => p(4)
149 152 jguarin200
        );
150
        --!TBXINSTANCESTART
151
        mul_i_5 : fmul32
152
        port map (
153
                clk => clk,
154 158 jguarin200
                a32 => f(10),
155
                b32 => f(11),
156
                p32 => p(5)
157 152 jguarin200
        );
158
 
159
 
160
 
161 150 jguarin200
end architecture;
162
 
163
 
164
 

powered by: WebSVN 2.1.0

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