Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: footer.H | |
5 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
7 | * | |
8 | * The above named program is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU General Public | |
10 | * License version 2 as published by the Free Software Foundation. | |
11 | * | |
12 | * The above named program is distributed in the hope that it will be | |
13 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public | |
18 | * License along with this work; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | * | |
21 | * ========== Copyright Header End ============================================ | |
22 | */ | |
23 | // ========== Copyright Header Begin ========================================== | |
24 | // | |
25 | // OpenSPARC T2 Processor File: footer.H | |
26 | // Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
27 | // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
28 | // | |
29 | // The above named program is free software; you can redistribute it and/or | |
30 | // modify it under the terms of the GNU General Public | |
31 | // License version 2 as published by the Free Software Foundation. | |
32 | // | |
33 | // The above named program is distributed in the hope that it will be | |
34 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
35 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
36 | // General Public License for more details. | |
37 | // | |
38 | // You should have received a copy of the GNU General Public | |
39 | // License along with this work; if not, write to the Free Software | |
40 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
41 | // | |
42 | // ========== Copyright Header End ============================================ | |
43 | #ifndef _FOOTER_H | |
44 | #define _FOOTER_H | |
45 | ||
46 | class RstzipFooter { | |
47 | public: | |
48 | uint32_t max_chunksize; | |
49 | uint64_t total_instr; | |
50 | uint64_t total_noninstr; | |
51 | uint64_t total_loop_chunk; | |
52 | uint64_t total_nonloop_chunk; | |
53 | uint64_t total_zpavadiff; | |
54 | uint64_t total_pavadiff; | |
55 | uint64_t zero_offset_count; | |
56 | uint64_t offset_count[OFFSET_64BITS_IDX + 1]; | |
57 | uint64_t chunksize_count[CHUNKSIZE_RES]; | |
58 | ||
59 | RstzipFooter() { | |
60 | init(); | |
61 | } | |
62 | ||
63 | void init() { | |
64 | int i; | |
65 | ||
66 | max_chunksize = 0; | |
67 | total_instr = 0; | |
68 | total_noninstr = 0; | |
69 | total_loop_chunk = 0; | |
70 | total_nonloop_chunk = 0; | |
71 | total_zpavadiff = 0; | |
72 | total_pavadiff = 0; | |
73 | zero_offset_count = 0; | |
74 | ||
75 | for (i = 0; i < OFFSET_64BITS_IDX + 1; i++) { | |
76 | offset_count[i] = 0; | |
77 | } | |
78 | ||
79 | for (i = 0; i < CHUNKSIZE_RES; i++) { | |
80 | chunksize_count[i] = 0; | |
81 | } | |
82 | } | |
83 | ||
84 | void fprint(FILE* fp) { | |
85 | int i; | |
86 | ||
87 | fprintf(fp, "\n"); | |
88 | fprintf(fp, "Max chunksize = %d\n", max_chunksize); | |
89 | fprintf(fp, "Total instr recs = %llu\n", total_instr); | |
90 | fprintf(fp, "Total non-instr recs = %llu\n", total_noninstr); | |
91 | fprintf(fp, "Total compressed chunks = %llu\n", total_loop_chunk); | |
92 | fprintf(fp, "Total uncompressed chunks = %llu\n", total_nonloop_chunk); | |
93 | fprintf(fp, "Total compressed pavadiff recs = %llu\n", total_zpavadiff); | |
94 | fprintf(fp, "Total uncompressed pavadiff recs = %llu\n", total_pavadiff - total_zpavadiff); | |
95 | fprintf(fp, "Total EA zero offsets = %llu\n", zero_offset_count); | |
96 | fprintf(fp, "\n"); | |
97 | ||
98 | fprintf(fp, "%14s%14s\n", "EA offset size", "Count"); | |
99 | for (i = 0; i <= OFFSET_64BITS_IDX; i++) { | |
100 | switch (i) { | |
101 | case OFFSET_8BITS_IDX: | |
102 | fprintf(fp, "%-14d%14llu\n", 8, offset_count[i]); | |
103 | break; | |
104 | case OFFSET_8BITS_RESERVED_IDX: | |
105 | fprintf(fp, "%-14d%14llu\n", 8, offset_count[i]); | |
106 | break; | |
107 | case OFFSET_16BITS_IDX: | |
108 | fprintf(fp, "%-14d%14llu\n", 16, offset_count[i]); | |
109 | break; | |
110 | case OFFSET_32BITS_IDX: | |
111 | fprintf(fp, "%-14d%14llu\n", 32, offset_count[i]); | |
112 | break; | |
113 | case OFFSET_64BITS_IDX: | |
114 | fprintf(fp, "%-14d%14llu\n", 64, offset_count[i]); | |
115 | break; | |
116 | } | |
117 | } | |
118 | fprintf(fp, "\n"); | |
119 | ||
120 | fprintf(fp, "%-14s%14s\n", "Chunk size", "Count"); | |
121 | for (i = 0; i < CHUNKSIZE_RES; i++) { | |
122 | switch (i) { | |
123 | case 0: | |
124 | fprintf(fp, "%-14s%14llu\n", " 0-99", chunksize_count[i]); | |
125 | break; | |
126 | case 1: | |
127 | fprintf(fp, "%-14s%14llu\n", "100-199", chunksize_count[i]); | |
128 | break; | |
129 | case 2: | |
130 | fprintf(fp, "%-14s%14llu\n", "200-299", chunksize_count[i]); | |
131 | break; | |
132 | case 3: | |
133 | fprintf(fp, "%-14s%14llu\n", "300-399", chunksize_count[i]); | |
134 | break; | |
135 | case 4: | |
136 | fprintf(fp, "%-14s%14llu\n", "400-499", chunksize_count[i]); | |
137 | break; | |
138 | case 5: | |
139 | fprintf(fp, "%-14s%14llu\n", "500-599", chunksize_count[i]); | |
140 | break; | |
141 | case 6: | |
142 | fprintf(fp, "%-14s%14llu\n", "600-699", chunksize_count[i]); | |
143 | break; | |
144 | case 7: | |
145 | fprintf(fp, "%-14s%14llu\n", "700-799", chunksize_count[i]); | |
146 | break; | |
147 | case 8: | |
148 | fprintf(fp, "%-14s%14llu\n", "800-899", chunksize_count[i]); | |
149 | break; | |
150 | case 9: | |
151 | fprintf(fp, "%-14s%14llu\n", "900- ", chunksize_count[i]); | |
152 | break; | |
153 | } | |
154 | } | |
155 | fprintf(fp, "\n"); | |
156 | } | |
157 | }; // RstzipFooter | |
158 | ||
159 | #endif // _FOOTER_H |