-- VHDL Entity HAVOC.FPadd_stage3.interface
|
-- VHDL Entity work.FPadd_stage3.interface
|
--
|
--
|
-- Created by
|
-- Created by
|
-- Guillermo Marcus, gmarcus@ieee.org
|
-- Guillermo Marcus, gmarcus@ieee.org
|
-- using Mentor Graphics FPGA Advantage tools.
|
-- using Mentor Graphics FPGA Advantage tools.
|
--
|
--
|
-- Visit "http://fpga.mty.itesm.mx" for more info.
|
-- Visit "http://fpga.mty.itesm.mx" for more info.
|
--
|
--
|
-- 2003-2004. V1.0
|
-- 2003-2004. V1.0
|
--
|
--
|
|
|
LIBRARY ieee;
|
LIBRARY ieee;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_arith.all;
|
USE ieee.std_logic_arith.all;
|
|
|
ENTITY FPadd_stage3 IS
|
ENTITY FPadd_stage3 IS
|
PORT(
|
PORT(
|
A_SIGN_stage2 : IN std_logic;
|
A_SIGN_stage2 : IN std_logic;
|
A_align : IN std_logic_vector (28 DOWNTO 0);
|
A_align : IN std_logic_vector (28 DOWNTO 0);
|
B_XSIGN_stage2 : IN std_logic;
|
B_XSIGN_stage2 : IN std_logic;
|
B_align : IN std_logic_vector (28 DOWNTO 0);
|
B_align : IN std_logic_vector (28 DOWNTO 0);
|
EXP_base_stage2 : IN std_logic_vector (7 DOWNTO 0);
|
EXP_base_stage2 : IN std_logic_vector (7 DOWNTO 0);
|
cin : IN std_logic;
|
cin : IN std_logic;
|
clk : IN std_logic;
|
clk : IN std_logic;
|
invert_A : IN std_logic;
|
invert_A : IN std_logic;
|
invert_B : IN std_logic;
|
invert_B : IN std_logic;
|
isINF_tab_stage2 : IN std_logic;
|
isINF_tab_stage2 : IN std_logic;
|
isNaN_stage2 : IN std_logic;
|
isNaN_stage2 : IN std_logic;
|
isZ_tab_stage2 : IN std_logic;
|
isZ_tab_stage2 : IN std_logic;
|
A_SIGN_stage3 : OUT std_logic;
|
A_SIGN_stage3 : OUT std_logic;
|
B_XSIGN_stage3 : OUT std_logic;
|
B_XSIGN_stage3 : OUT std_logic;
|
EXP_base : OUT std_logic_vector (7 DOWNTO 0);
|
EXP_base : OUT std_logic_vector (7 DOWNTO 0);
|
add_out : OUT std_logic_vector (28 DOWNTO 0);
|
add_out : OUT std_logic_vector (28 DOWNTO 0);
|
isINF_tab_stage3 : OUT std_logic;
|
isINF_tab_stage3 : OUT std_logic;
|
isNaN_stage3 : OUT std_logic;
|
isNaN_stage3 : OUT std_logic;
|
isZ_tab_stage3 : OUT std_logic
|
isZ_tab_stage3 : OUT std_logic
|
);
|
);
|
|
|
-- Declarations
|
-- Declarations
|
|
|
END FPadd_stage3 ;
|
END FPadd_stage3 ;
|
|
|
--
|
--
|
-- VHDL Architecture HAVOC.FPadd_stage3.struct
|
-- VHDL Architecture work.FPadd_stage3.struct
|
--
|
--
|
-- Created by
|
-- Created by
|
-- Guillermo Marcus, gmarcus@ieee.org
|
-- Guillermo Marcus, gmarcus@ieee.org
|
-- using Mentor Graphics FPGA Advantage tools.
|
-- using Mentor Graphics FPGA Advantage tools.
|
--
|
--
|
-- Visit "http://fpga.mty.itesm.mx" for more info.
|
-- Visit "http://fpga.mty.itesm.mx" for more info.
|
--
|
--
|
-- Copyright 2003-2004. V1.0
|
-- Copyright 2003-2004. V1.0
|
--
|
--
|
|
|
|
|
LIBRARY ieee;
|
LIBRARY ieee;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_arith.all;
|
USE ieee.std_logic_arith.all;
|
|
|
LIBRARY HAVOC;
|
|
|
|
ARCHITECTURE struct OF FPadd_stage3 IS
|
ARCHITECTURE struct OF FPadd_stage3 IS
|
|
|
-- Architecture declarations
|
-- Architecture declarations
|
|
|
-- Internal signal declarations
|
-- Internal signal declarations
|
SIGNAL A_inv : std_logic_vector(28 DOWNTO 0);
|
SIGNAL A_inv : std_logic_vector(28 DOWNTO 0);
|
SIGNAL B_inv : std_logic_vector(28 DOWNTO 0);
|
SIGNAL B_inv : std_logic_vector(28 DOWNTO 0);
|
SIGNAL add_out_int : std_logic_vector(28 DOWNTO 0);
|
SIGNAL add_out_int : std_logic_vector(28 DOWNTO 0);
|
|
|
|
|
-- Component Declarations
|
-- Component Declarations
|
COMPONENT FPinvert
|
COMPONENT FPinvert
|
GENERIC (
|
GENERIC (
|
width : integer := 29
|
width : integer := 29
|
);
|
);
|
PORT (
|
PORT (
|
A_in : IN std_logic_vector (width-1 DOWNTO 0);
|
A_in : IN std_logic_vector (width-1 DOWNTO 0);
|
B_in : IN std_logic_vector (width-1 DOWNTO 0);
|
B_in : IN std_logic_vector (width-1 DOWNTO 0);
|
invert_A : IN std_logic ;
|
invert_A : IN std_logic ;
|
invert_B : IN std_logic ;
|
invert_B : IN std_logic ;
|
A_out : OUT std_logic_vector (width-1 DOWNTO 0);
|
A_out : OUT std_logic_vector (width-1 DOWNTO 0);
|
B_out : OUT std_logic_vector (width-1 DOWNTO 0)
|
B_out : OUT std_logic_vector (width-1 DOWNTO 0)
|
);
|
);
|
END COMPONENT;
|
END COMPONENT;
|
|
|
-- Optional embedded configurations
|
-- Optional embedded configurations
|
-- pragma synthesis_off
|
-- pragma synthesis_off
|
FOR ALL : FPinvert USE ENTITY HAVOC.FPinvert;
|
FOR ALL : FPinvert USE ENTITY work.FPinvert;
|
-- pragma synthesis_on
|
-- pragma synthesis_on
|
|
|
|
|
BEGIN
|
BEGIN
|
-- Architecture concurrent statements
|
-- Architecture concurrent statements
|
-- HDL Embedded Text Block 1 reg1
|
-- HDL Embedded Text Block 1 reg1
|
-- reg1 1
|
-- reg1 1
|
PROCESS(clk)
|
PROCESS(clk)
|
BEGIN
|
BEGIN
|
IF RISING_EDGE(clk) THEN
|
IF RISING_EDGE(clk) THEN
|
add_out <= add_out_int;
|
add_out <= add_out_int;
|
EXP_base <= EXP_base_stage2;
|
EXP_base <= EXP_base_stage2;
|
A_SIGN_stage3 <= A_SIGN_stage2;
|
A_SIGN_stage3 <= A_SIGN_stage2;
|
B_XSIGN_stage3 <= B_XSIGN_stage2;
|
B_XSIGN_stage3 <= B_XSIGN_stage2;
|
isINF_tab_stage3 <= isINF_tab_stage2;
|
isINF_tab_stage3 <= isINF_tab_stage2;
|
isNaN_stage3 <= isNaN_stage2;
|
isNaN_stage3 <= isNaN_stage2;
|
isZ_tab_stage3 <= isZ_tab_stage2;
|
isZ_tab_stage3 <= isZ_tab_stage2;
|
END IF;
|
END IF;
|
END PROCESS;
|
END PROCESS;
|
|
|
|
|
-- ModuleWare code(v1.1) for instance 'I4' of 'add'
|
-- ModuleWare code(v1.1) for instance 'I4' of 'add'
|
I4combo: PROCESS (A_inv, B_inv, cin)
|
I4combo: PROCESS (A_inv, B_inv, cin)
|
VARIABLE mw_I4t0 : std_logic_vector(29 DOWNTO 0);
|
VARIABLE mw_I4t0 : std_logic_vector(29 DOWNTO 0);
|
VARIABLE mw_I4t1 : std_logic_vector(29 DOWNTO 0);
|
VARIABLE mw_I4t1 : std_logic_vector(29 DOWNTO 0);
|
VARIABLE mw_I4sum : signed(29 DOWNTO 0);
|
VARIABLE mw_I4sum : signed(29 DOWNTO 0);
|
VARIABLE mw_I4carry : std_logic;
|
VARIABLE mw_I4carry : std_logic;
|
BEGIN
|
BEGIN
|
mw_I4t0 := A_inv(28) & A_inv;
|
mw_I4t0 := A_inv(28) & A_inv;
|
mw_I4t1 := B_inv(28) & B_inv;
|
mw_I4t1 := B_inv(28) & B_inv;
|
mw_I4carry := cin;
|
mw_I4carry := cin;
|
mw_I4sum := signed(mw_I4t0) + signed(mw_I4t1) + mw_I4carry;
|
mw_I4sum := signed(mw_I4t0) + signed(mw_I4t1) + mw_I4carry;
|
add_out_int <= conv_std_logic_vector(mw_I4sum(28 DOWNTO 0),29);
|
add_out_int <= conv_std_logic_vector(mw_I4sum(28 DOWNTO 0),29);
|
END PROCESS I4combo;
|
END PROCESS I4combo;
|
|
|
-- Instance port mappings.
|
-- Instance port mappings.
|
I14 : FPinvert
|
I14 : FPinvert
|
GENERIC MAP (
|
GENERIC MAP (
|
width => 29
|
width => 29
|
)
|
)
|
PORT MAP (
|
PORT MAP (
|
A_in => A_align,
|
A_in => A_align,
|
B_in => B_align,
|
B_in => B_align,
|
invert_A => invert_A,
|
invert_A => invert_A,
|
invert_B => invert_B,
|
invert_B => invert_B,
|
A_out => A_inv,
|
A_out => A_inv,
|
B_out => B_inv
|
B_out => B_inv
|
);
|
);
|
|
|
END struct;
|
END struct;
|
|
|