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

Subversion Repositories fpuvhdl

[/] [fpuvhdl/] [trunk/] [fpuvhdl/] [adder/] [fpadd_stage2_struct.vhd] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gmarcus
-- VHDL Entity HAVOC.FPadd_stage2.interface
2
--
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_stage2 IS
17
   PORT(
18
      ADD_SUB_out      : IN     std_logic;
19
      A_EXP            : IN     std_logic_vector (7 DOWNTO 0);
20
      A_SIGN           : IN     std_logic;
21
      A_in             : IN     std_logic_vector (28 DOWNTO 0);
22
      A_isINF          : IN     std_logic;
23
      A_isNaN          : IN     std_logic;
24
      A_isZ            : IN     std_logic;
25
      B_EXP            : IN     std_logic_vector (7 DOWNTO 0);
26
      B_XSIGN          : IN     std_logic;
27
      B_in             : IN     std_logic_vector (28 DOWNTO 0);
28
      B_isINF          : IN     std_logic;
29
      B_isNaN          : IN     std_logic;
30
      B_isZ            : IN     std_logic;
31
      EXP_diff         : IN     std_logic_vector (8 DOWNTO 0);
32
      cin_sub          : IN     std_logic;
33
      clk              : IN     std_logic;
34
      A_SIGN_stage2    : OUT    std_logic;
35
      A_align          : OUT    std_logic_vector (28 DOWNTO 0);
36
      B_XSIGN_stage2   : OUT    std_logic;
37
      B_align          : OUT    std_logic_vector (28 DOWNTO 0);
38
      EXP_base_stage2  : OUT    std_logic_vector (7 DOWNTO 0);
39
      cin              : OUT    std_logic;
40
      invert_A         : OUT    std_logic;
41
      invert_B         : OUT    std_logic;
42
      isINF_tab_stage2 : OUT    std_logic;
43
      isNaN_stage2     : OUT    std_logic;
44
      isZ_tab_stage2   : OUT    std_logic
45
   );
46
 
47
-- Declarations
48
 
49
END FPadd_stage2 ;
50
 
51
--
52
-- VHDL Architecture HAVOC.FPadd_stage2.struct
53
--
54
-- Created by
55
-- Guillermo Marcus, gmarcus@ieee.org
56
-- using Mentor Graphics FPGA Advantage tools.
57
--
58
-- Visit "http://fpga.mty.itesm.mx" for more info.
59
--
60
-- Copyright 2003-2004. V1.0
61
--
62
 
63
 
64
LIBRARY ieee;
65
USE ieee.std_logic_1164.all;
66
USE ieee.std_logic_arith.all;
67
 
68
LIBRARY HAVOC;
69
 
70
ARCHITECTURE struct OF FPadd_stage2 IS
71
 
72
   -- Architecture declarations
73
      -- Non hierarchical truthtable declarations
74
 
75
 
76
      -- Non hierarchical truthtable declarations
77
 
78
 
79
 
80
   -- Internal signal declarations
81
   SIGNAL A_CS          : std_logic_vector(28 DOWNTO 0);
82
   SIGNAL A_align_int   : std_logic_vector(28 DOWNTO 0);
83
   SIGNAL B_CS          : std_logic_vector(28 DOWNTO 0);
84
   SIGNAL B_align_int   : std_logic_vector(28 DOWNTO 0);
85
   SIGNAL EXP_base_int  : std_logic_vector(7 DOWNTO 0);
86
   SIGNAL cin_int       : std_logic;
87
   SIGNAL diff          : std_logic_vector(8 DOWNTO 0);
88
   SIGNAL invert_A_int  : std_logic;
89
   SIGNAL invert_B_int  : std_logic;
90
   SIGNAL isINF_tab_int : std_logic;
91
   SIGNAL isNaN_int     : std_logic;
92
   SIGNAL isZ_tab_int   : std_logic;
93
   SIGNAL swap_AB       : std_logic;
94
 
95
 
96
   -- ModuleWare signal declarations(v1.1) for instance 'I2' of 'mux'
