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

Subversion Repositories fpuvhdl

[/] [fpuvhdl/] [trunk/] [fpuvhdl/] [adder/] [fpadd_stage3_struct.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 gmarcus
-- VHDL Entity work.FPadd_stage3.interface
2 3 gmarcus
--
3
-- Created by
4
-- Guillermo Marcus, gmarcus@ieee.org
5
-- using Mentor Graphics FPGA Advantage tools.
6
--
7
-- Visit "http://fpga.mty.itesm.mx" for more info.
8
--
9
-- 2003-2004. V1.0
10
--
11
 
12
LIBRARY ieee;
13
USE ieee.std_logic_1164.all;
14
USE ieee.std_logic_arith.all;
15
 
16
ENTITY FPadd_stage3 IS
17
   PORT(
18
      A_SIGN_stage2    : IN     std_logic;
19
      A_align          : IN     std_logic_vector (28 DOWNTO 0);
20
      B_XSIGN_stage2   : IN     std_logic;
21
      B_align          : IN     std_logic_vector (28 DOWNTO 0);
22
      EXP_base_stage2  : IN     std_logic_vector (7 DOWNTO 0);
23
      cin              : IN     std_logic;
24
      clk              : IN     std_logic;
25
      invert_A         : IN     std_logic;
26
      invert_B         : IN     std_logic;
27
      isINF_tab_stage2 : IN     std_logic;
28
      isNaN_stage2     : IN     std_logic;
29
      isZ_tab_stage2   : IN     std_logic;
30
      A_SIGN_stage3    : OUT    std_logic;
31
      B_XSIGN_stage3   : OUT    std_logic;
32
      EXP_base         : OUT    std_logic_vector (7 DOWNTO 0);
33
      add_out          : OUT    std_logic_vector (28 DOWNTO 0);
34
      isINF_tab_stage3 : OUT    std_logic;
35
      isNaN_stage3     : OUT    std_logic;
36
      isZ_tab_stage3   : OUT    std_logic
37
   );
38
 
39
-- Declarations
40
 
41
END FPadd_stage3 ;
42
 
43
--
44 4 gmarcus
-- VHDL Architecture work.FPadd_stage3.struct
45 3 gmarcus
--
46
-- Created by
47
-- Guillermo Marcus, gmarcus@ieee.org
48
-- using Mentor Graphics FPGA Advantage tools.
49
--
50
-- Visit "http://fpga.mty.itesm.mx" for more info.
51
--
52
-- Copyright 2003-2004. V1.0
53
--
54
 
55
 
56
LIBRARY ieee;
57
USE ieee.std_logic_1164.all;
58
USE ieee.std_logic_arith.all;
59
 
60
ARCHITECTURE struct OF FPadd_stage3 IS
61
 
62
   -- Architecture declarations
63
 
64
   -- Internal signal declarations
65
   SIGNAL A_inv       : std_logic_vector(28 DOWNTO 0);
66
   SIGNAL B_inv       : std_logic_vector(28 DOWNTO 0);
67
   SIGNAL add_out_int : std_logic_vector(28 DOWNTO 0);
68
 
69
 
70
   -- Component Declarations
71
   COMPONENT FPinvert
72
   GENERIC (
73
      width : integer := 29
74
   );
75
   PORT (
76
      A_in     : IN     std_logic_vector (width-1 DOWNTO 0);
77
      B_in     : IN     std_logic_vector (width-1 DOWNTO 0);
78
      invert_A : IN     std_logic ;
79
      invert_B : IN     std_logic ;
80
      A_out    : OUT    std_logic_vector (width-1 DOWNTO 0);
81
      B_out    : OUT    std_logic_vector (width-1 DOWNTO 0)
82
   );
83
   END COMPONENT;
84
 
85
   -- Optional embedded configurations
86
   -- pragma synthesis_off
87 4 gmarcus
   FOR ALL : FPinvert USE ENTITY work.FPinvert;
88 3 gmarcus
   -- pragma synthesis_on
89
 
90
 
91
BEGIN
92
   -- Architecture concurrent statements
93
   -- HDL Embedded Text Block 1 reg1
94
   -- reg1 1                                  
95
   PROCESS(clk)
96
   BEGIN
97
      IF RISING_EDGE(clk) THEN
98
         add_out <= add_out_int;
99
         EXP_base <= EXP_base_stage2;
100
         A_SIGN_stage3 <= A_SIGN_stage2;
101
         B_XSIGN_stage3 <= B_XSIGN_stage2;
102
         isINF_tab_stage3 <= isINF_tab_stage2;
103
         isNaN_stage3 <= isNaN_stage2;
104
         isZ_tab_stage3 <= isZ_tab_stage2;
105
      END IF;
106
   END PROCESS;
107
 
108
 
109
   -- ModuleWare code(v1.1) for instance 'I4' of 'add'
110
   I4combo: PROCESS (A_inv, B_inv, cin)
111
   VARIABLE mw_I4t0 : std_logic_vector(29 DOWNTO 0);
112
   VARIABLE mw_I4t1 : std_logic_vector(29 DOWNTO 0);
113
   VARIABLE mw_I4sum : signed(29 DOWNTO 0);
114
   VARIABLE mw_I4carry : std_logic;
115
   BEGIN
116
      mw_I4t0 := A_inv(28) & A_inv;
117
      mw_I4t1 := B_inv(28) & B_inv;
118
      mw_I4carry := cin;
119
      mw_I4sum := signed(mw_I4t0) + signed(mw_I4t1) + mw_I4carry;
120
      add_out_int <= conv_std_logic_vector(mw_I4sum(28 DOWNTO 0),29);
121
   END PROCESS I4combo;
122
 
123
   -- Instance port mappings.
124
   I14 : FPinvert
125
      GENERIC MAP (
126
         width => 29
127
      )
128
      PORT MAP (
129
         A_in     => A_align,
130
         B_in     => B_align,
131
         invert_A => invert_A,
132
         invert_B => invert_B,
133
         A_out    => A_inv,
134
         B_out    => B_inv
135
      );
136
 
137
END struct;

powered by: WebSVN 2.1.0

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