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

Subversion Repositories raytrac

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

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 153 jguarin200
                a32 => f( 31    downto 0),
115
                b32 => f( 63    downto 32),
116
                p32 => p( 31    downto 0)
117 152 jguarin200
        );
118
        --!TBXINSTANCESTART
119
        mul_i_1 : fmul32
120
        port map (
121
                clk => clk,
122 153 jguarin200
                a32 => f( 95    downto 64),
123
                b32 => f( 127   downto 96),
124
                p32 => p( 63    downto 32)
125 152 jguarin200
        );
126
        --!TBXINSTANCESTART
127
        mul_i_2 : fmul32
128
        port map (
129
                clk => clk,
130 153 jguarin200
                a32 => f( 159   downto 128),
131
                b32 => f( 191   downto 160),
132
                p32 => p( 95    downto 64)
133 152 jguarin200
        );
134
        --!TBXINSTANCESTART
135
        mul_i_3 : fmul32
136
        port map (
137
                clk => clk,
138 153 jguarin200
                a32 => f( 223   downto 192),
139
                b32 => f( 255   downto 224),
140
                p32 => p( 127   downto 96)
141 152 jguarin200
        );
142
        --!TBXINSTANCESTART
143
        mul_i_4 : fmul32
144
        port map (
145
                clk => clk,
146 153 jguarin200
                a32 => f( 287   downto 256),
147
                b32 => f( 319   downto 288),
148
                p32 => p( 159   downto 128)
149 152 jguarin200
        );
150
        --!TBXINSTANCESTART
151
        mul_i_5 : fmul32
152
        port map (
153
                clk => clk,
154 153 jguarin200
                a32 => f( 351   downto 320),
155
                b32 => f( 383   downto 352),
156
                p32 => p( 191   downto 160)
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.