97
   SIGNAL mw_I2din0 : std_logic_vector(7 DOWNTO 0);
98
   SIGNAL mw_I2din1 : std_logic_vector(7 DOWNTO 0);
99
 
100
   -- Component Declarations
101
   COMPONENT FPalign
102
   PORT (
103
      A_in  : IN     std_logic_vector (28 DOWNTO 0);
104
      B_in  : IN     std_logic_vector (28 DOWNTO 0);
105
      cin   : IN     std_logic ;
106
      diff  : IN     std_logic_vector (8 DOWNTO 0);
107
      A_out : OUT    std_logic_vector (28 DOWNTO 0);
108
      B_out : OUT    std_logic_vector (28 DOWNTO 0)
109
   );
110
   END COMPONENT;
111
   COMPONENT FPswap
112
   GENERIC (
113
      width : integer := 29
114
   );
115
   PORT (
116
      A_in    : IN     std_logic_vector (width-1 DOWNTO 0);
117
      B_in    : IN     std_logic_vector (width-1 DOWNTO 0);
118
      swap_AB : IN     std_logic ;
119
      A_out   : OUT    std_logic_vector (width-1 DOWNTO 0);
120
      B_out   : OUT    std_logic_vector (width-1 DOWNTO 0)
121
   );
122
   END COMPONENT;
123
 
124
   -- Optional embedded configurations
125
   -- pragma synthesis_off
126
   FOR ALL : FPalign USE ENTITY HAVOC.FPalign;
127
   FOR ALL : FPswap USE ENTITY HAVOC.FPswap;
128
   -- pragma synthesis_on
129
 
130
 
131
BEGIN
132
   -- Architecture concurrent statements
133
   -- HDL Embedded Text Block 1 reg1
134
   -- reg1 1
135
   PROCESS(clk)
136
   BEGIN
137
      IF RISING_EDGE(clk) THEN
138
         cin <= cin_int;
139
         invert_A <= invert_A_int;
140
         invert_B <= invert_B_int;
141
         EXP_base_stage2 <= EXP_base_int;
142
         A_align <= A_align_int;
143
         B_align <= B_align_int;
144
         A_SIGN_stage2 <= A_SIGN;
145
         B_XSIGN_stage2 <= B_XSIGN;
146
         isINF_tab_stage2 <= isINF_tab_int;
147
         isNaN_stage2 <= isNaN_int;
148
         isZ_tab_stage2 <= isZ_tab_int;
149
      END IF;
150
   END PROCESS;
151
 
152
   -- HDL Embedded Text Block 2 diff_sign
153
   -- eb5 7
154
   swap_AB <= EXP_diff(8);
155
   diff <= EXP_diff(8 DOWNTO 0);
156
 
157
   -- HDL Embedded Block 3 InvertLogic
158
   -- Non hierarchical truthtable
159
   ---------------------------------------------------------------------------
160
   InvertLogic_truth_process: PROCESS(A_SIGN, B_XSIGN, swap_AB)
161
   ---------------------------------------------------------------------------
162
   BEGIN
163
      -- Block 1
164
      IF (A_SIGN = '0') AND (B_XSIGN = '0') THEN
165
         invert_A_int <= '0';
166
         invert_B_int <= '0';
167
      ELSIF (A_SIGN = '1') AND (B_XSIGN = '1') THEN
168
         invert_A_int <= '0';
169
         invert_B_int <= '0';
170
      ELSIF (A_SIGN = '0') AND (B_XSIGN = '1') AND (swap_AB = '0') THEN
171
         invert_A_int <= '0';
172
         invert_B_int <= '1';
173
      ELSIF (A_SIGN = '0') AND (B_XSIGN = '1') AND (swap_AB = '1') THEN
174
         invert_A_int <= '1';
175
         invert_B_int <= '0';
176
      ELSIF (A_SIGN = '1') AND (B_XSIGN = '0') AND (swap_AB = '0') THEN
177
         invert_A_int <= '1';
178
         invert_B_int <= '0';
179
      ELSIF (A_SIGN = '1') AND (B_XSIGN = '0') AND (swap_AB = '1') THEN
