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

Subversion Repositories fpuvhdl

[/] [fpuvhdl/] [trunk/] [fpuvhdl/] [adder/] [fpadd_stage2_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_stage2.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_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 4 gmarcus
-- VHDL Architecture work.FPadd_stage2.struct
53 3 gmarcus
--
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
ARCHITECTURE struct OF FPadd_stage2 IS
69
 
70
   -- Architecture declarations
71
      -- Non hierarchical truthtable declarations
72
 
73
 
74
      -- Non hierarchical truthtable declarations
75
 
76
 
77
 
78
   -- Internal signal declarations
79
   SIGNAL A_CS          : std_logic_vector(28 DOWNTO 0);
80
   SIGNAL A_align_int   : std_logic_vector(28 DOWNTO 0);
81
   SIGNAL B_CS          : std_logic_vector(28 DOWNTO 0);
82
   SIGNAL B_align_int   : std_logic_vector(28 DOWNTO 0);
83
   SIGNAL EXP_base_int  : std_logic_vector(7 DOWNTO 0);
84
   SIGNAL cin_int       : std_logic;
85
   SIGNAL diff          : std_logic_vector(8 DOWNTO 0);
86
   SIGNAL invert_A_int  : std_logic;
87
   SIGNAL invert_B_int  : std_logic;
88
   SIGNAL isINF_tab_int : std_logic;
89
   SIGNAL isNaN_int     : std_logic;
90
   SIGNAL isZ_tab_int   : std_logic;
91
   SIGNAL swap_AB       : std_logic;
92
 
93
 
94
   -- ModuleWare signal declarations(v1.1) for instance 'I2' of 'mux'
95
   SIGNAL mw_I2din0 : std_logic_vector(7 DOWNTO 0);
96
   SIGNAL mw_I2din1 : std_logic_vector(7 DOWNTO 0);
97
 
98
   -- Component Declarations
99
   COMPONENT FPalign
100
   PORT (
101
      A_in  : IN     std_logic_vector (28 DOWNTO 0);
102
      B_in  : IN     std_logic_vector (28 DOWNTO 0);
103
      cin   : IN     std_logic ;
104
      diff  : IN     std_logic_vector (8 DOWNTO 0);
105
      A_out : OUT    std_logic_vector (28 DOWNTO 0);
106
      B_out : OUT    std_logic_vector (28 DOWNTO 0)
107
   );
108
   END COMPONENT;
109
   COMPONENT FPswap
110
   GENERIC (
111
      width : integer := 29
112
   );
113
   PORT (
114
      A_in    : IN     std_logic_vector (width-1 DOWNTO 0);
115
      B_in    : IN     std_logic_vector (width-1 DOWNTO 0);
116
      swap_AB : IN     std_logic ;
117
      A_out   : OUT    std_logic_vector (width-1 DOWNTO 0);
118
      B_out   : OUT    std_logic_vector (width-1 DOWNTO 0)
119
   );
120
   END COMPONENT;
121
 
122
   -- Optional embedded configurations
123
   -- pragma synthesis_off
124 4 gmarcus
   FOR ALL : FPalign USE ENTITY work.FPalign;
125
   FOR ALL : FPswap USE ENTITY work.FPswap;
126 3 gmarcus
   -- pragma synthesis_on
127
 
128
 
129
BEGIN
130
   -- Architecture concurrent statements
131
   -- HDL Embedded Text Block 1 reg1
132
   -- reg1 1
133
   PROCESS(clk)
134
   BEGIN
135
      IF RISING_EDGE(clk) THEN
136
         cin <= cin_int;
137
         invert_A <= invert_A_int;
138
         invert_B <= invert_B_int;
139
         EXP_base_stage2 <= EXP_base_int;
140
         A_align <= A_align_int;
141
         B_align <= B_align_int;
142
         A_SIGN_stage2 <= A_SIGN;
143
         B_XSIGN_stage2 <= B_XSIGN;
144
         isINF_tab_stage2 <= isINF_tab_int;
145
         isNaN_stage2 <= isNaN_int;
146
         isZ_tab_stage2 <= isZ_tab_int;
147
      END IF;
148
   END PROCESS;
149
 
150
   -- HDL Embedded Text Block 2 diff_sign
151
   -- eb5 7
152
   swap_AB <= EXP_diff(8);
153
   diff <= EXP_diff(8 DOWNTO 0);
154
 
155
   -- HDL Embedded Block 3 InvertLogic
156
   -- Non hierarchical truthtable
157
   ---------------------------------------------------------------------------
158
   InvertLogic_truth_process: PROCESS(A_SIGN, B_XSIGN, swap_AB)
159
   ---------------------------------------------------------------------------
160
   BEGIN
161
      -- Block 1
162
      IF (A_SIGN = '0') AND (B_XSIGN = '0') THEN
163
         invert_A_int <= '0';
164
         invert_B_int <= '0';
165
      ELSIF (A_SIGN = '1') AND (B_XSIGN = '1') THEN
166
         invert_A_int <= '0';
167
         invert_B_int <= '0';
168
      ELSIF (A_SIGN = '0') AND (B_XSIGN = '1') AND (swap_AB = '0') THEN
169
         invert_A_int <= '0';
170
         invert_B_int <= '1';
171
      ELSIF (A_SIGN = '0') AND (B_XSIGN = '1') AND (swap_AB = '1') THEN
172
         invert_A_int <= '1';
173
         invert_B_int <= '0';
174
      ELSIF (A_SIGN = '1') AND (B_XSIGN = '0') AND (swap_AB = '0') THEN
175
         invert_A_int <= '1';
176
         invert_B_int <= '0';
177
      ELSIF (A_SIGN = '1') AND (B_XSIGN = '0') AND (swap_AB = '1') THEN
178
         invert_A_int <= '0';
179
         invert_B_int <= '1';
180
      ELSE
181
         invert_A_int <= '0';
182
         invert_B_int <= '0';
183
      END IF;
184
 
185
   END PROCESS InvertLogic_truth_process;
186
 
187
   -- Architecture concurrent statements
188
 
189
 
190
 
191
   -- HDL Embedded Block 4 exceptions
192
   -- Non hierarchical truthtable
193
   ---------------------------------------------------------------------------
194
   exceptions_truth_process: PROCESS(ADD_SUB_out, A_isINF, A_isNaN, A_isZ, B_isINF, B_isNaN, B_isZ)
195
   ---------------------------------------------------------------------------
196
   BEGIN
197
      -- Block 1
198
      IF (A_isNaN = '1') THEN
199
         isINF_tab_int <= '0';
200
         isNaN_int <= '1';
201
         isZ_tab_int <= '0';
202
      ELSIF (B_isNaN = '1') THEN
203
         isINF_tab_int <= '0';
204
         isNaN_int <= '1';
205
         isZ_tab_int <= '0';
206
      ELSIF (ADD_SUB_out = '1') AND (A_isINF = '1') AND (B_isINF = '1') THEN
207
         isINF_tab_int <= '1';
208
         isNaN_int <= '0';
209
         isZ_tab_int <= '0';
210
      ELSIF (ADD_SUB_out = '0') AND (A_isINF = '1') AND (B_isINF = '1') THEN
211
         isINF_tab_int <= '0';
212
         isNaN_int <= '1';
213
         isZ_tab_int <= '0';
214
      ELSIF (A_isINF = '1') THEN
215
         isINF_tab_int <= '1';
216
         isNaN_int <= '0';
217
         isZ_tab_int <= '0';
218
      ELSIF (B_isINF = '1') THEN
219
         isINF_tab_int <= '1';
220
         isNaN_int <= '0';
221
         isZ_tab_int <= '0';
222
      ELSIF (A_isZ = '1') AND (B_isZ = '1') THEN
223
         isINF_tab_int <= '0';
224
         isNaN_int <= '0';
225
         isZ_tab_int <= '1';
226
      ELSE
227
         isINF_tab_int <= '0';
228
         isNaN_int <= '0';
229
         isZ_tab_int <= '0';
230
      END IF;
231
 
232
   END PROCESS exceptions_truth_process;
233
 
234
   -- Architecture concurrent statements
235
 
236
 
237
 
238
 
239
   -- ModuleWare code(v1.1) for instance 'I2' of 'mux'
240
   I2combo: PROCESS(mw_I2din0, mw_I2din1, swap_AB)
241
   VARIABLE dtemp : std_logic_vector(7 DOWNTO 0);
242
   BEGIN
243
      CASE swap_AB IS
244
      WHEN '0'|'L' => dtemp := mw_I2din0;
245
      WHEN '1'|'H' => dtemp := mw_I2din1;
246
      WHEN OTHERS => dtemp := (OTHERS => 'X');
247
      END CASE;
248
      EXP_base_int <= dtemp;
249
   END PROCESS I2combo;
250
   mw_I2din0 <= A_EXP;
251
   mw_I2din1 <= B_EXP;
252
 
253
   -- ModuleWare code(v1.1) for instance 'I1' of 'or'
254
   cin_int <= invert_B_int OR invert_A_int;
255
 
256
   -- Instance port mappings.
257
   I4 : FPalign
258
      PORT MAP (
259
         A_in  => A_CS,
260
         B_in  => B_CS,
261
         cin   => cin_sub,
262
         diff  => diff,
263
         A_out => A_align_int,
264
         B_out => B_align_int
265
      );
266
   I3 : FPswap
267
      GENERIC MAP (
268
         width => 29
269
      )
270
      PORT MAP (
271
         A_in    => A_in,
272
         B_in    => B_in,
273
         swap_AB => swap_AB,
274
         A_out   => A_CS,
275
         B_out   => B_CS
276
      );
277
 
278
END struct;

powered by: WebSVN 2.1.0

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