Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: global.h | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #ifndef _G_GLOBAL_H_ | |
39 | #define _G_GLOBAL_H_ | |
40 | #include "/import/vcs-release/vcs7.1R13/include/vcsuser.h" | |
41 | #include "/import/vcs-release/vcs7.1R13/include/acc_user.h" | |
42 | #include "b_ary.h" | |
43 | #include <stdlib.h> | |
44 | #include <string.h> | |
45 | ||
46 | #define KeyType unsigned long long | |
47 | #define BUFFER 1024 | |
48 | #define TAG 16 | |
49 | #define VUAD 8 | |
50 | #define DDATA 1024 | |
51 | #define MAX_BANK 8 | |
52 | #define L2WAY 16 | |
53 | #define SUBBANK 256 //12 | |
54 | #define ERROR_ENJECT 5 | |
55 | #define INDEX 1024 | |
56 | #define IVLD_NUM 512 | |
57 | #define DVLD_NUM 512 | |
58 | #define CPU_NUM 8 | |
59 | #define SCRUB_WAIT 0 | |
60 | ||
61 | //how many way | |
62 | ||
63 | ||
64 | #define UP_BOUND 32 | |
65 | #define WAY_BOUND 64 | |
66 | #define EVEN_BOUND 128 | |
67 | #define BOTTOM 256 | |
68 | #define QUAD 256 | |
69 | #define MAX_CORE 8 | |
70 | //define event record. | |
71 | typedef struct event_record{ | |
72 | int kind; | |
73 | //who trig the event. | |
74 | int type; | |
75 | int thrid; | |
76 | int cpu_id; | |
77 | int reg; | |
78 | int wait, src; | |
79 | int num; | |
80 | int bank; | |
81 | char ch; | |
82 | char* comment; | |
83 | //define vectors | |
84 | int vec; | |
85 | int event_type; | |
86 | } *event_record_ptr; | |
87 | //list structure | |
88 | typedef struct list_node{ | |
89 | KeyType addr; | |
90 | int way; | |
91 | struct list_node *next; | |
92 | ||
93 | } *list_node_ptr; | |
94 | //head node for this list. | |
95 | typedef struct list_head_node{ | |
96 | list_node_ptr head_ptr, tail_ptr; | |
97 | int num; | |
98 | ||
99 | }*list_head_ptr; | |
100 | // define avl tree data structure for memory model | |
101 | typedef struct l2warm_avl_node{ | |
102 | long long addr; | |
103 | int state, balance; | |
104 | struct l2warm_avl_node *leftPtr; | |
105 | struct l2warm_avl_node *rightPtr; | |
106 | } *l2warm_avl_node_ptr; | |
107 | ||
108 | typedef struct l2warm_variables{ | |
109 | char *tag_avalPtr [TAG*MAX_BANK]; | |
110 | int tag_num;//hold the size of memory for each index. | |
111 | char *vuad_avalPtr[VUAD*MAX_BANK]; | |
112 | int vuad_num; | |
113 | ||
114 | char *data_avalPtr[DDATA*MAX_BANK]; | |
115 | int data_num; | |
116 | int bank_type;//number of bank | |
117 | ||
118 | int check_range; | |
119 | int l2_warm, l1_warm; | |
120 | int bank, tag, l2_index, way; | |
121 | long long low_bound, up_bound; | |
122 | int tag_data; | |
123 | int turn_on_valid, valid_bit, dirty_bit; | |
124 | char *avalPtr, *bvalPtr; | |
125 | char slam_data[20]; | |
126 | char vuad_unpk[160]; | |
127 | int low_vuad, up_vuad; | |
128 | char l1line[20], ecc[4]; | |
129 | char parts[MAX_BANK][3]; | |
130 | int round_robin[MAX_BANK]; | |
131 | bool blackboard[MAX_BANK][L2WAY][16]; | |
132 | int turn_on_dirty, turn_off_dirty; | |
133 | int err_enjection, replace, uncorrect_err; | |
134 | ||
135 | int warm_all; | |
136 | int l2run_error; | |
137 | int cpu_invalid; | |
138 | int vld_counter; | |
139 | int cpu; | |
140 | int l2_bank; | |
141 | ||
142 | int rcheck_range, l2run_percent ; | |
143 | long long mask_addr, rlow_bound, rup_bound; | |
144 | char staledata[64]; | |
145 | s_tfnodeinfo node_info; | |
146 | int idx; | |
147 | int stale_idx; | |
148 | int wren; | |
149 | int tag_pend, tag_pidx[4], tag_pos[4], tag_way[4]; | |
150 | int tag_pend_now, tag_pidx_now[4], tag_pos_now[4], tag_way_now[4]; | |
151 | int data_pend, data_pidx[4], data_pos[4], data_way[4]; | |
152 | int data_pend_now, data_pidx_now[4], data_pos_now[4], data_way_now[4]; | |
153 | int taken_d, taken_t, not_taken_d, not_taken_t; | |
154 | ||
155 | int core_type; | |
156 | int l2mask, l1mask; | |
157 | int selected; | |
158 | l2warm_avl_node_ptr avl_ptr; | |
159 | int redundancy; | |
160 | int wayLayout[16]; | |
161 | int tagWay[16]; | |
162 | int tagPos[16]; | |
163 | //loadand go | |
164 | int loadandgo; | |
165 | }*l2warm_variablesPtr ; | |
166 | ||
167 | typedef struct l1warm_variables{ | |
168 | ||
169 | //argment holder. | |
170 | long long low_ibound, up_ibound, | |
171 | low_dbound, up_dbound; | |
172 | int bank, row, pair, tag, itag, dtag, check_irange, check_drange, | |
173 | panel, col, way, cpu, entry, cache; | |
174 | int cpu_status, cpu_num; | |
175 | int cpu_ptr[MAX_CORE], cpu_chose[MAX_CORE]; | |
176 | s_tfnodeinfo node_info; | |
177 | char *avalPtr, *bvalPtr; | |
178 | int l1_debug; | |
179 | //l2 directory array. | |
180 | int idir_num, ddir_num; | |
181 | int icache, idone; | |
182 | int dcache, ddone; | |
183 | long long temp_val; | |
184 | ||
185 | char *dir_iarray[8 * MAX_BANK]; | |
186 | long long dir_ivalid[8 * MAX_BANK]; | |
187 | long long dir_iparity[8* MAX_BANK]; | |
188 | long long dir_iaddr4[8 * MAX_BANK]; | |
189 | ||
190 | char *dir_darray[8 * MAX_BANK]; | |
191 | long long dir_dvalid[8 * MAX_BANK]; | |
192 | long long dir_dparity[8 * MAX_BANK]; | |
193 | long long dir_daddr4[8 * MAX_BANK]; | |
194 | ||
195 | //dcache info. | |
196 | int dcache_num, dtag_num, dvalid_num; | |
197 | char *dcache_w[MAX_CORE][4]; | |
198 | char *dcache_tag[MAX_CORE][4]; | |
199 | int dcache_vld[MAX_CORE]; | |
200 | ||
201 | int icache_num, itag_num, ivalid_num; | |
202 | char *icache_data[MAX_CORE][16]; | |
203 | char *icache_tag[MAX_CORE][8]; | |
204 | int icache_vld[MAX_CORE]; | |
205 | //bank mode | |
206 | int l2mask,l2bank_type, l2way; | |
207 | int iround; | |
208 | }*l1warm_variablesPtr; | |
209 | ||
210 | //static struct l2warm_variables l2warm_vars; | |
211 | ||
212 | #endif |