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

Subversion Repositories raytrac

[/] [raytrac/] [branches/] [fp_sgdma/] [arith/] [single/] [arithblock.vhd] - Diff between revs 238 and 256

Only display areas with differences | Details | Blame | View Log

Rev 238 Rev 256
--! @file arithblock.vhd
--! @file arithblock.vhd
--! @brief Bloque Aritmético de 4 sumadores y 6 multiplicadores. 
--! @brief Bloque Aritmético de 4 sumadores y 6 multiplicadores. 
--! @author Julián Andrés Guarín Reyes
--! @author Julián Andrés Guarín Reyes
--------------------------------------------------------------
--------------------------------------------------------------
-- RAYTRAC
-- RAYTRAC
-- Author Julian Andres Guarin
-- Author Julian Andres Guarin
-- memblock.vhd
-- memblock.vhd
-- This file is part of raytrac.
-- This file is part of raytrac.
-- 
-- 
--     raytrac is free software: you can redistribute it and/or modify
--     raytrac is free software: you can redistribute it and/or modify
--     it under the terms of the GNU General Public License as published by
--     it under the terms of the GNU General Public License as published by
--     the Free Software Foundation, either version 3 of the License, or
--     the Free Software Foundation, either version 3 of the License, or
--     (at your option) any later version.
--     (at your option) any later version.
-- 
-- 
--     raytrac is distributed in the hope that it will be useful,
--     raytrac is distributed in the hope that it will be useful,
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
--     MERCHANTABILITY or FITNESS FOR a PARTICULAR PURPOSE.  See the
--     MERCHANTABILITY or FITNESS FOR a PARTICULAR PURPOSE.  See the
--     GNU General Public License for more details.
--     GNU General Public License for more details.
-- 
-- 
--     You should have received a copy of the GNU General Public License
--     You should have received a copy of the GNU General Public License
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>.
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>.
 
 
 
 
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
use work.arithpack.all;
use work.arithpack.all;
 
 
entity arithblock is
entity arithblock is
        port (
        port (
 
 
                clk     : in std_logic;
                clk     : in std_logic;
                rst : in std_logic;
                rst : in std_logic;
 
 
                sign : in std_logic;
                sign : in std_logic;
 
                sign_switch     : in std_logic;
 
 
                factor0         : in std_logic_vector(31 downto 0);
                factor0         : in std_logic_vector(31 downto 0);
                factor1         : in std_logic_vector(31 downto 0);
                factor1         : in std_logic_vector(31 downto 0);
                factor2         : in std_logic_vector(31 downto 0);
                factor2         : in std_logic_vector(31 downto 0);
                factor3         : in std_logic_vector(31 downto 0);
                factor3         : in std_logic_vector(31 downto 0);
                factor4         : in std_logic_vector(31 downto 0);
                factor4         : in std_logic_vector(31 downto 0);
                factor5         : in std_logic_vector(31 downto 0);
                factor5         : in std_logic_vector(31 downto 0);
                factor6         : in std_logic_vector(31 downto 0);
                factor6         : in std_logic_vector(31 downto 0);
                factor7         : in std_logic_vector(31 downto 0);
                factor7         : in std_logic_vector(31 downto 0);
                factor8         : in std_logic_vector(31 downto 0);
                factor8         : in std_logic_vector(31 downto 0);
                factor9         : in std_logic_vector(31 downto 0);
                factor9         : in std_logic_vector(31 downto 0);
                factor10        : in std_logic_vector(31 downto 0);
                factor10        : in std_logic_vector(31 downto 0);
                factor11        : in std_logic_vector(31 downto 0);
                factor11        : in std_logic_vector(31 downto 0);
                --factor        : in vectorblock06;
                --factor        : in vectorblock06;
 
 
                sumando0        : in std_logic_vector(31 downto 0);
                sumando0        : in std_logic_vector(31 downto 0);
                sumando1        : in std_logic_vector(31 downto 0);
                sumando1        : in std_logic_vector(31 downto 0);
                sumando2        : in std_logic_vector(31 downto 0);
                sumando2        : in std_logic_vector(31 downto 0);
                sumando3        : in std_logic_vector(31 downto 0);
                sumando3        : in std_logic_vector(31 downto 0);
                sumando4        : in std_logic_vector(31 downto 0);
                sumando4        : in std_logic_vector(31 downto 0);
                sumando5        : in std_logic_vector(31 downto 0);
                sumando5        : in std_logic_vector(31 downto 0);
                --add32blki     : in vectorblock06;
                --add32blki     : in vectorblock06;
 
 
                a0                      : out std_logic_vector(31 downto 0);
                a0                      : out std_logic_vector(31 downto 0);
                a1                      : out std_logic_vector(31 downto 0);
                a1                      : out std_logic_vector(31 downto 0);
                a2                      : out std_logic_vector(31 downto 0);
                a2                      : out std_logic_vector(31 downto 0);
                --add32blko     : out vectorblock03;
                --add32blko     : out vectorblock03;
 
 
                p0                      : out std_logic_vector(31 downto 0);
                p0                      : out std_logic_vector(31 downto 0);
                p1                      : out std_logic_vector(31 downto 0);
                p1                      : out std_logic_vector(31 downto 0);
                p2                      : out std_logic_vector(31 downto 0);
                p2                      : out std_logic_vector(31 downto 0);
                p3                      : out std_logic_vector(31 downto 0);
                p3                      : out std_logic_vector(31 downto 0);
                p4                      : out std_logic_vector(31 downto 0);
                p4                      : out std_logic_vector(31 downto 0);
                p5                      : out std_logic_vector(31 downto 0);
                p5                      : out std_logic_vector(31 downto 0);
                --p     : out vectorblock06;
                --p     : out vectorblock06;
 
 
                sq32o           : out std_logic_vector(31 downto 0);
                sq32o           : out std_logic_vector(31 downto 0);
                inv32o          : out std_logic_vector(31 downto 0)
                inv32o          : out std_logic_vector(31 downto 0)
 
 
 
 
 
 
        );
        );