180
         invert_A_int <= '0';
181
         invert_B_int <= '1';
182
      ELSE
183
         invert_A_int <= '0';
184
         invert_B_int <= '0';
185
      END IF;
186
 
187
   END PROCESS InvertLogic_truth_process;
188
 
189
   -- Architecture concurrent statements
190
 
191
 
192
 
193
   -- HDL Embedded Block 4 exceptions
194
   -- Non hierarchical truthtable
195
   ---------------------------------------------------------------------------
196
   exceptions_truth_process: PROCESS(ADD_SUB_out, A_isINF, A_isNaN, A_isZ, B_isINF, B_isNaN, B_isZ)
197
   ---------------------------------------------------------------------------
198
   BEGIN
199
      -- Block 1
200
      IF (A_isNaN = '1') THEN
201
         isINF_tab_int <= '0';
202
         isNaN_int <= '1';
203
         isZ_tab_int <= '0';
204
      ELSIF (B_isNaN = '1') THEN
205
         isINF_tab_int <= '0';
206
         isNaN_int <= '1';
207
         isZ_tab_int <= '0';
208
      ELSIF (ADD_SUB_out = '1') AND (A_isINF = '1') AND (B_isINF = '1') THEN
209
         isINF_tab_int <= '1';
210
         isNaN_int <= '0';
211
         isZ_tab_int <= '0';
212
      ELSIF (ADD_SUB_out = '0') AND (A_isINF = '1') AND (B_isINF = '1') THEN
213
         isINF_tab_int <= '0';
214
         isNaN_int <= '1';
215
         isZ_tab_int <= '0';
216
      ELSIF (A_isINF = '1') THEN
217
         isINF_tab_int <= '1';
218
         isNaN_int <= '0';
219
         isZ_tab_int <= '0';
220
      ELSIF (B_isINF = '1') THEN
221
         isINF_tab_int <= '1';
222
         isNaN_int <= '0';
223
         isZ_tab_int <= '0';
224
      ELSIF (A_isZ = '1') AND (B_isZ = '1') THEN
225
         isINF_tab_int <= '0';
226
         isNaN_int <= '0';
227
         isZ_tab_int <= '1';
228
      ELSE
229
         isINF_tab_int <= '0';
230
         isNaN_int <= '0';
231
         isZ_tab_int <= '0';
232
      END IF;
233
 
234
   END PROCESS exceptions_truth_process;
235
 
236
   -- Architecture concurrent statements
237
 
238
 
239
 
240
 
241
   -- ModuleWare code(v1.1) for instance 'I2' of 'mux'
242
   I2combo: PROCESS(mw_I2din0, mw_I2din1, swap_AB)
243
   VARIABLE dtemp : std_logic_vector(7 DOWNTO 0);
244
   BEGIN
245
      CASE swap_AB IS
246
      WHEN '0'|'L' => dtemp := mw_I2din0;
247
      WHEN '1'|'H' => dtemp := mw_I2din1;
248
      WHEN OTHERS => dtemp := (OTHERS => 'X');
249
      END CASE;
250
      EXP_base_int <= dtemp;
251
   END PROCESS I2combo;
252
   mw_I2din0 <= A_EXP;
253
   mw_I2din1 <= B_EXP;
254
 
255
   -- ModuleWare code(v1.1) for instance 'I1' of 'or'
256
   cin_int <= invert_B_int OR invert_A_int;
257
 
258
   -- Instance port mappings.
259
   I4 : FPalign
260
      PORT MAP (
261
         A_in  => A_CS,
262
         B_in  => B_CS,
263
         cin   => cin_sub,
264
         diff  => diff,
265
         A_out => A_align_int,
266
         B_out => B_align_int
267
      );
268
   I3 : FPswap
269
      GENERIC MAP (
270
         width => 29
271
      )
272
      PORT MAP (
273
         A_in    => A_in,
274
         B_in    => B_in,
275
         swap_AB => swap_AB,
276
         A_out   => A_CS,
277
         B_out   => B_CS
278
      );
279
 
280
END struct;

powered by: WebSVN 2.1.0

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