[6] | 1 | // ========== Copyright Header Begin ========================================== |
---|
| 2 | // |
---|
| 3 | // OpenSPARC T1 Processor File: fpu_in2_gt_in1_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 can have any value. |
---|
| 24 | // |
---|
| 25 | /////////////////////////////////////////////////////////////////////////////// |
---|
| 26 | |
---|
| 27 | module fpu_in2_gt_in1_frac ( |
---|
| 28 | din1, |
---|
| 29 | din2, |
---|
| 30 | sngop, |
---|
| 31 | expadd11, |
---|
| 32 | expeq, |
---|
| 33 | |
---|
| 34 | din2_neq_din1, |
---|
| 35 | din2_gt_din1, |
---|
| 36 | din2_gt1_din1 |
---|
| 37 | ); |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | input [54:0] din1; // input 1- fraction |
---|
| 41 | input [54:0] din2; // input 2- fraction |
---|
| 42 | input sngop; // single precision inputs |
---|
| 43 | input expadd11; // exponent sign bit |
---|
| 44 | input expeq; // exponent are equal |
---|
| 45 | |
---|
| 46 | output din2_neq_din1; // input 2 != input 1- fraction |
---|
| 47 | output din2_gt_din1; // input 2 > input 1- fraction |
---|
| 48 | output din2_gt1_din1; // input 2 > input 1 |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | wire din2_neq_din1_54_52; |
---|
| 52 | wire din2_gt_din1_54_52; |
---|
| 53 | wire din2_neq_din1_51_50; |
---|
| 54 | wire din2_gt_din1_51_50; |
---|
| 55 | wire din2_neq_din1_49_48; |
---|
| 56 | wire din2_gt_din1_49_48; |
---|
| 57 | wire din2_neq_din1_47_45; |
---|
| 58 | wire din2_gt_din1_47_45; |
---|
| 59 | wire din2_neq_din1_44_42; |
---|
| 60 | wire din2_gt_din1_44_42; |
---|
| 61 | wire din2_neq_din1_41_39; |
---|
| 62 | wire din2_gt_din1_41_39; |
---|
| 63 | wire din2_neq_din1_38_36; |
---|
| 64 | wire din2_gt_din1_38_36; |
---|
| 65 | wire din2_neq_din1_35_33; |
---|
| 66 | wire din2_gt_din1_35_33; |
---|
| 67 | wire din2_neq_din1_32_30; |
---|
| 68 | wire din2_gt_din1_32_30; |
---|
| 69 | wire din2_neq_din1_29_27; |
---|
| 70 | wire din2_gt_din1_29_27; |
---|
| 71 | wire din2_neq_din1_26_24; |
---|
| 72 | wire din2_gt_din1_26_24; |
---|
| 73 | wire din2_neq_din1_23_21; |
---|
| 74 | wire din2_gt_din1_23_21; |
---|
| 75 | wire din2_neq_din1_20_18; |
---|
| 76 | wire din2_gt_din1_20_18; |
---|
| 77 | wire din2_neq_din1_17_15; |
---|
| 78 | wire din2_gt_din1_17_15; |
---|
| 79 | wire din2_neq_din1_14_12; |
---|
| 80 | wire din2_gt_din1_14_12; |
---|
| 81 | wire din2_neq_din1_11_9; |
---|
| 82 | wire din2_gt_din1_11_9; |
---|
| 83 | wire din2_neq_din1_8_6; |
---|
| 84 | wire din2_gt_din1_8_6; |
---|
| 85 | wire din2_neq_din1_5_3; |
---|
| 86 | wire din2_gt_din1_5_3; |
---|
| 87 | wire din2_neq_din1_2_0; |
---|
| 88 | wire din2_gt_din1_2_0; |
---|
| 89 | wire din2_neq_din1_51_45; |
---|
| 90 | wire din2_gt_din1_51_45; |
---|
| 91 | wire din2_neq_din1_44_36; |
---|
| 92 | wire din2_gt_din1_44_36; |
---|
| 93 | wire din2_neq_din1_35_27; |
---|
| 94 | wire din2_gt_din1_35_27; |
---|
| 95 | wire din2_neq_din1_26_18; |
---|
| 96 | wire din2_gt_din1_26_18; |
---|
| 97 | wire din2_neq_din1_17_9; |
---|
| 98 | wire din2_gt_din1_17_9; |
---|
| 99 | wire din2_neq_din1_8_0; |
---|
| 100 | wire din2_gt_din1_8_0; |
---|
| 101 | wire din2_neq_din1_51_27; |
---|
| 102 | wire din2_gt_din1_51_27; |
---|
| 103 | wire din2_neq_din1_26_0; |
---|
| 104 | wire din2_gt_din1_26_0; |
---|
| 105 | wire din2_neq_din1; |
---|
| 106 | wire din2_gt_din1; |
---|
| 107 | wire din2_gt1_din1; |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_54_52 ( |
---|
| 111 | .din1 (din1[54:52]), |
---|
| 112 | .din2 (din2[54:52]), |
---|
| 113 | |
---|
| 114 | .din2_neq_din1 (din2_neq_din1_54_52), |
---|
| 115 | .din2_gt_din1 (din2_gt_din1_54_52) |
---|
| 116 | ); |
---|
| 117 | |
---|
| 118 | fpu_in2_gt_in1_2b fpu_in2_gt_in1_51_50 ( |
---|
| 119 | .din1 (din1[51:50]), |
---|
| 120 | .din2 (din2[51:50]), |
---|
| 121 | |
---|
| 122 | .din2_neq_din1 (din2_neq_din1_51_50), |
---|
| 123 | .din2_gt_din1 (din2_gt_din1_51_50) |
---|
| 124 | ); |
---|
| 125 | |
---|
| 126 | fpu_in2_gt_in1_2b fpu_in2_gt_in1_49_48 ( |
---|
| 127 | .din1 (din1[49:48]), |
---|
| 128 | .din2 (din2[49:48]), |
---|
| 129 | |
---|
| 130 | .din2_neq_din1 (din2_neq_din1_49_48), |
---|
| 131 | .din2_gt_din1 (din2_gt_din1_49_48) |
---|
| 132 | ); |
---|
| 133 | |
---|
| 134 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_47_45 ( |
---|
| 135 | .din1 (din1[47:45]), |
---|
| 136 | .din2 (din2[47:45]), |
---|
| 137 | |
---|
| 138 | .din2_neq_din1 (din2_neq_din1_47_45), |
---|
| 139 | .din2_gt_din1 (din2_gt_din1_47_45) |
---|
| 140 | ); |
---|
| 141 | |
---|
| 142 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_44_42 ( |
---|
| 143 | .din1 (din1[44:42]), |
---|
| 144 | .din2 (din2[44:42]), |
---|
| 145 | |
---|
| 146 | .din2_neq_din1 (din2_neq_din1_44_42), |
---|
| 147 | .din2_gt_din1 (din2_gt_din1_44_42) |
---|
| 148 | ); |
---|
| 149 | |
---|
| 150 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_41_39 ( |
---|
| 151 | .din1 (din1[41:39]), |
---|
| 152 | .din2 (din2[41:39]), |
---|
| 153 | |
---|
| 154 | .din2_neq_din1 (din2_neq_din1_41_39), |
---|
| 155 | .din2_gt_din1 (din2_gt_din1_41_39) |
---|
| 156 | ); |
---|
| 157 | |
---|
| 158 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_38_36 ( |
---|
| 159 | .din1 (din1[38:36]), |
---|
| 160 | .din2 (din2[38:36]), |
---|
| 161 | |
---|
| 162 | .din2_neq_din1 (din2_neq_din1_38_36), |
---|
| 163 | .din2_gt_din1 (din2_gt_din1_38_36) |
---|
| 164 | ); |
---|
| 165 | |
---|
| 166 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_35_33 ( |
---|
| 167 | .din1 (din1[35:33]), |
---|
| 168 | .din2 (din2[35:33]), |
---|
| 169 | |
---|
| 170 | .din2_neq_din1 (din2_neq_din1_35_33), |
---|
| 171 | .din2_gt_din1 (din2_gt_din1_35_33) |
---|
| 172 | ); |
---|
| 173 | |
---|
| 174 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_32_30 ( |
---|
| 175 | .din1 (din1[32:30]), |
---|
| 176 | .din2 (din2[32:30]), |
---|
| 177 | |
---|
| 178 | .din2_neq_din1 (din2_neq_din1_32_30), |
---|
| 179 | .din2_gt_din1 (din2_gt_din1_32_30) |
---|
| 180 | ); |
---|
| 181 | |
---|
| 182 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_29_27 ( |
---|
| 183 | .din1 (din1[29:27]), |
---|
| 184 | .din2 (din2[29:27]), |
---|
| 185 | |
---|
| 186 | .din2_neq_din1 (din2_neq_din1_29_27), |
---|
| 187 | .din2_gt_din1 (din2_gt_din1_29_27) |
---|
| 188 | ); |
---|
| 189 | |
---|
| 190 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_26_24 ( |
---|
| 191 | .din1 (din1[26:24]), |
---|
| 192 | .din2 (din2[26:24]), |
---|
| 193 | |
---|
| 194 | .din2_neq_din1 (din2_neq_din1_26_24), |
---|
| 195 | .din2_gt_din1 (din2_gt_din1_26_24) |
---|
| 196 | ); |
---|
| 197 | |
---|
| 198 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_23_21 ( |
---|
| 199 | .din1 (din1[23:21]), |
---|
| 200 | .din2 (din2[23:21]), |
---|
| 201 | |
---|
| 202 | .din2_neq_din1 (din2_neq_din1_23_21), |
---|
| 203 | .din2_gt_din1 (din2_gt_din1_23_21) |
---|
| 204 | ); |
---|
| 205 | |
---|
| 206 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_20_18 ( |
---|
| 207 | .din1 (din1[20:18]), |
---|
| 208 | .din2 (din2[20:18]), |
---|
| 209 | |
---|
| 210 | .din2_neq_din1 (din2_neq_din1_20_18), |
---|
| 211 | .din2_gt_din1 (din2_gt_din1_20_18) |
---|
| 212 | ); |
---|
| 213 | |
---|
| 214 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_17_15 ( |
---|
| 215 | .din1 (din1[17:15]), |
---|
| 216 | .din2 (din2[17:15]), |
---|
| 217 | |
---|
| 218 | .din2_neq_din1 (din2_neq_din1_17_15), |
---|
| 219 | .din2_gt_din1 (din2_gt_din1_17_15) |
---|
| 220 | ); |
---|
| 221 | |
---|
| 222 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_14_12 ( |
---|
| 223 | .din1 (din1[14:12]), |
---|
| 224 | .din2 (din2[14:12]), |
---|
| 225 | |
---|
| 226 | .din2_neq_din1 (din2_neq_din1_14_12), |
---|
| 227 | .din2_gt_din1 (din2_gt_din1_14_12) |
---|
| 228 | ); |
---|
| 229 | |
---|
| 230 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_11_9 ( |
---|
| 231 | .din1 (din1[11:9]), |
---|
| 232 | .din2 (din2[11:9]), |
---|
| 233 | |
---|
| 234 | .din2_neq_din1 (din2_neq_din1_11_9), |
---|
| 235 | .din2_gt_din1 (din2_gt_din1_11_9) |
---|
| 236 | ); |
---|
| 237 | |
---|
| 238 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_8_6 ( |
---|
| 239 | .din1 (din1[8:6]), |
---|
| 240 | .din2 (din2[8:6]), |
---|
| 241 | |
---|
| 242 | .din2_neq_din1 (din2_neq_din1_8_6), |
---|
| 243 | .din2_gt_din1 (din2_gt_din1_8_6) |
---|
| 244 | ); |
---|
| 245 | |
---|
| 246 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_5_3 ( |
---|
| 247 | .din1 (din1[5:3]), |
---|
| 248 | .din2 (din2[5:3]), |
---|
| 249 | |
---|
| 250 | .din2_neq_din1 (din2_neq_din1_5_3), |
---|
| 251 | .din2_gt_din1 (din2_gt_din1_5_3) |
---|
| 252 | ); |
---|
| 253 | |
---|
| 254 | fpu_in2_gt_in1_3b fpu_in2_gt_in1_2_0 ( |
---|
| 255 | .din1 (din1[2:0]), |
---|
| 256 | .din2 (din2[2:0]), |
---|
| 257 | |
---|
| 258 | .din2_neq_din1 (din2_neq_din1_2_0), |
---|
| 259 | .din2_gt_din1 (din2_gt_din1_2_0) |
---|
| 260 | ); |
---|
| 261 | |
---|
| 262 | |
---|
| 263 | fpu_in2_gt_in1_3to1 fpu_in2_gt_in1_51_45 ( |
---|
| 264 | .din2_neq_din1_hi (din2_neq_din1_51_50), |
---|
| 265 | .din2_gt_din1_hi (din2_gt_din1_51_50), |
---|
| 266 | .din2_neq_din1_mid (din2_neq_din1_49_48), |
---|
| 267 | .din2_gt_din1_mid (din2_gt_din1_49_48), |
---|
| 268 | .din2_neq_din1_lo (din2_neq_din1_47_45), |
---|
| 269 | .din2_gt_din1_lo (din2_gt_din1_47_45), |
---|
| 270 | |
---|
| 271 | .din2_neq_din1 (din2_neq_din1_51_45), |
---|
| 272 | .din2_gt_din1 (din2_gt_din1_51_45) |
---|
| 273 | ); |
---|
| 274 | |
---|
| 275 | fpu_in2_gt_in1_3to1 fpu_in2_gt_in1_44_36 ( |
---|
| 276 | .din2_neq_din1_hi (din2_neq_din1_44_42), |
---|
| 277 | .din2_gt_din1_hi (din2_gt_din1_44_42), |
---|
| 278 | .din2_neq_din1_mid (din2_neq_din1_41_39), |
---|
| 279 | .din2_gt_din1_mid (din2_gt_din1_41_39), |
---|
| 280 | .din2_neq_din1_lo (din2_neq_din1_38_36), |
---|
| 281 | .din2_gt_din1_lo (din2_gt_din1_38_36), |
---|
| 282 | |
---|
| 283 | .din2_neq_din1 (din2_neq_din1_44_36), |
---|
| 284 | .din2_gt_din1 (din2_gt_din1_44_36) |
---|
| 285 | ); |
---|
| 286 | |
---|
| 287 | fpu_in2_gt_in1_3to1 fpu_in2_gt_in1_35_27 ( |
---|
| 288 | .din2_neq_din1_hi (din2_neq_din1_35_33), |
---|
| 289 | .din2_gt_din1_hi (din2_gt_din1_35_33), |
---|
| 290 | .din2_neq_din1_mid (din2_neq_din1_32_30), |
---|
| 291 | .din2_gt_din1_mid (din2_gt_din1_32_30), |
---|
| 292 | .din2_neq_din1_lo (din2_neq_din1_29_27), |
---|
| 293 | .din2_gt_din1_lo (din2_gt_din1_29_27), |
---|
| 294 | |
---|
| 295 | .din2_neq_din1 (din2_neq_din1_35_27), |
---|
| 296 | .din2_gt_din1 (din2_gt_din1_35_27) |
---|
| 297 | ); |
---|
| 298 | |
---|
| 299 | fpu_in2_gt_in1_3to1 fpu_in2_gt_in1_26_18 ( |
---|
| 300 | .din2_neq_din1_hi (din2_neq_din1_26_24), |
---|
| 301 | .din2_gt_din1_hi (din2_gt_din1_26_24), |
---|
| 302 | .din2_neq_din1_mid (din2_neq_din1_23_21), |
---|
| 303 | .din2_gt_din1_mid (din2_gt_din1_23_21), |
---|
| 304 | .din2_neq_din1_lo (din2_neq_din1_20_18), |
---|
| 305 | .din2_gt_din1_lo (din2_gt_din1_20_18), |
---|
| 306 | |
---|
| 307 | .din2_neq_din1 (din2_neq_din1_26_18), |
---|
| 308 | .din2_gt_din1 (din2_gt_din1_26_18) |
---|
| 309 | ); |
---|
| 310 | |
---|
| 311 | fpu_in2_gt_in1_3to1 fpu_in2_gt_in1_17_9 ( |
---|
| 312 | .din2_neq_din1_hi (din2_neq_din1_17_15), |
---|
| 313 | .din2_gt_din1_hi (din2_gt_din1_17_15), |
---|
| 314 | .din2_neq_din1_mid (din2_neq_din1_14_12), |
---|
| 315 | .din2_gt_din1_mid (din2_gt_din1_14_12), |
---|
| 316 | .din2_neq_din1_lo (din2_neq_din1_11_9), |
---|
| 317 | .din2_gt_din1_lo (din2_gt_din1_11_9), |
---|
| 318 | |
---|
| 319 | .din2_neq_din1 (din2_neq_din1_17_9), |
---|
| 320 | .din2_gt_din1 (din2_gt_din1_17_9) |
---|
| 321 | ); |
---|
| 322 | |
---|
| 323 | fpu_in2_gt_in1_3to1 fpu_in2_gt_in1_8_0 ( |
---|
| 324 | .din2_neq_din1_hi (din2_neq_din1_8_6), |
---|
| 325 | .din2_gt_din1_hi (din2_gt_din1_8_6), |
---|
| 326 | .din2_neq_din1_mid (din2_neq_din1_5_3), |
---|
| 327 | .din2_gt_din1_mid (din2_gt_din1_5_3), |
---|
| 328 | .din2_neq_din1_lo (din2_neq_din1_2_0), |
---|
| 329 | .din2_gt_din1_lo (din2_gt_din1_2_0), |
---|
| 330 | |
---|
| 331 | .din2_neq_din1 (din2_neq_din1_8_0), |
---|
| 332 | .din2_gt_din1 (din2_gt_din1_8_0) |
---|
| 333 | ); |
---|
| 334 | |
---|
| 335 | |
---|
| 336 | fpu_in2_gt_in1_3to1 fpu_in2_gt_in1_51_27 ( |
---|
| 337 | .din2_neq_din1_hi (din2_neq_din1_51_45), |
---|
| 338 | .din2_gt_din1_hi (din2_gt_din1_51_45), |
---|
| 339 | .din2_neq_din1_mid (din2_neq_din1_44_36), |
---|
| 340 | .din2_gt_din1_mid (din2_gt_din1_44_36), |
---|
| 341 | .din2_neq_din1_lo (din2_neq_din1_35_27), |
---|
| 342 | .din2_gt_din1_lo (din2_gt_din1_35_27), |
---|
| 343 | |
---|
| 344 | .din2_neq_din1 (din2_neq_din1_51_27), |
---|
| 345 | .din2_gt_din1 (din2_gt_din1_51_27) |
---|
| 346 | ); |
---|
| 347 | |
---|
| 348 | fpu_in2_gt_in1_3to1 fpu_in2_gt_in1_26_0 ( |
---|
| 349 | .din2_neq_din1_hi (din2_neq_din1_26_18), |
---|
| 350 | .din2_gt_din1_hi (din2_gt_din1_26_18), |
---|
| 351 | .din2_neq_din1_mid (din2_neq_din1_17_9), |
---|
| 352 | .din2_gt_din1_mid (din2_gt_din1_17_9), |
---|
| 353 | .din2_neq_din1_lo (din2_neq_din1_8_0), |
---|
| 354 | .din2_gt_din1_lo (din2_gt_din1_8_0), |
---|
| 355 | |
---|
| 356 | .din2_neq_din1 (din2_neq_din1_26_0), |
---|
| 357 | .din2_gt_din1 (din2_gt_din1_26_0) |
---|
| 358 | ); |
---|
| 359 | |
---|
| 360 | |
---|
| 361 | assign din2_neq_din1= din2_neq_din1_51_27 |
---|
| 362 | || din2_neq_din1_26_0 |
---|
| 363 | || (din2_neq_din1_54_52 && sngop); |
---|
| 364 | |
---|
| 365 | assign din2_gt_din1= (din2_neq_din1_54_52 && din2_gt_din1_54_52 |
---|
| 366 | && sngop) |
---|
| 367 | || ((!(din2_neq_din1_54_52 && sngop)) |
---|
| 368 | && din2_neq_din1_51_27 && din2_gt_din1_51_27) |
---|
| 369 | || ((!(din2_neq_din1_54_52 && sngop)) |
---|
| 370 | && (!din2_neq_din1_51_27) |
---|
| 371 | && din2_gt_din1_26_0); |
---|
| 372 | |
---|
| 373 | assign din2_gt1_din1= expadd11 |
---|
| 374 | || (din2_gt_din1 && expeq); |
---|
| 375 | |
---|
| 376 | |
---|
| 377 | endmodule |
---|
| 378 | |
---|
| 379 | |
---|