end entity;
end entity;
 
 
architecture arithblock_arch of arithblock is
architecture arithblock_arch of arithblock is
 
 
        signal sadd32blko_01 : std_logic_vector(31 downto 0);
        signal sadd32blko_01 : std_logic_vector(31 downto 0);
        signal ssq32o : std_logic_vector(31 downto 0);
        signal ssq32o : std_logic_vector(31 downto 0);
 
        signal ssigna1 : std_logic;
 
 
        --! Componentes Aritm&eacute;ticos
        --! Componentes Aritm&eacute;ticos
        component fadd32long
        component fadd32long
        port (
        port (
                clk : in std_logic;
                clk : in std_logic;
                dpc : in std_logic;
                dpc : in std_logic;
                a32 : in std_logic_vector(31 downto 0);
                a32 : in std_logic_vector(31 downto 0);
                b32 : in std_logic_vector(31 downto 0);
                b32 : in std_logic_vector(31 downto 0);
                c32 : out std_logic_vector(31 downto 0)
                c32 : out std_logic_vector(31 downto 0)
        );
        );
        end component;
        end component;
        component fmul32
        component fmul32
        port (
        port (
                clk : in std_logic;
                clk : in std_logic;
                a32 : in std_logic_vector(31 downto 0);
                a32 : in std_logic_vector(31 downto 0);
                b32 : in std_logic_vector(31 downto 0);
                b32 : in std_logic_vector(31 downto 0);
                p32 : out std_logic_vector(31 downto 0)
                p32 : out std_logic_vector(31 downto 0)
        );
        );
        end component;
        end component;
        --! Bloque de Raiz Cuadrada
        --! Bloque de Raiz Cuadrada
        component sqrt32
        component sqrt32
        port (
        port (
 
 
                clk     : in std_logic;
                clk     : in std_logic;
                rd32: in std_logic_vector(31 downto 0);
                rd32: in std_logic_vector(31 downto 0);
                sq32: out std_logic_vector(31 downto 0)
                sq32: out std_logic_vector(31 downto 0)
        );
        );
        end component;
        end component;
        --! Bloque de Inversores.
        --! Bloque de Inversores.
        component invr32
        component invr32
        port (
        port (
 
 
                clk             : in std_logic;
                clk             : in std_logic;
                dvd32   : in std_logic_vector(31 downto 0);
                dvd32   : in std_logic_vector(31 downto 0);
                qout32  : out std_logic_vector(31 downto 0)
                qout32  : out std_logic_vector(31 downto 0)
        );
        );
        end component;
        end component;
 
 
 
 
