source: XOpenSparcT1/trunk/T1-FPU/fpu_cnt_lead0_lvl4.v @ 6

Revision 6, 2.8 KB checked in by pntsvt00, 13 years ago (diff)

versione iniziale opensparc

Line 
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T1 Processor File: fpu_cnt_lead0_lvl4.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//      4th level of lead 0 counters.  Lead 0 count for 32 bits.
24//
25///////////////////////////////////////////////////////////////////////////////
26
27module fpu_cnt_lead0_lvl4 (
28        din_31_16_eq_0,
29        din_31_24_eq_0,
30        lead0_16b_2_hi,
31        lead0_16b_1_hi,
32        lead0_16b_0_hi,
33        din_15_0_eq_0,
34        din_15_8_eq_0,
35        lead0_16b_2_lo,
36        lead0_16b_1_lo,
37        lead0_16b_0_lo,
38
39        din_31_0_eq_0,
40        lead0_32b_3,
41        lead0_32b_2,
42        lead0_32b_1,
43        lead0_32b_0
44);
45
46
47input           din_31_16_eq_0;         // data in[31:16] is zero
48input           din_31_24_eq_0;         // data in[31:24] is zero
49input           lead0_16b_2_hi;         // bit[2] of lead 0 count- din[31:16]
50input           lead0_16b_1_hi;         // bit[1] of lead 0 count- din[31:16]
51input           lead0_16b_0_hi;         // bit[0] of lead 0 count- din[31:16]
52input           din_15_0_eq_0;          // data in[15:0] is zero
53input           din_15_8_eq_0;          // data in[15:8] is zero
54input           lead0_16b_2_lo;         // bit[2] of lead 0 count- din[15:0]
55input           lead0_16b_1_lo;         // bit[1] of lead 0 count- din[15:0]
56input           lead0_16b_0_lo;         // bit[0] of lead 0 count- din[15:0]
57
58output          din_31_0_eq_0;          // data in[31:0] is zero
59output          lead0_32b_3;            // bit[3] of lead 0 count
60output          lead0_32b_2;            // bit[2] of lead 0 count
61output          lead0_32b_1;            // bit[1] of lead 0 count
62output          lead0_32b_0;            // bit[0] of lead 0 count
63
64
65wire            din_31_0_eq_0;
66wire            lead0_32b_3;
67wire            lead0_32b_2;
68wire            lead0_32b_1;
69wire            lead0_32b_0;
70
71
72assign din_31_0_eq_0= din_15_0_eq_0 && din_31_16_eq_0;
73
74assign lead0_32b_3= ((!din_31_16_eq_0) && din_31_24_eq_0)
75                || (din_31_16_eq_0 && din_15_8_eq_0);
76
77assign lead0_32b_2= ((!din_31_16_eq_0) && lead0_16b_2_hi)
78                || (din_31_16_eq_0 && lead0_16b_2_lo);
79
80assign lead0_32b_1= ((!din_31_16_eq_0) && lead0_16b_1_hi)
81                || (din_31_16_eq_0 && lead0_16b_1_lo);
82
83assign lead0_32b_0= ((!din_31_16_eq_0) && lead0_16b_0_hi)
84                || (din_31_16_eq_0 && lead0_16b_0_lo);
85
86
87endmodule
88
89
Note: See TracBrowser for help on using the repository browser.