1 | // ========== Copyright Header Begin ========================================== |
---|
2 | // |
---|
3 | // OpenSPARC T1 Processor File: fpu_denorm_frac.v |
---|
4 | // Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. |
---|
5 | // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. |
---|
6 | // |
---|
7 | // The above named program is free software; you can redistribute it and/or |
---|
8 | // modify it under the terms of the GNU General Public |
---|
9 | // License version 2 as published by the Free Software Foundation. |
---|
10 | // |
---|
11 | // The above named program is distributed in the hope that it will be |
---|
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | // General Public License for more details. |
---|
15 | // |
---|
16 | // You should have received a copy of the GNU General Public |
---|
17 | // License along with this work; if not, write to the Free Software |
---|
18 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
19 | // |
---|
20 | // ========== Copyright Header End ============================================ |
---|
21 | /////////////////////////////////////////////////////////////////////////////// |
---|
22 | // |
---|
23 | // Fraction comparison of two inputs that both have leading 0's. |
---|
24 | // |
---|
25 | /////////////////////////////////////////////////////////////////////////////// |
---|
26 | |
---|
27 | module fpu_denorm_frac ( |
---|
28 | din1, |
---|
29 | din2, |
---|
30 | |
---|
31 | din2_din1_denorm, |
---|
32 | din2_din1_denorm_inv, |
---|
33 | din2_din1_denorma, |
---|
34 | din2_din1_denorm_inva |
---|
35 | ); |
---|
36 | |
---|
37 | |
---|
38 | input [53:0] din1; // input 1- fraction |
---|
39 | input [53:0] din2; // input 2- fraction |
---|
40 | |
---|
41 | output din2_din1_denorm; // input 1 == denorm |
---|
42 | output din2_din1_denorm_inv; // input 1 != denorm |
---|
43 | output din2_din1_denorma; // input 1 == denorm- copy |
---|
44 | output din2_din1_denorm_inva; // input 1 != denorm- copy |
---|
45 | |
---|
46 | |
---|
47 | wire din2_din1_nz_53_51; |
---|
48 | wire din2_din1_denorm_53_51; |
---|
49 | wire din2_din1_nz_50_48; |
---|
50 | wire din2_din1_denorm_50_48; |
---|
51 | wire din2_din1_nz_47_45; |
---|
52 | wire din2_din1_denorm_47_45; |
---|
53 | wire din2_din1_nz_44_42; |
---|
54 | wire din2_din1_denorm_44_42; |
---|
55 | wire din2_din1_nz_41_39; |
---|
56 | wire din2_din1_denorm_41_39; |
---|
57 | wire din2_din1_nz_38_36; |
---|
58 | wire din2_din1_denorm_38_36; |
---|
59 | wire din2_din1_nz_35_33; |
---|
60 | wire din2_din1_denorm_35_33; |
---|
61 | wire din2_din1_nz_32_30; |
---|
62 | wire din2_din1_denorm_32_30; |
---|
63 | wire din2_din1_nz_29_27; |
---|
64 | wire din2_din1_denorm_29_27; |
---|
65 | wire din2_din1_nz_26_24; |
---|
66 | wire din2_din1_denorm_26_24; |
---|
67 | wire din2_din1_nz_23_21; |
---|
68 | wire din2_din1_denorm_23_21; |
---|
69 | wire din2_din1_nz_20_18; |
---|
70 | wire din2_din1_denorm_20_18; |
---|
71 | wire din2_din1_nz_17_15; |
---|
72 | wire din2_din1_denorm_17_15; |
---|
73 | wire din2_din1_nz_14_12; |
---|
74 | wire din2_din1_denorm_14_12; |
---|
75 | wire din2_din1_nz_11_9; |
---|
76 | wire din2_din1_denorm_11_9; |
---|
77 | wire din2_din1_nz_8_6; |
---|
78 | wire din2_din1_denorm_8_6; |
---|
79 | wire din2_din1_nz_5_3; |
---|
80 | wire din2_din1_denorm_5_3; |
---|
81 | wire din2_din1_nz_2_0; |
---|
82 | wire din2_din1_denorm_2_0; |
---|
83 | wire din2_din1_nz_53_45; |
---|
84 | wire din2_din1_denorm_53_45; |
---|
85 | wire din2_din1_nz_44_36; |
---|
86 | wire din2_din1_denorm_44_36; |
---|
87 | wire din2_din1_nz_35_27; |
---|
88 | wire din2_din1_denorm_35_27; |
---|
89 | wire din2_din1_nz_26_18; |
---|
90 | wire din2_din1_denorm_26_18; |
---|
91 | wire din2_din1_nz_17_9; |
---|
92 | wire din2_din1_denorm_17_9; |
---|
93 | wire din2_din1_nz_8_0; |
---|
94 | wire din2_din1_denorm_8_0; |
---|
95 | wire din2_din1_nz_53_27; |
---|
96 | wire din2_din1_denorm_53_27; |
---|
97 | wire din2_din1_nz_26_0; |
---|
98 | wire din2_din1_denorm_26_0; |
---|
99 | wire din2_din1_denorm; |
---|
100 | wire din2_din1_denorm_inv; |
---|
101 | wire din2_din1_denorma; |
---|
102 | wire din2_din1_denorm_inva; |
---|
103 | |
---|
104 | |
---|
105 | fpu_denorm_3b i_fpu_denorm_53_51 ( |
---|
106 | .din1 (din1[53:51]), |
---|
107 | .din2 (din2[53:51]), |
---|
108 | |
---|
109 | .din2_din1_nz (din2_din1_nz_53_51), |
---|
110 | .din2_din1_denorm (din2_din1_denorm_53_51) |
---|
111 | ); |
---|
112 | |
---|
113 | fpu_denorm_3b i_fpu_denorm_50_48 ( |
---|
114 | .din1 (din1[50:48]), |
---|
115 | .din2 (din2[50:48]), |
---|
116 | |
---|
117 | .din2_din1_nz (din2_din1_nz_50_48), |
---|
118 | .din2_din1_denorm (din2_din1_denorm_50_48) |
---|
119 | ); |
---|
120 | |
---|
121 | fpu_denorm_3b i_fpu_denorm_47_45 ( |
---|
122 | .din1 (din1[47:45]), |
---|
123 | .din2 (din2[47:45]), |
---|
124 | |
---|
125 | .din2_din1_nz (din2_din1_nz_47_45), |
---|
126 | .din2_din1_denorm (din2_din1_denorm_47_45) |
---|
127 | ); |
---|
128 | |
---|
129 | fpu_denorm_3b i_fpu_denorm_44_42 ( |
---|
130 | .din1 (din1[44:42]), |
---|
131 | .din2 (din2[44:42]), |
---|
132 | |
---|
133 | .din2_din1_nz (din2_din1_nz_44_42), |
---|
134 | .din2_din1_denorm (din2_din1_denorm_44_42) |
---|
135 | ); |
---|
136 | |
---|
137 | fpu_denorm_3b i_fpu_denorm_41_39 ( |
---|
138 | .din1 (din1[41:39]), |
---|
139 | .din2 (din2[41:39]), |
---|
140 | |
---|
141 | .din2_din1_nz (din2_din1_nz_41_39), |
---|
142 | .din2_din1_denorm (din2_din1_denorm_41_39) |
---|
143 | ); |
---|
144 | |
---|
145 | fpu_denorm_3b i_fpu_denorm_38_36 ( |
---|
146 | .din1 (din1[38:36]), |
---|
147 | .din2 (din2[38:36]), |
---|
148 | |
---|
149 | .din2_din1_nz (din2_din1_nz_38_36), |
---|
150 | .din2_din1_denorm (din2_din1_denorm_38_36) |
---|
151 | ); |
---|
152 | |
---|
153 | fpu_denorm_3b i_fpu_denorm_35_33 ( |
---|
154 | .din1 (din1[35:33]), |
---|
155 | .din2 (din2[35:33]), |
---|
156 | |
---|
157 | .din2_din1_nz (din2_din1_nz_35_33), |
---|
158 | .din2_din1_denorm (din2_din1_denorm_35_33) |
---|
159 | ); |
---|
160 | |
---|
161 | fpu_denorm_3b i_fpu_denorm_32_30 ( |
---|
162 | .din1 (din1[32:30]), |
---|
163 | .din2 (din2[32:30]), |
---|
164 | |
---|
165 | .din2_din1_nz (din2_din1_nz_32_30), |
---|
166 | .din2_din1_denorm (din2_din1_denorm_32_30) |
---|
167 | ); |
---|
168 | |
---|
169 | fpu_denorm_3b i_fpu_denorm_29_27 ( |
---|
170 | .din1 (din1[29:27]), |
---|
171 | .din2 (din2[29:27]), |
---|
172 | |
---|
173 | .din2_din1_nz (din2_din1_nz_29_27), |
---|
174 | .din2_din1_denorm (din2_din1_denorm_29_27) |
---|
175 | ); |
---|
176 | |
---|
177 | fpu_denorm_3b i_fpu_denorm_26_24 ( |
---|
178 | .din1 (din1[26:24]), |
---|
179 | .din2 (din2[26:24]), |
---|
180 | |
---|
181 | .din2_din1_nz (din2_din1_nz_26_24), |
---|
182 | .din2_din1_denorm (din2_din1_denorm_26_24) |
---|
183 | ); |
---|
184 | |
---|
185 | fpu_denorm_3b i_fpu_denorm_23_21 ( |
---|
186 | .din1 (din1[23:21]), |
---|
187 | .din2 (din2[23:21]), |
---|
188 | |
---|
189 | .din2_din1_nz (din2_din1_nz_23_21), |
---|
190 | .din2_din1_denorm (din2_din1_denorm_23_21) |
---|
191 | ); |
---|
192 | |
---|
193 | fpu_denorm_3b i_fpu_denorm_20_18 ( |
---|
194 | .din1 (din1[20:18]), |
---|
195 | .din2 (din2[20:18]), |
---|
196 | |
---|
197 | .din2_din1_nz (din2_din1_nz_20_18), |
---|
198 | .din2_din1_denorm (din2_din1_denorm_20_18) |
---|
199 | ); |
---|
200 | |
---|
201 | fpu_denorm_3b i_fpu_denorm_17_15 ( |
---|
202 | .din1 (din1[17:15]), |
---|
203 | .din2 (din2[17:15]), |
---|
204 | |
---|
205 | .din2_din1_nz (din2_din1_nz_17_15), |
---|
206 | .din2_din1_denorm (din2_din1_denorm_17_15) |
---|
207 | ); |
---|
208 | |
---|
209 | fpu_denorm_3b i_fpu_denorm_14_12 ( |
---|
210 | .din1 (din1[14:12]), |
---|
211 | .din2 (din2[14:12]), |
---|
212 | |
---|
213 | .din2_din1_nz (din2_din1_nz_14_12), |
---|
214 | .din2_din1_denorm (din2_din1_denorm_14_12) |
---|
215 | ); |
---|
216 | |
---|
217 | fpu_denorm_3b i_fpu_denorm_11_9 ( |
---|
218 | .din1 (din1[11:9]), |
---|
219 | .din2 (din2[11:9]), |
---|
220 | |
---|
221 | .din2_din1_nz (din2_din1_nz_11_9), |
---|
222 | .din2_din1_denorm (din2_din1_denorm_11_9) |
---|
223 | ); |
---|
224 | |
---|
225 | fpu_denorm_3b i_fpu_denorm_8_6 ( |
---|
226 | .din1 (din1[8:6]), |
---|
227 | .din2 (din2[8:6]), |
---|
228 | |
---|
229 | .din2_din1_nz (din2_din1_nz_8_6), |
---|
230 | .din2_din1_denorm (din2_din1_denorm_8_6) |
---|
231 | ); |
---|
232 | |
---|
233 | fpu_denorm_3b i_fpu_denorm_5_3 ( |
---|
234 | .din1 (din1[5:3]), |
---|
235 | .din2 (din2[5:3]), |
---|
236 | |
---|
237 | .din2_din1_nz (din2_din1_nz_5_3), |
---|
238 | .din2_din1_denorm (din2_din1_denorm_5_3) |
---|
239 | ); |
---|
240 | |
---|
241 | fpu_denorm_3b i_fpu_denorm_2_0 ( |
---|
242 | .din1 (din1[2:0]), |
---|
243 | .din2 (din2[2:0]), |
---|
244 | |
---|
245 | .din2_din1_nz (din2_din1_nz_2_0), |
---|
246 | .din2_din1_denorm (din2_din1_denorm_2_0) |
---|
247 | ); |
---|
248 | |
---|
249 | |
---|
250 | fpu_denorm_3to1 i_fpu_denorm_53_45 ( |
---|
251 | .din2_din1_nz_hi (din2_din1_nz_53_51), |
---|
252 | .din2_din1_denorm_hi (din2_din1_denorm_53_51), |
---|
253 | .din2_din1_nz_mid (din2_din1_nz_50_48), |
---|
254 | .din2_din1_denorm_mid (din2_din1_denorm_50_48), |
---|
255 | .din2_din1_nz_lo (din2_din1_nz_47_45), |
---|
256 | .din2_din1_denorm_lo (din2_din1_denorm_47_45), |
---|
257 | |
---|
258 | .din2_din1_nz (din2_din1_nz_53_45), |
---|
259 | .din2_din1_denorm (din2_din1_denorm_53_45) |
---|
260 | ); |
---|
261 | |
---|
262 | fpu_denorm_3to1 i_fpu_denorm_44_36 ( |
---|
263 | .din2_din1_nz_hi (din2_din1_nz_44_42), |
---|
264 | .din2_din1_denorm_hi (din2_din1_denorm_44_42), |
---|
265 | .din2_din1_nz_mid (din2_din1_nz_41_39), |
---|
266 | .din2_din1_denorm_mid (din2_din1_denorm_41_39), |
---|
267 | .din2_din1_nz_lo (din2_din1_nz_38_36), |
---|
268 | .din2_din1_denorm_lo (din2_din1_denorm_38_36), |
---|
269 | |
---|
270 | .din2_din1_nz (din2_din1_nz_44_36), |
---|
271 | .din2_din1_denorm (din2_din1_denorm_44_36) |
---|
272 | ); |
---|
273 | |
---|
274 | fpu_denorm_3to1 i_fpu_denorm_35_27 ( |
---|
275 | .din2_din1_nz_hi (din2_din1_nz_35_33), |
---|
276 | .din2_din1_denorm_hi (din2_din1_denorm_35_33), |
---|
277 | .din2_din1_nz_mid (din2_din1_nz_32_30), |
---|
278 | .din2_din1_denorm_mid (din2_din1_denorm_32_30), |
---|
279 | .din2_din1_nz_lo (din2_din1_nz_29_27), |
---|
280 | .din2_din1_denorm_lo (din2_din1_denorm_29_27), |
---|
281 | |
---|
282 | .din2_din1_nz (din2_din1_nz_35_27), |
---|
283 | .din2_din1_denorm (din2_din1_denorm_35_27) |
---|
284 | ); |
---|
285 | |
---|
286 | fpu_denorm_3to1 i_fpu_denorm_26_18 ( |
---|
287 | .din2_din1_nz_hi (din2_din1_nz_26_24), |
---|
288 | .din2_din1_denorm_hi (din2_din1_denorm_26_24), |
---|
289 | .din2_din1_nz_mid (din2_din1_nz_23_21), |
---|
290 | .din2_din1_denorm_mid (din2_din1_denorm_23_21), |
---|
291 | .din2_din1_nz_lo (din2_din1_nz_20_18), |
---|
292 | .din2_din1_denorm_lo (din2_din1_denorm_20_18), |
---|
293 | |
---|
294 | .din2_din1_nz (din2_din1_nz_26_18), |
---|
295 | .din2_din1_denorm (din2_din1_denorm_26_18) |
---|
296 | ); |
---|
297 | |
---|
298 | fpu_denorm_3to1 i_fpu_denorm_17_9 ( |
---|
299 | .din2_din1_nz_hi (din2_din1_nz_17_15), |
---|
300 | .din2_din1_denorm_hi (din2_din1_denorm_17_15), |
---|
301 | .din2_din1_nz_mid (din2_din1_nz_14_12), |
---|
302 | .din2_din1_denorm_mid (din2_din1_denorm_14_12), |
---|
303 | .din2_din1_nz_lo (din2_din1_nz_11_9), |
---|
304 | .din2_din1_denorm_lo (din2_din1_denorm_11_9), |
---|
305 | |
---|
306 | .din2_din1_nz (din2_din1_nz_17_9), |
---|
307 | .din2_din1_denorm (din2_din1_denorm_17_9) |
---|
308 | ); |
---|
309 | |
---|
310 | fpu_denorm_3to1 i_fpu_denorm_8_0 ( |
---|
311 | .din2_din1_nz_hi (din2_din1_nz_8_6), |
---|
312 | .din2_din1_denorm_hi (din2_din1_denorm_8_6), |
---|
313 | .din2_din1_nz_mid (din2_din1_nz_5_3), |
---|
314 | .din2_din1_denorm_mid (din2_din1_denorm_5_3), |
---|
315 | .din2_din1_nz_lo (din2_din1_nz_2_0), |
---|
316 | .din2_din1_denorm_lo (din2_din1_denorm_2_0), |
---|
317 | |
---|
318 | .din2_din1_nz (din2_din1_nz_8_0), |
---|
319 | .din2_din1_denorm (din2_din1_denorm_8_0) |
---|
320 | ); |
---|
321 | |
---|
322 | |
---|
323 | fpu_denorm_3to1 i_fpu_denorm_53_27 ( |
---|
324 | .din2_din1_nz_hi (din2_din1_nz_53_45), |
---|
325 | .din2_din1_denorm_hi (din2_din1_denorm_53_45), |
---|
326 | .din2_din1_nz_mid (din2_din1_nz_44_36), |
---|
327 | .din2_din1_denorm_mid (din2_din1_denorm_44_36), |
---|
328 | .din2_din1_nz_lo (din2_din1_nz_35_27), |
---|
329 | .din2_din1_denorm_lo (din2_din1_denorm_35_27), |
---|
330 | |
---|
331 | .din2_din1_nz (din2_din1_nz_53_27), |
---|
332 | .din2_din1_denorm (din2_din1_denorm_53_27) |
---|
333 | ); |
---|
334 | |
---|
335 | fpu_denorm_3to1 i_fpu_denorm_26_0 ( |
---|
336 | .din2_din1_nz_hi (din2_din1_nz_26_18), |
---|
337 | .din2_din1_denorm_hi (din2_din1_denorm_26_18), |
---|
338 | .din2_din1_nz_mid (din2_din1_nz_17_9), |
---|
339 | .din2_din1_denorm_mid (din2_din1_denorm_17_9), |
---|
340 | .din2_din1_nz_lo (din2_din1_nz_8_0), |
---|
341 | .din2_din1_denorm_lo (din2_din1_denorm_8_0), |
---|
342 | |
---|
343 | .din2_din1_nz (din2_din1_nz_26_0), |
---|
344 | .din2_din1_denorm (din2_din1_denorm_26_0) |
---|
345 | ); |
---|
346 | |
---|
347 | |
---|
348 | assign din2_din1_denorm= (din2_din1_nz_53_27 && din2_din1_denorm_53_27) |
---|
349 | || ((!din2_din1_nz_53_27) && (!din2_din1_nz_26_0)) |
---|
350 | || ((!din2_din1_nz_53_27) && din2_din1_denorm_26_0); |
---|
351 | |
---|
352 | assign din2_din1_denorm_inv= (!din2_din1_denorm); |
---|
353 | |
---|
354 | assign din2_din1_denorma= din2_din1_denorm; |
---|
355 | |
---|
356 | assign din2_din1_denorm_inva= din2_din1_denorm_inv; |
---|
357 | |
---|
358 | |
---|
359 | endmodule |
---|
360 | |
---|
361 | |
---|