begin
begin
 
 
        sq32o <= ssq32o;
        sq32o <= ssq32o;
        a1 <= sadd32blko_01;
        a1 <= sadd32blko_01;
 
        ssigna1 <= sign_switch or sign;
 
 
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        adder_i_0 : fadd32long
        adder_i_0 : fadd32long
        port map (
        port map (
                clk => clk,
                clk => clk,
                dpc => sign,
                dpc => sign,
                a32 => sumando0,
                a32 => sumando0,
                b32 => sumando1,
                b32 => sumando1,
                c32 => a0
                c32 => a0
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        adder_i_1 : fadd32long
        adder_i_1 : fadd32long
        port map (
        port map (
                clk => clk,
                clk => clk,
                dpc => sign,
                dpc => ssigna1,
                a32 => sumando2,
                a32 => sumando2,
                b32 => sumando3,
                b32 => sumando3,
                c32 => sadd32blko_01
                c32 => sadd32blko_01
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        adder_i_2 : fadd32long
        adder_i_2 : fadd32long
        port map (
        port map (
                clk => clk,
                clk => clk,
                dpc => sign,
                dpc => sign,
                a32 => sumando4,
                a32 => sumando4,
                b32 => sumando5,
                b32 => sumando5,
                c32 => a2
                c32 => a2
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        mul_i_0 : fmul32
        mul_i_0 : fmul32
        port map (
        port map (
                clk => clk,
                clk => clk,
                a32 => factor0,
                a32 => factor0,
                b32 => factor1,
                b32 => factor1,
                p32 => p0
                p32 => p0
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        mul_i_1 : fmul32
        mul_i_1 : fmul32
        port map (
        port map (
                clk => clk,
                clk => clk,
                a32 => factor2,
                a32 => factor2,
                b32 => factor3,
                b32 => factor3,
                p32 => p1
                p32 => p1
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        mul_i_2 : fmul32
        mul_i_2 : fmul32
        port map (
        port map (
                clk => clk,
                clk => clk,
                a32 => factor4,
                a32 => factor4,
                b32 => factor5,
                b32 => factor5,
                p32 => p2
                p32 => p2
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        mul_i_3 : fmul32
        mul_i_3 : fmul32
        port map (
        port map (
                clk => clk,
                clk => clk,
                a32 => factor6,
                a32 => factor6,
                b32 => factor7,
                b32 => factor7,
                p32 => p3
                p32 => p3
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        mul_i_4 : fmul32
        mul_i_4 : fmul32
        port map (
        port map (
                clk => clk,
                clk => clk,
                a32 => factor8,
                a32 => factor8,
                b32 => factor9,
                b32 => factor9,
                p32 => p4
                p32 => p4
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        mul_i_5 : fmul32
        mul_i_5 : fmul32
        port map (
        port map (
                clk => clk,
                clk => clk,
                a32 => factor10,
                a32 => factor10,
                b32 => factor11,
                b32 => factor11,
                p32 => p5
                p32 => p5
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        square_root : sqrt32
        square_root : sqrt32
        port map (
        port map (
                clk     => clk,
                clk     => clk,
                rd32    => sadd32blko_01,
                rd32    => sadd32blko_01,
                sq32    => ssq32o
                sq32    => ssq32o
        );
        );
        --!TBXINSTANCESTART
        --!TBXINSTANCESTART
        inversion_block : invr32
        inversion_block : invr32
        port map (
        port map (
                clk             => clk,
                clk             => clk,
                dvd32   => ssq32o,
                dvd32   => ssq32o,
                qout32  => inv32o
                qout32  => inv32o
        );
        );
 
 
 
 
 
 
 
 
 
 
end architecture;
end architecture;
 
 
 
 
 
 

powered by: WebSVN 2.1.0

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