Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: sparcParams.vr | |
4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
6 | // | |
7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
8 | // | |
9 | // This program is free software; you can redistribute it and/or modify | |
10 | // it under the terms of the GNU General Public License as published by | |
11 | // the Free Software Foundation; version 2 of the License. | |
12 | // | |
13 | // This program is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | // | |
18 | // You should have received a copy of the GNU General Public License | |
19 | // along with this program; if not, write to the Free Software | |
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | // | |
22 | // For the avoidance of doubt, and except that if any non-GPL license | |
23 | // choice is available it will apply instead, Sun elects to use only | |
24 | // the General Public License version 2 (GPLv2) at this time for any | |
25 | // software where a choice of GPL license versions is made | |
26 | // available with the language indicating that GPLv2 or any later version | |
27 | // may be used, or where a choice of which version of the GPL is applied is | |
28 | // otherwise unspecified. | |
29 | // | |
30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
31 | // CA 95054 USA or visit www.sun.com if you need additional information or | |
32 | // have any questions. | |
33 | // | |
34 | // ========== Copyright Header End ============================================ | |
35 | #include <vera_defines.vrh> | |
36 | #include <globals.vri> | |
37 | ||
38 | // defines | |
39 | #include <plusArgMacros.vri> | |
40 | #include <ccx.vri> | |
41 | #include <std_display_defines.vri> | |
42 | #include <baseParamDefines.vri> | |
43 | ||
44 | // classes | |
45 | #include <std_display_class.vrh> | |
46 | #include <baseParamsClass.vrh> | |
47 | ||
48 | class Params extends BaseParams { | |
49 | ||
50 | local string className = "paramsClass"; | |
51 | local StandardDisplay dbg; | |
52 | ||
53 | // Temporary/scratch variables | |
54 | local string tempstr, tempstr2; | |
55 | local reg [2048:0] getstr; | |
56 | local integer i; | |
57 | local bit [63:0] tmp; | |
58 | ||
59 | // misc | |
60 | integer coreCount = 0; | |
61 | ||
62 | ||
63 | /////////////////////////////////////// | |
64 | // variables that only come in as +args (not in a config file) | |
65 | ||
66 | string paramPath = null; | |
67 | string paramFile = null; | |
68 | string forceParamFile = null; | |
69 | string dv_root = null; | |
70 | // reg [63:0] thread_enables = 1; | |
71 | ||
72 | // CCX | |
73 | reg ccxPktPrint [5]; // print packets | |
74 | reg [16:0] ccxPktPrintMask = 0; | |
75 | reg ccxPktPrintOn = 0; | |
76 | ||
77 | // MCU | |
78 | reg mcuMemPrint [2]; | |
79 | reg mcuMemPrintOn = 0; | |
80 | ||
81 | string veraDiagName = null; | |
82 | string asmDiagName = null; | |
83 | ||
84 | // | |
85 | /////////////////////////////////////// | |
86 | ||
87 | ||
88 | /////////////////////////////////////// | |
89 | // config file paramaters (can also be +args) | |
90 | ||
91 | // -- SPC2 specific | |
92 | reg stub_l1_enable; // if 0, disable tag table updates in ccx stub | |
93 | reg [7:0] min_ccx_gnt_delay; | |
94 | reg [7:0] max_ccx_gnt_delay; | |
95 | reg rand_ccx_gnt_enable; | |
96 | reg l2latOn; // To use L2 latency values from file | |
97 | reg l2lat_fixed; // Allow L2 latency to vary | |
98 | integer l2lat_value; // L2 latency between gnt and gnt_data | |
99 | // file names | |
100 | string l2lat_in = null; | |
101 | integer FPl2lat; // Used for file pointers | |
102 | ||
103 | // SPC2 debug testing | |
104 | reg noDebugDrv; | |
105 | reg noDebugChecks; | |
106 | reg noDebugModes; | |
107 | reg showDebugCounts; | |
108 | reg wmrVecMask; | |
109 | integer ssModeFreq; | |
110 | integer ssModeMaxSessions; | |
111 | integer ssModeInterleaveWeight; | |
112 | reg [7:0] ssModeTidMask; | |
113 | integer ssModeMin; | |
114 | integer ssModeMax; | |
115 | integer ssModeBurstMin; | |
116 | integer ssModeBurstMax; | |
117 | integer ssModeHolesMin; | |
118 | integer ssModeHolesMax; | |
119 | integer doModeFreq; | |
120 | integer doModeMaxSessions; | |
121 | reg [7:0] doModeTidMask; | |
122 | integer doModeLenMin; | |
123 | integer doModeLenMax; | |
124 | integer softStopFreq; | |
125 | integer softStopMaxSessions; | |
126 | reg [7:0] softStopTidMask; | |
127 | integer softStopLenMin; | |
128 | integer softStopLenMax; | |
129 | reg nodebugParkExit; | |
130 | ||
131 | // POR/WMR/MBIST/LBIST | |
132 | reg por_enable; | |
133 | reg lbist_enable; | |
134 | reg [2:0] mbist_mode; | |
135 | reg mbist_enable; | |
136 | reg mbist_errinj; | |
137 | reg [7:0] user_loop_count; | |
138 | reg user_loop_mode; | |
139 | reg [15:0] lbist_abort_count; | |
140 | reg [2:0] lbist_run_count; | |
141 | reg lbist_pgm; | |
142 | reg [23:0] mbist_fail_count; | |
143 | ||
144 | //err | |
145 | integer err_freq; | |
146 | integer err_burst_freq; | |
147 | integer err_burst_len_min; | |
148 | integer err_burst_len_max; | |
149 | integer err_ce_wt; | |
150 | integer err_nd_wt; | |
151 | reg rand_err; | |
152 | reg err_itlb_on; | |
153 | integer err_itlb_freq; | |
154 | reg err_dtlb_on; | |
155 | integer err_dtlb_freq; | |
156 | reg err_ic_on; | |
157 | integer err_ic_freq; | |
158 | reg err_dc_on; | |
159 | integer err_dc_freq; | |
160 | reg err_irf_on; | |
161 | integer err_irf_freq; | |
162 | reg err_frf_on; | |
163 | integer err_frf_freq; | |
164 | reg err_stb_on; | |
165 | integer err_stb_freq; | |
166 | reg err_sca_on; | |
167 | integer err_sca_freq; | |
168 | reg err_tcc_on; | |
169 | integer err_tcc_freq; | |
170 | reg err_tsa_on; | |
171 | integer err_tsa_freq; | |
172 | reg err_mra_on; | |
173 | integer err_mra_freq; | |
174 | reg err_l2c_on; | |
175 | integer err_l2c_freq; | |
176 | reg err_mamem_on; | |
177 | integer err_mamem_freq; | |
178 | // -- end SPC2 specific | |
179 | ||
180 | ||
181 | ||
182 | // Coverage Vars | |
183 | reg coverage_on; | |
184 | reg coverage_off; | |
185 | reg force_save_cov; | |
186 | ||
187 | ||
188 | // CMP regs | |
189 | reg [63:0] coreAvilableReg; | |
190 | reg [63:0] coreEnableReg; | |
191 | // copies reduced to 8 | |
192 | reg [7:0] coreAvilable; | |
193 | reg [7:0] coreEnable; | |
194 | reg [2:0] coreMax = 0; // max/highest core number (0-7) | |
195 | reg [3:0] bank_set_mask = 4'hf; | |
196 | reg [7:0] banksMask = 8'hff; | |
197 | ||
198 | // MCU BFM (CMP bench) | |
199 | integer mcuReq2ackDelayMin; | |
200 | integer mcuReq2ackDelayMax; | |
201 | integer mcuAck2dataDelayMin; | |
202 | integer mcuAck2dataDelayMax; | |
203 | integer mcuIntraDataDelayMin; | |
204 | integer mcuIntraDataDelayMax; | |
205 | integer mcuWrReq2ackDelayMin; | |
206 | integer mcuWrReq2ackDelayMax; | |
207 | integer mcuWrReq2ackFullDelay; | |
208 | ||
209 | // CCX BFMs (CMP/CCM bench) | |
210 | reg [7:0] enableSpcBFM; // instantiate if set | |
211 | reg [7:0] enableMemBFM; // instantiate if set | |
212 | integer stallStart; // start stalling when this many outstanding requests | |
213 | integer stallStop; // stop stalling when this many outstanding requests | |
214 | integer hitRate; // percent of time that shorter "hit" latencies will be used | |
215 | integer hitDelayMin; // min value of latency if "hit" | |
216 | integer hitDelayMax; // max value of latency if "hit" | |
217 | integer missDelayMin; // min value of latency if NOT "hit" | |
218 | integer missDelayMax; // max value of latency if NOT "hit" | |
219 | integer pkt2DelayMin; // min value of latency for second pkt of pair | |
220 | integer pkt2DelayMax; // max value of latency for second pkt of pair | |
221 | ||
222 | integer evictFloodFreq; | |
223 | integer evictFloodAmount; | |
224 | reg [7:0] evictFloodTargets; | |
225 | integer bufferFloodFreq; | |
226 | integer bufferFloodAmount; | |
227 | integer bufferFloodTarget; | |
228 | ||
229 | integer burstAmount; | |
230 | integer burstHoldoff; | |
231 | integer burstSync; | |
232 | ||
233 | ||
234 | // misc | |
235 | reg hash_on; | |
236 | integer por_delay_min; // # clocks between POR packets | |
237 | integer por_delay_max; // # clocks between POR packets | |
238 | reg pokeCorners; // concentrate randoms on corner cases. | |
239 | reg show_store; // Display store data to logfile | |
240 | reg show_load; // Display load data to logfile | |
241 | integer inval_rate; // evict # times per 10000 | |
242 | reg [2:0] inval_type; | |
243 | reg[39:0] inval_pa_min; // eviction pa range | |
244 | reg[39:0] inval_pa_max; | |
245 | reg[1:0] l2miss_type; // 0,1,2 - off, on, random | |
246 | reg forcePORstate; | |
247 | ||
248 | // interrupts | |
249 | integer intr_tid; // 1st TID that get Interrupt packet | |
250 | integer intr_delay; // # clocks between Intr packets | |
251 | integer intr_wait; // # clocks before Intr packets | |
252 | reg [1:0] intr_type; // Ext Intr type value | |
253 | reg [5:0] intr_vect; // Ext Intr vector value | |
254 | reg [63:0] intr_en; // Threads that are enabled to send ext Intr | |
255 | ||
256 | ||
257 | // simulation | |
258 | integer maxCycle; // max clks | |
259 | integer timeOut; // idle | |
260 | ||
261 | reg [63:0] finishMask; | |
262 | ||
263 | ||
264 | task new(StandardDisplay dbgin); | |
265 | task getCfg(string fileName); | |
266 | local task getPlus(); | |
267 | task check4conflict(); | |
268 | } | |
269 | ||
270 | ||
271 | task Params::new(StandardDisplay dbgin) { | |
272 | integer i; | |
273 | ||
274 | this.dbg = dbgin; | |
275 | for (i=0;i<5;i++) ccxPktPrint[i] = 0; | |
276 | for (i=0;i<2;i++) mcuMemPrint[i] = 0; | |
277 | this.getPlus(); | |
278 | this.getCfg(paramFile); | |
279 | } | |
280 | ||
281 | // This is where it all happens. Put all knobs, +args here. | |
282 | // Paramater precedence is: | |
283 | // highest) If paramater is a +arg passed into vcs. | |
284 | // middle) If paramater is in the config/param file. | |
285 | // last) Default value given in getParam call. | |
286 | // There will always be a value. | |
287 | // | |
288 | // Any vera testcase can change knobs on the fly, after the fact, | |
289 | // by calling getCfg(path/testcaseTestConfig.cfg); | |
290 | task Params::getCfg(string fileName = null) | |
291 | { | |
292 | ||
293 | integer i; | |
294 | ||
295 | // check to see if fileName is null or bogus | |
296 | // if so, we will be using defaults only. | |
297 | if (fileName.len() < 3) fileName = null; | |
298 | ||
299 | // "open" config/param/knob file for the testcase, even if null! | |
300 | openFile(fileName); | |
301 | ||
302 | ||
303 | // CMP regs | |
304 | coreAvilableReg = getParam(HEX, "ASI_CORE_AVILABLE", 0, 64'hFFFFFFFFFFFFFFFF, 64'hFF); | |
305 | for (i=0;i<8;i++) | |
306 | if (coreAvilableReg[i*8+7:i*8]) { | |
307 | coreAvilable[i] = 1; | |
308 | coreMax = i; | |
309 | } else coreAvilable[i] = 0; | |
310 | coreEnableReg = getParam(HEX, "ASI_CORE_ENABLE", 0, 64'hFFFFFFFFFFFFFFFF, 64'hFF); | |
311 | for (i=0;i<8;i++) | |
312 | if (coreEnableReg[i*8+7:i*8]) { | |
313 | coreEnable[i] = 1; | |
314 | coreCount++; | |
315 | } | |
316 | else coreEnable[i] = 0; | |
317 | ||
318 | ||
319 | // getParam(type,name,min,max,default,RANDOK) | |
320 | // see base class | |
321 | ||
322 | // partial banks | |
323 | bank_set_mask = getParam(HEX, "bank_set_mask", 1, 4'hf, 4'hf); | |
324 | banksMask[1:0] = {bank_set_mask[0],bank_set_mask[0]}; | |
325 | banksMask[3:2] = {bank_set_mask[1],bank_set_mask[1]}; | |
326 | banksMask[5:4] = {bank_set_mask[2],bank_set_mask[2]}; | |
327 | banksMask[7:6] = {bank_set_mask[3],bank_set_mask[3]}; | |
328 | ||
329 | #ifdef CMP_BENCH | |
330 | // MCU | |
331 | // delay from read request to read ack | |
332 | mcuReq2ackDelayMin = getParam(DEC, "mcuReq2ackDelayMin", 1, 500, 1); | |
333 | mcuReq2ackDelayMax = getParam(DEC, "mcuReq2ackDelayMax", 1, 500, 8); | |
334 | // delay from read ack to read data returning | |
335 | mcuAck2dataDelayMin = getParam(DEC, "mcuAck2dataDelayMin", 1, 500, 4); | |
336 | mcuAck2dataDelayMax = getParam(DEC, "mcuAck2dataDelayMax", 1, 500, 11); | |
337 | // delay between the 4 read data chunks | |
338 | mcuIntraDataDelayMin = getParam(DEC, "mcuIntraDataDelayMin", 1, 16, 1); | |
339 | mcuIntraDataDelayMax = getParam(DEC, "mcuIntraDataDelayMax", 1, 16, 9); | |
340 | // delay from write request to write ack | |
341 | mcuWrReq2ackDelayMin = getParam(DEC, "mcuWrReq2ackDelayMin", 1, 500, 2); | |
342 | mcuWrReq2ackDelayMax = getParam(DEC, "mcuWrReq2ackDelayMax", 1, 500, 5); | |
343 | // every 64 writes, really extend the ack delay as if the 8 write buffers are full. | |
344 | mcuWrReq2ackFullDelay = getParam(DEC, "mcuWrReq2ackFullDelay", 1, 500, 6); | |
345 | #endif | |
346 | ||
347 | // CCX BFMs instantiate if set | |
348 | enableSpcBFM = getParam(HEX, "enableSpcBFM", 0, 8'hff, 8'h00); | |
349 | enableMemBFM = getParam(HEX, "enableMemBFM", 0, 8'hff, 8'h00); | |
350 | ||
351 | // CCX BFMs | |
352 | // getArray(DEC, "knobName", min, max, default, variableName, elementCount); | |
353 | // | |
354 | // percent of time that shorter "hit" latencies will be used | |
355 | hitRate = getParam(DEC, "hitRate", 1, 100, 90); | |
356 | // min value of latency if "hit" | |
357 | hitDelayMin = getParam(DEC, "hitDelayMin", 1, 30, 1); | |
358 | // max value of latency if "hit" | |
359 | hitDelayMax = getParam(DEC, "hitDelayMax", 2, 60, 5); | |
360 | // min value of latency if NOT "hit" | |
361 | missDelayMin = getParam(DEC, "missDelayMin", 1, 100, 10); | |
362 | // max value of latency if NOT "hit" | |
363 | missDelayMax = getParam(DEC, "missDelayMax", 2, 500, 20); | |
364 | // min value of latency for second pkt of pair | |
365 | pkt2DelayMin = getParam(DEC, "pkt2DelayMin", 1, 3, 1); | |
366 | // max value of latency for second pkt of pair | |
367 | pkt2DelayMax = getParam(DEC, "pkt2DelayMax", 1, 5, 3); | |
368 | // start stalling when this many outstanding requests | |
369 | // Number of cores * 8 (should be based on # cores) | |
370 | stallStart = getParam(DEC, "stallStart", 4, 50, coreCount*8); | |
371 | // stallStartNcu = (DEC, "stallStartNcu", 4, 50, coreCount*12); | |
372 | // stop stalling when this many outstanding requests | |
373 | // Number of cores * 8 - 2 (should be based on # cores) | |
374 | stallStop = getParam(DEC, "stallStop", 2, 45, (coreCount*8)-3); | |
375 | ||
376 | // make responses bursty. Will burst once there are this many responses held up. | |
377 | burstAmount = getParam(DEC, "burstAmount", 0, 35, 0); | |
378 | // Will always burst when this many clocks have elapsed. Prevents starvation. | |
379 | burstHoldoff = getParam(DEC, "burstHoldoff", 10, 500, 150); | |
380 | // Setting burstSync will cause all banks to burst at once | |
381 | // if possible. All banks will follow the master bank when it bursts. | |
382 | // +burstSync=master <0-16> port number | |
383 | burstSync = getParam(DEC, "burstSync", 0, 16, 99); | |
384 | ||
385 | // CCX coverage/irritator activity. Flood of bogus evictions. | |
386 | evictFloodFreq = getParam(DEC, "evictFloodFreq", 0, 100000, 0); | |
387 | evictFloodAmount = getParam(DEC, "evictFloodAmount", 1, 100, 10); | |
388 | evictFloodTargets = getParam(HEX, "evictFloodTargets", 1, 8'hff, 1); | |
389 | ||
390 | // CCX coverage/irritator activity. ifills followed by evictions. | |
391 | // Will target any SPC port that does not have a real core. | |
392 | bufferFloodFreq = getParam(DEC, "bufferFloodFreq", 0, 100000, 0); | |
393 | bufferFloodAmount = getParam(DEC, "bufferFloodAmount", 1, 100, 10); | |
394 | bufferFloodTarget = getParam(HEX, "bufferFloodTarget", 0, 7, 7); | |
395 | ||
396 | ||
397 | ||
398 | ||
399 | hash_on = getParam(FLAG, "hash_on", 0, 1, 0); | |
400 | ||
401 | // clocks between POR | |
402 | por_delay_min = getParam(DEC, "por_delay_min", 1, 10000, 25); | |
403 | por_delay_max = getParam(DEC, "por_delay_max", 1, 20000, 200); | |
404 | ||
405 | // FC like state for SPC | |
406 | forcePORstate = getParam(FLAG, "forcePORstate", 0, 1, 0); | |
407 | ||
408 | // concentrate randoms on corner cases (if you coded it that way). | |
409 | pokeCorners = getParam(DEC, "pokeCorners", 0, 1, 0); | |
410 | ||
411 | // interrupts (from spc) | |
412 | // 1st TID that get Interrupt packet | |
413 | intr_tid = getParam(DEC,"intr_tid", 0, 63, RAND, RANDOK); | |
414 | // # clocks between Intr packets | |
415 | intr_delay = getParam(DEC,"intr_delay", 0, 100000, 10); | |
416 | // # clocks before Intr packets | |
417 | intr_wait = getParam(DEC,"intr_wait", 0, 100000, 3000); | |
418 | // Ext Intr type value | |
419 | intr_type = getParam(HEX, "intr_type", 0, 32'hffffffff, INTR_RESET); | |
420 | // Ext Intr vector value | |
421 | intr_vect = getParam(HEX, "intr_vect", 0, 32'hffffffff, INTR_XIR); | |
422 | // Threads that are enabled to send ext Intr | |
423 | intr_en = getParam(HEX, "intr_en", 0, 64'hFFFFFFFFFFFFFFFF, 0); | |
424 | ||
425 | // # times per 10000 to evict | |
426 | inval_rate = getParam(DEC, "inval_rate", 0, 10000, 0); // Default OFF | |
427 | inval_type = getParam(DEC, "inval_type", 1, 7, 1); // Default evict only | |
428 | ||
429 | inval_pa_min = getParam(HEX, "inval_pa_min", 0, 40'hffffffffff, 0); | |
430 | inval_pa_max = getParam(HEX, "inval_pa_max", 0, 40'hffffffffff, 40'hffffffffff); | |
431 | ||
432 | // value that CCX stub will use for l2miss | |
433 | l2miss_type = getParam(HEX, "l2miss_type", 0, 2'h2, 2'h2); | |
434 | ||
435 | // sim | |
436 | maxCycle = getParam(DEC,"max_cycle", 0, MAXINT,MAXINT);//,*,NOWARN); // max clks | |
437 | timeOut = getParam(DEC,"TIMEOUT", 0, MAXINT,MAXINT);//,*,NOWARN); // idle timmer | |
438 | ||
439 | show_store = getParam(FLAG, "show_store", 0, 1, 0); | |
440 | show_load = getParam(FLAG, "show_load", 0, 1, 0); | |
441 | ||
442 | // coverage | |
443 | force_save_cov = getParam(FLAG, "force_save_cov", 0, 1, 0); | |
444 | coverage_on = getParam(FLAG, "coverage_on", 0, 1, 0); | |
445 | coverage_on = ~getParam(FLAG, "coverage_off", 0, 1, 0); | |
446 | ||
447 | ||
448 | ||
449 | // // | |
450 | // debug logic testing // | |
451 | // // | |
452 | #ifdef SPC_BENCH | |
453 | // enable warm reset vector | |
454 | wmrVecMask = getParam(FLAG, "wmrVecMask", 0, 1, 0); | |
455 | // enable fast boot | |
456 | wmrVecMask = getParam(FLAG, "fast_boot", 0, 1, 0); // alias | |
457 | // do not use | |
458 | showDebugCounts = getParam(FLAG, "showDebugCounts", 0, 1, 0); | |
459 | // no vera driver | |
460 | noDebugDrv = getParam(FLAG, "noDebugDrv", 0, 1, 0); | |
461 | #endif | |
462 | ||
463 | // no verilog checker | |
464 | noDebugChecks = getParam(FLAG, "noDebugChecks", 0, 1, 0); | |
465 | ||
466 | // cancel all use of debug knobs. for diags that can not do debug. | |
467 | noDebugModes = getParam(FLAG, "noDebugModes", 0, 1, 0); | |
468 | ||
469 | // ssModeFreq = initiate SS session every freq clocks. | |
470 | ssModeFreq = getParam(DEC, "ssModeFreq", 0, 100000, 0); | |
471 | // ssModeMaxSessions = limit SS sessions to this many sessions | |
472 | ssModeMaxSessions = getParam(DEC, "ssModeMaxSessions", 0, 100, 50); | |
473 | // ssModeInterleaveWeight = do interleaving or not within SS session based on weight | |
474 | ssModeInterleaveWeight = getParam(DEC, "ssModeInterleaveWeight", 0, 100, 40); | |
475 | // ssModeTidMask = which tids to involve in SS sessions | |
476 | ssModeTidMask = getParam(HEX, "ssModeTidMask", 0, 8'hff, 0); | |
477 | // ssModeBurstMin,ssModeBurstMax = how many steps to take per tid interleave | |
478 | ssModeBurstMin = getParam(DEC, "ssModeBurstMin", 0, 500, 10); | |
479 | ssModeBurstMax = getParam(DEC, "ssModeBurstMax", 1, 500, 250); | |
480 | // ssModeMin,ssModeMax = how many total steps to take per SS session | |
481 | ssModeMin = getParam(DEC, "ssModeMin", 0, 5000, 20+ssModeBurstMin); | |
482 | ssModeMax = getParam(DEC, "ssModeMax", 1, 5000, 500+ssModeBurstMax); | |
483 | // let dead clks pass before next SS req in session | |
484 | ssModeHolesMin = getParam(DEC, "ssModeHolesMin", 0, 500, 0); | |
485 | ssModeHolesMax = getParam(DEC, "ssModeHolesMax", 1, 500, 10); | |
486 | ||
487 | // doModeFreq = initiate session every freq clocks. | |
488 | doModeFreq = getParam(DEC, "doModeFreq", 0, 100000, 0); | |
489 | // doModeMaxSessions = limit DO sessions to this many sessions | |
490 | doModeMaxSessions = getParam(DEC, "doModeMaxSessions", 0, 100, 50); | |
491 | // doModeTidMask = which tids to involve in sessions | |
492 | doModeTidMask = getParam(DEC, "doModeTidMask", 0, 8'hff, 0); | |
493 | // doModeLenMin,doModeLenMax = how many total clocks to run per session | |
494 | doModeLenMin = getParam(DEC, "doModeLenMin", 1, 5000000, 200); | |
495 | doModeLenMax = getParam(DEC, "doModeLenMax", 1, 5000000, 5000); | |
496 | ||
497 | // softStopFreq = initiate session every freq clocks. | |
498 | softStopFreq = getParam(DEC, "softStopFreq", 1000, 100000, 0); | |
499 | // softStopMaxSessions = limit sessions to this many sessions | |
500 | softStopMaxSessions = getParam(DEC, "softStopMaxSessions", 0, 100, 50); | |
501 | // doModeTidMask = which tids to involve in sessions | |
502 | softStopTidMask = getParam(DEC, "softStopTidMask", 0, 8'hff, 0); | |
503 | // softStopLenMin,doModeLenMax = how many total clocks to run per session | |
504 | softStopLenMin = getParam(DEC, "softStopLenMin", 0, 500, 50); | |
505 | softStopLenMax = getParam(DEC, "softStopLenMax", 1, 600, 500); | |
506 | ||
507 | // exit diag if it parks and we are doing do/ss/softStop | |
508 | nodebugParkExit = getParam(FLAG, "nodebugParkExit", 0, 1, 0); | |
509 | ||
510 | // // | |
511 | // end debug logic testing // | |
512 | // // | |
513 | ||
514 | ||
515 | ||
516 | #ifdef SPC_BENCH | |
517 | // ccx stub | |
518 | rand_ccx_gnt_enable = getParam(FLAG, "random_ccx_gnt", 0, 1, 0); | |
519 | min_ccx_gnt_delay = getParam(DEC, "min_ccx_gnt_delay", 0, 1000, 0); | |
520 | max_ccx_gnt_delay = getParam(DEC, "max_ccx_gnt_delay", 0, 1000, 0); | |
521 | stub_l1_enable = getParam(FLAG, "stub_l1_disable", 0, 1, 1); | |
522 | l2lat_value = getParam(DEC, "l2lat_value", 0, 500, 6); | |
523 | l2lat_fixed = getParam(FLAG, "l2lat_fixed", 0, 1, 0); | |
524 | l2lat_in = getStringParam("latmom"); | |
525 | ||
526 | // POR/WMR/LBIST/MBISI | |
527 | por_enable = getParam(FLAG, "por_enable", 0, 1, 0); | |
528 | lbist_enable = getParam(FLAG, "lbist_enable", 0, 1, 0); | |
529 | mbist_mode = getParam(DEC, "mbist_mode", 0, 7, 0); | |
530 | mbist_enable = mbist_mode[2]; | |
531 | mbist_errinj = getParam(FLAG, "mbist_errinj", 0, 1, 0); | |
532 | user_loop_mode = getParam(DEC, "user_loop_mode", 0, 1, 0); | |
533 | user_loop_count = getParam(DEC, "user_loop_count", 0, 256, 3); | |
534 | lbist_abort_count = getParam(DEC, "lbist_abort_count", 0, 65000, 0); | |
535 | lbist_run_count = getParam(HEX, "lbist_run_count", 1, 7, 1); | |
536 | lbist_pgm = getParam(DEC, "lbist_pgm",0, 1, 0); | |
537 | mbist_fail_count = getParam(DEC, "mbist_fail_count", 0, 16777000, 0); | |
538 | ||
539 | //err | |
540 | err_freq = getParam(DEC, "err_freq", 0, 100, 10); | |
541 | err_burst_freq = getParam(DEC, "err_burst_freq", 0, 100, 5); | |
542 | err_burst_len_min = getParam(DEC, "err_burst_len_min", 0, 10, 1); | |
543 | err_burst_len_max = getParam(DEC, "err_burst_len_max", 1, 50, 10); | |
544 | err_ce_wt = getParam(DEC, "err_ce_wt", 0, 100, 50); | |
545 | err_nd_wt = getParam(DEC, "err_nd_wt", 0, 100, 25); | |
546 | rand_err = getParam(FLAG, "rand_err", 0, 1, 0); | |
547 | ||
548 | err_itlb_on = getParam(FLAG, "err_itlb_on", 0, 1, 0); | |
549 | err_itlb_freq = getParam(DEC, "err_itlb_freq", 0, 100, 20); | |
550 | ||
551 | err_dtlb_on = getParam(FLAG, "err_dtlb_on", 0, 1, 0); | |
552 | err_dtlb_freq = getParam(DEC, "err_dtlb_freq", 0, 100, 5); | |
553 | ||
554 | err_ic_on = getParam(FLAG, "err_ic_on", 0, 1, 0); | |
555 | err_ic_freq = getParam(DEC, "err_ic_freq", 0, 100, 20); | |
556 | ||
557 | err_dc_on = getParam(FLAG, "err_dc_on", 0, 1, 0); | |
558 | err_dc_freq = getParam(DEC, "err_dc_freq", 0, 100, 5); | |
559 | ||
560 | err_irf_on = getParam(FLAG, "err_irf_on", 0, 1, 0); | |
561 | err_irf_freq = getParam(DEC, "err_irf_freq", 0, 100, 20); | |
562 | ||
563 | err_frf_on = getParam(FLAG, "err_frf_on", 0, 1, 0); | |
564 | err_frf_freq = getParam(DEC, "err_frf_freq", 0, 100, 20); | |
565 | ||
566 | err_stb_on = getParam(FLAG, "err_stb_on", 0, 1, 0); | |
567 | err_stb_freq = getParam(DEC, "err_stb_freq", 0, 100, 20); | |
568 | ||
569 | err_sca_on = getParam(FLAG, "err_sca_on", 0, 1, 0); | |
570 | err_sca_freq = getParam(DEC, "err_sca_freq", 0, 100, 20); | |
571 | ||
572 | err_tcc_on = getParam(FLAG, "err_tcc_on", 0, 1, 0); | |
573 | err_tcc_freq = getParam(DEC, "err_tcc_freq", 0, 100, 20); | |
574 | ||
575 | err_tsa_on = getParam(FLAG, "err_tsa_on", 0, 1, 0); | |
576 | err_tsa_freq = getParam(DEC, "err_tsa_freq", 0, 100, 4); | |
577 | ||
578 | err_mra_on = getParam(FLAG, "err_mra_on", 0, 1, 0); | |
579 | err_mra_freq = getParam(DEC, "err_mra_freq", 0, 100, 20); | |
580 | ||
581 | err_l2c_on = getParam(FLAG, "err_l2c_on", 0, 1, 0); | |
582 | err_l2c_freq = getParam(DEC, "err_l2c_freq", 0, 100, 20); | |
583 | ||
584 | err_mamem_on = getParam(FLAG, "err_mamem_on", 0, 1, 0); | |
585 | err_mamem_freq = getParam(DEC, "err_mamem_freq", 0, 100, 20); | |
586 | #endif | |
587 | ||
588 | ||
589 | ||
590 | ||
591 | ||
592 | // add more here... | |
593 | ||
594 | ||
595 | ||
596 | ||
597 | ||
598 | closeFile(fileName); | |
599 | check4conflict(); | |
600 | } | |
601 | ||
602 | // things that are ONLY gotten from +args, not in config/paramaters file. | |
603 | // strings mostly. | |
604 | // Put all "knobs" in getCfg task above!!! | |
605 | task Params::getPlus() { | |
606 | ||
607 | // +dv_root is passed in by sims. Everything lives below that. | |
608 | // +dv_root=path | |
609 | if (mChkPlusarg(dv_root=)) { | |
610 | mGetPlusargStr(dv_root=,getstr); | |
611 | tempstr.bittostr (getstr); | |
612 | dv_root = tempstr; | |
613 | //printf("\n%7d paramsClass::getPlus dv_root = %s\n",get_cycle(),dv_root); | |
614 | } | |
615 | ||
616 | // If all param files are in one dir or are along one path, why not | |
617 | // get that partial path and then go from there? If you set it, you | |
618 | // should use it. | |
619 | // Put in bench.config as vcs_run_arg=+paramPath=verif/diag/bench. | |
620 | // Will prepend dv_root. +paramPath=path | |
621 | if (mChkPlusarg(paramPath=)) { | |
622 | mGetPlusargStr(paramPath=,getstr); | |
623 | tempstr.bittostr (getstr); | |
624 | paramPath = tempstr; | |
625 | } | |
626 | ||
627 | // You could pass in the default location (in bench.config) for a | |
628 | // default paramFile that will be used when none other is given, either | |
629 | // on the command line or in the testlist (which becomes the command line). | |
630 | // +defaultParam | |
631 | ||
632 | // Look for +paramFile= to append to +paramPath=path | |
633 | // +paramFile=file.cfg | |
634 | if (mChkPlusarg(paramFile=)) { | |
635 | mGetPlusargStr(paramFile=,getstr); | |
636 | tempstr.bittostr (getstr); | |
637 | paramFile = tempstr; | |
638 | //printf("%7d paramsClass::getPlus paramFile = %s\n",get_cycle(),paramFile); | |
639 | } | |
640 | ||
641 | // Look for +forceParamFile= so user can force a param/config/knobs file. | |
642 | // Will ignore +paramPath= and +paramFile= and +dv_root= | |
643 | // +forceParamFile=FULLPATH/slowMem.cfg | |
644 | if (mChkPlusarg(forceParamFile=)) { | |
645 | mGetPlusargStr(forceParamFile=,getstr); | |
646 | tempstr.bittostr (getstr); | |
647 | forceParamFile = tempstr; | |
648 | printf("\n%7d paramsClass::getPlus forceParamFile = %s\n",get_cycle(),forceParamFile); | |
649 | } | |
650 | ||
651 | // OK make sense of it... | |
652 | if (forceParamFile !== null) { | |
653 | printf("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); | |
654 | printf("using forceParamFile: %s\n",forceParamFile); | |
655 | printf("You probably need to repeat this to reproduce failures!\n"); | |
656 | printf("Use -vcs_run_args=+forceParamFile=%s to do that!\n",forceParamFile); | |
657 | printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); | |
658 | } | |
659 | else if (paramFile !== null) { | |
660 | printf("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); | |
661 | printf("using paramFile: %s\n",paramFile); | |
662 | printf("You may need to repeat this to reproduce failures!\n"); | |
663 | printf("Use -vcs_run_args=+paramFile=%s (or +forceParamFile=) to do that!\n",paramFile); | |
664 | printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); | |
665 | } | |
666 | ||
667 | // now use paramFile. May be null and if so, default params will be used. | |
668 | if (paramFile !== null) { | |
669 | paramFile = {paramPath,paramFile}; | |
670 | } | |
671 | if (forceParamFile !== null) { | |
672 | paramFile = forceParamFile; | |
673 | } | |
674 | ||
675 | // what kind of diags are running? | |
676 | if (mChkPlusarg(vera_diag_name=)) { | |
677 | mGetPlusargStr(vera_diag_name=,getstr); | |
678 | tempstr.bittostr (getstr); | |
679 | veraDiagName = tempstr; | |
680 | } | |
681 | ||
682 | if (mChkPlusarg(asm_diag_name=)) { | |
683 | mGetPlusargStr(asm_diag_name=,getstr); | |
684 | tempstr.bittostr (getstr); | |
685 | asmDiagName = tempstr; | |
686 | } | |
687 | ||
688 | // only Verilog knows what this is because it can be randomized in verilog. | |
689 | // Use gUtil.getThreadEnables or sparcBenchUtils_if.th_check_enable | |
690 | // if (mChkPlusarg(thread=)) { | |
691 | // mGetPlusargStr(thread=,getstr); | |
692 | // tempstr.bittostr(getstr); | |
693 | // if (tempstr == "all") getstr = 64'hffffffffffffffff; // special case | |
694 | // else getstr = tempstr.atohex(); | |
695 | // thread_enables = getstr; | |
696 | // } | |
697 | ||
698 | // CCX packet print | |
699 | if (mChkPlusarg(ccxPktPrint=)) { | |
700 | mGetPlusargStr(ccxPktPrint=,getstr); | |
701 | tempstr.bittostr (getstr); | |
702 | if (tempstr == "all") { | |
703 | ccxPktPrint[PP_PCX] = 1; | |
704 | ccxPktPrint[PP_CPX] = 1; | |
705 | } | |
706 | else if (tempstr == "pcx") ccxPktPrint[PP_PCX] = 1; | |
707 | else if (tempstr == "cpx") ccxPktPrint[PP_CPX] = 1; | |
708 | else if (tempstr == "mem") ccxPktPrint[PP_MEM] = 1; | |
709 | else if (tempstr == "spc") ccxPktPrint[PP_SPC] = 1; | |
710 | else if (tempstr == "targets") ccxPktPrint[PP_TRG] = 1; | |
711 | else if (tempstr == "target") ccxPktPrint[PP_TRG] = 1; | |
712 | else ccxPktPrintMask = tempstr.atohex(); | |
713 | ccxPktPrintOn = 1; | |
714 | } | |
715 | ||
716 | // MCU mem print | |
717 | if (mChkPlusarg(mcuMemPrint=)) { | |
718 | mGetPlusargStr(mcuMemPrint=,getstr); | |
719 | tempstr.bittostr (getstr); | |
720 | if (tempstr == "all") { | |
721 | mcuMemPrint[READ] = 1; | |
722 | mcuMemPrint[WRITE] = 1; | |
723 | } | |
724 | else if (tempstr == "rd" || tempstr == "read") mcuMemPrint[READ] = 1; | |
725 | else if (tempstr == "wr" || tempstr == "write") mcuMemPrint[WRITE] = 1; | |
726 | mcuMemPrintOn = 1; | |
727 | } | |
728 | ||
729 | if (mChkPlusarg(finish_mask=)) { | |
730 | mGetPlusargStr(finish_mask=,getstr); | |
731 | tempstr.bittostr (getstr); | |
732 | if (tempstr == "all") tmp = 64'hffffffffffffffff; // special case | |
733 | else tmp = tempstr.atohex(); | |
734 | finishMask = tmp; | |
735 | } else if (mChkPlusarg(threads=)) { | |
736 | mGetPlusargStr(threads=,getstr); | |
737 | tempstr.bittostr (getstr); | |
738 | if (tempstr == "all") tmp = 64'hffffffffffffffff; // special case | |
739 | else tmp = tempstr.atohex(); | |
740 | finishMask = tmp; | |
741 | } else finishMask = 1; | |
742 | ||
743 | ||
744 | // you probably don't want to add here, see task getCfg above. | |
745 | ||
746 | ||
747 | } | |
748 | ||
749 | ||
750 | ||
751 | // This task will try to resolve conflicts in paramaters | |
752 | // PROVIDED that someone has thought of them. | |
753 | task Params::check4conflict() { | |
754 | ||
755 | integer i; | |
756 | ||
757 | intr_en = intr_en & coreEnableReg; | |
758 | finishMask = finishMask & coreEnableReg & coreAvilableReg; | |
759 | ||
760 | } | |
761 |