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

Subversion Repositories raytrac

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

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
 
27
entity arithblock is
28
        port (
29
 
30
                clk     : in std_logic;
31
                rst : in std_logic;
32
 
33
                dpc : in std_logic;
34
 
35
                f       : in std_logic_vector (12*32-1 downto 0);
36
                a       : in std_logic_vector (8*32-1 downto 0);
37
 
38
                s       : out std_logic_vector (4*32-1 downto 0);
39
                p       : out std_logic_vector (6*32-1 downto 0)
40
 
41
        );
42
end entity;
43
 
44
architecture arithblock_arch of arithblock is
45
        component fadd32
46
        port (
47
                clk : in std_logic;
48
                dpc : in std_logic;
49
                a32 : in std_logic_vector (31 downto 0);
50
                b32 : in std_logic_vector (31 downto 0);
51
                c32 : out std_logic_vector (31 downto 0)
52
        );
53
        end component;
54
        component fmul32
55
        port (
56
                clk : in std_logic;
57
                a32 : in std_logic_vector (31 downto 0);
58
                b32 : in std_logic_vector (31 downto 0);
59
                p32 : out std_logic_vector (31 downto 0)
60
        );
61
        end component;
62
begin
63
        --! 4 sumadores.        
64
        arithblock:
65
        for i in 3 downto 0 generate
66
                adder_i : fadd32
67
                port map (
68
                        clk => clk,
69
                        dpc => dpc,
70
                        a32 => a( ((i*2)+1)*32-1        downto (i*2)*32),
71
                        b32 => a( ((i*2)+2)*32-1        downto ((i*2)+1)*32),
72
                        c32 => s( (i+1)*32-1            downto 32*i)
73
                );
74
        end generate arithblock;
75
        --! 6 multiplicadores.
76
        mulblock:
77
        for i in 5 downto 0 generate
78
                mul_i   : fmul32
79
                port map (
80
                        clk => clk,
81
                        a32 => f( ((i*2)+1)*32-1        downto (i*2)*32),
82
                        b32 => f( ((i*2)+2)*32-1        downto ((i*2)+1)*32),
83
                        p32 => p( (i+1)*32-1            downto 32*i)
84
                );
85
        end generate mulblock;
86
end architecture;
87
 
88
 
89
 

powered by: WebSVN 2.1.0

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