cp_annotate.hh (11168:f98eb2da15a4) | cp_annotate.hh (11320:42ecb523c64a) |
---|---|
1/* 2 * Copyright (c) 2014 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 87 unchanged lines hidden (view full) --- 96 void swWf(ThreadContext *tc) { return; } 97 void swWe(ThreadContext *tc) { return; } 98 void swSq(ThreadContext *tc) { return; } 99 void swAq(ThreadContext *tc) { return; } 100 void swLink(ThreadContext *tc) { return; } 101 void swIdentify(ThreadContext *tc) { return; } 102 uint64_t swGetId(ThreadContext *tc) { return 0; } 103 void swSyscallLink(ThreadContext *tc) { return; } | 1/* 2 * Copyright (c) 2014 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 87 unchanged lines hidden (view full) --- 96 void swWf(ThreadContext *tc) { return; } 97 void swWe(ThreadContext *tc) { return; } 98 void swSq(ThreadContext *tc) { return; } 99 void swAq(ThreadContext *tc) { return; } 100 void swLink(ThreadContext *tc) { return; } 101 void swIdentify(ThreadContext *tc) { return; } 102 uint64_t swGetId(ThreadContext *tc) { return 0; } 103 void swSyscallLink(ThreadContext *tc) { return; } |
104 void hwBegin(flags f, System *sys, uint64_t frame, std::string sm, | 104 void hwBegin(flags f, System *sys, uint64_t frame, std::string sm, |
105 std::string st) { return; } | 105 std::string st) { return; } |
106 void hwQ(flags f, System *sys, uint64_t frame, std::string sm, 107 std::string q, uint64_t qid, System *q_sys = NULL, | 106 void hwQ(flags f, System *sys, uint64_t frame, std::string sm, 107 std::string q, uint64_t qid, System *q_sys = NULL, |
108 int32_t count = 1) { return; } | 108 int32_t count = 1) { return; } |
109 void hwDq(flags f, System *sys, uint64_t frame, std::string sm, 110 std::string q, uint64_t qid, System *q_sys = NULL, | 109 void hwDq(flags f, System *sys, uint64_t frame, std::string sm, 110 std::string q, uint64_t qid, System *q_sys = NULL, |
111 int32_t count = 1) { return; } | 111 int32_t count = 1) { return; } |
112 void hwPq(flags f, System *sys, uint64_t frame, std::string sm, 113 std::string q, uint64_t qid, System *q_sys = NULL, | 112 void hwPq(flags f, System *sys, uint64_t frame, std::string sm, 113 std::string q, uint64_t qid, System *q_sys = NULL, |
114 int32_t count = 1) { return; } | 114 int32_t count = 1) { return; } |
115 void hwRq(flags f, System *sys, uint64_t frame, std::string sm, 116 std::string q, uint64_t qid, System *q_sys = NULL, | 115 void hwRq(flags f, System *sys, uint64_t frame, std::string sm, 116 std::string q, uint64_t qid, System *q_sys = NULL, |
117 int32_t count = 1) { return; } | 117 int32_t count = 1) { return; } |
118 void hwWf(flags f, System *sys, uint64_t frame, std::string sm, 119 std::string q, uint64_t qid, System *q_sys = NULL, | 118 void hwWf(flags f, System *sys, uint64_t frame, std::string sm, 119 std::string q, uint64_t qid, System *q_sys = NULL, |
120 int32_t count = 1) { return; } | 120 int32_t count = 1) { return; } |
121 void hwWe(flags f, System *sys, uint64_t frame, std::string sm, 122 std::string q, uint64_t qid, System *q_sys = NULL, | 121 void hwWe(flags f, System *sys, uint64_t frame, std::string sm, 122 std::string q, uint64_t qid, System *q_sys = NULL, |
123 int32_t count = 1) { return; } 124}; 125#else 126 127/** 128 * Provide a hash function for the CPI Id type 129 */ 130namespace std { --- 9 unchanged lines hidden (view full) --- 140 141}; 142} 143 144class CPA : SimObject 145{ 146 public: 147 typedef CPAParams Params; | 123 int32_t count = 1) { return; } 124}; 125#else 126 127/** 128 * Provide a hash function for the CPI Id type 129 */ 130namespace std { --- 9 unchanged lines hidden (view full) --- 140 141}; 142} 143 144class CPA : SimObject 145{ 146 public: 147 typedef CPAParams Params; |
148 | 148 |
149 /** The known operations that are written to the annotation output file. */ 150 enum ops { 151 OP_BEGIN = 0x01, 152 OP_WAIT_EMPTY = 0x02, 153 OP_WAIT_FULL = 0x03, 154 OP_QUEUE = 0x04, 155 OP_DEQUEUE = 0x05, 156 OP_SIZE_QUEUE = 0x08, --- 9 unchanged lines hidden (view full) --- 166 FL_NONE = 0x00, 167 /* operation was done on hardware */ 168 FL_HW = 0x01, 169 /* operation should cause a warning when encountered */ 170 FL_BAD = 0x02, 171 /* Queue like a stack, not a queue */ 172 FL_QOPP = 0x04, 173 /* Mark HW state as waiting for some non-resource constraint | 149 /** The known operations that are written to the annotation output file. */ 150 enum ops { 151 OP_BEGIN = 0x01, 152 OP_WAIT_EMPTY = 0x02, 153 OP_WAIT_FULL = 0x03, 154 OP_QUEUE = 0x04, 155 OP_DEQUEUE = 0x05, 156 OP_SIZE_QUEUE = 0x08, --- 9 unchanged lines hidden (view full) --- 166 FL_NONE = 0x00, 167 /* operation was done on hardware */ 168 FL_HW = 0x01, 169 /* operation should cause a warning when encountered */ 170 FL_BAD = 0x02, 171 /* Queue like a stack, not a queue */ 172 FL_QOPP = 0x04, 173 /* Mark HW state as waiting for some non-resource constraint |
174 * (e.g. wait because SM only starts after 10 items are queued) */ | 174 * (e.g. wait because SM only starts after 10 items are queued) */ |
175 FL_WAIT = 0x08, 176 /* operation is linking to another state machine */ 177 FL_LINK = 0x10, 178 /* queue should be completely cleared/reset before executing this 179 * operation */ 180 FL_RESET = 0x20 181 }; 182 --- 34 unchanged lines hidden (view full) --- 217 uint32_t key_len; 218 uint32_t idx_len; 219 }; 220 221 AnnotateHeader ah; 222 223 std::vector<uint64_t> annotateIdx; 224 | 175 FL_WAIT = 0x08, 176 /* operation is linking to another state machine */ 177 FL_LINK = 0x10, 178 /* queue should be completely cleared/reset before executing this 179 * operation */ 180 FL_RESET = 0x20 181 }; 182 --- 34 unchanged lines hidden (view full) --- 217 uint32_t key_len; 218 uint32_t idx_len; 219 }; 220 221 AnnotateHeader ah; 222 223 std::vector<uint64_t> annotateIdx; 224 |
225 // number of state machines encountered in the simulation | 225 // number of state machines encountered in the simulation |
226 int numSm; | 226 int numSm; |
227 // number of states encountered in the simulation | 227 // number of states encountered in the simulation |
228 int numSmt; 229 // number of states/queues for a given state machine/system respectively 230 std::vector<int> numSt, numQ; 231 // number of systems in the simulation 232 int numSys; 233 // number of queues in the state machine 234 int numQs; 235 // maximum connection id assigned so far --- 50 unchanged lines hidden (view full) --- 286 // turn system, state, and context into state machine id (small int) 287 IdCache qCache, smCache; 288 //Link state machines accross system calls 289 ScCache scLinks; 290 // System pointer to name,id 291 NameCache nameCache; 292 // Stack of state machines currently nested (should unwind correctly) 293 SmStack smStack; | 228 int numSmt; 229 // number of states/queues for a given state machine/system respectively 230 std::vector<int> numSt, numQ; 231 // number of systems in the simulation 232 int numSys; 233 // number of queues in the state machine 234 int numQs; 235 // maximum connection id assigned so far --- 50 unchanged lines hidden (view full) --- 286 // turn system, state, and context into state machine id (small int) 287 IdCache qCache, smCache; 288 //Link state machines accross system calls 289 ScCache scLinks; 290 // System pointer to name,id 291 NameCache nameCache; 292 // Stack of state machines currently nested (should unwind correctly) 293 SmStack smStack; |
294 // Map of currently outstanding links | 294 // Map of currently outstanding links |
295 LinkMap lnMap; 296 // If the state machine is currently exculding automatic changes 297 SwExpl swExpl; 298 // Last state that a given state machine was in 299 IMap lastState; 300 // Hold mapping of sm and queues to output python 301 IdMap smMap, qMap; | 295 LinkMap lnMap; 296 // If the state machine is currently exculding automatic changes 297 SwExpl swExpl; 298 // Last state that a given state machine was in 299 IMap lastState; 300 // Hold mapping of sm and queues to output python 301 IdMap smMap, qMap; |
302 // Items still in queue, used for sanity checking | 302 // Items still in queue, used for sanity checking |
303 std::vector<AnnotateList> qData; 304 305 void doDq(System *sys, int flags, int cpu, int sm, std::string q, int qi, 306 int count); 307 void doQ(System *sys, int flags, int cpu, int sm, std::string q, int qi, 308 int count); 309 310 void doSwSmEnd(System *sys, int cpuid, std::string sm, uint64_t frame); 311 312 // Turn a system id, state machine string, state machine id into a small int 313 // for annotation output | 303 std::vector<AnnotateList> qData; 304 305 void doDq(System *sys, int flags, int cpu, int sm, std::string q, int qi, 306 int count); 307 void doQ(System *sys, int flags, int cpu, int sm, std::string q, int qi, 308 int count); 309 310 void doSwSmEnd(System *sys, int cpuid, std::string sm, uint64_t frame); 311 312 // Turn a system id, state machine string, state machine id into a small int 313 // for annotation output |
314 int | 314 int |
315 getSm(int sysi, std::string si, uint64_t id) 316 { 317 int smi; 318 Id smid = Id(si, id); 319 320 smi = smCache[sysi-1][smid]; 321 if (smi == 0) { 322 smCache[sysi-1][smid] = smi = ++numSm; 323 assert(smi < 65535); 324 smMap.push_back(std::make_pair(sysi, smid)); 325 } 326 return smi; 327 } 328 329 // Turn a state machine string, state string into a small int 330 // for annotation output | 315 getSm(int sysi, std::string si, uint64_t id) 316 { 317 int smi; 318 Id smid = Id(si, id); 319 320 smi = smCache[sysi-1][smid]; 321 if (smi == 0) { 322 smCache[sysi-1][smid] = smi = ++numSm; 323 assert(smi < 65535); 324 smMap.push_back(std::make_pair(sysi, smid)); 325 } 326 return smi; 327 } 328 329 // Turn a state machine string, state string into a small int 330 // for annotation output |
331 int | 331 int |
332 getSt(std::string sm, std::string s) 333 { 334 int sti, smi; 335 336 smi = smtCache[sm]; 337 if (smi == 0) 338 smi = smtCache[sm] = ++numSmt; 339 --- 6 unchanged lines hidden (view full) --- 346 //assert(numSt.size() == sm); 347 sti = stCache[smi-1][s]; 348 if (sti == 0) 349 stCache[smi-1][s] = sti = ++numSt[smi-1]; 350 return sti; 351 } 352 353 // Turn state machine pointer into a smal int for annotation output | 332 getSt(std::string sm, std::string s) 333 { 334 int sti, smi; 335 336 smi = smtCache[sm]; 337 if (smi == 0) 338 smi = smtCache[sm] = ++numSmt; 339 --- 6 unchanged lines hidden (view full) --- 346 //assert(numSt.size() == sm); 347 sti = stCache[smi-1][s]; 348 if (sti == 0) 349 stCache[smi-1][s] = sti = ++numSt[smi-1]; 350 return sti; 351 } 352 353 // Turn state machine pointer into a smal int for annotation output |
354 int | 354 int |
355 getSys(System *s) 356 { 357 NameCache::iterator i = nameCache.find(s); 358 if (i == nameCache.end()) { 359 nameCache[s] = std::make_pair(s->name(), ++numSys); 360 i = nameCache.find(s); 361 // might need to put smstackid into map here, but perhaps not 362 //smStack.push_back(std::vector<int>()); 363 //swExpl.push_back(false); 364 numQ.push_back(0); 365 qCache.push_back(IdHCache()); 366 smCache.push_back(IdHCache()); 367 scLinks.push_back(ScHCache()); 368 } 369 return i->second.second; 370 } 371 | 355 getSys(System *s) 356 { 357 NameCache::iterator i = nameCache.find(s); 358 if (i == nameCache.end()) { 359 nameCache[s] = std::make_pair(s->name(), ++numSys); 360 i = nameCache.find(s); 361 // might need to put smstackid into map here, but perhaps not 362 //smStack.push_back(std::vector<int>()); 363 //swExpl.push_back(false); 364 numQ.push_back(0); 365 qCache.push_back(IdHCache()); 366 smCache.push_back(IdHCache()); 367 scLinks.push_back(ScHCache()); 368 } 369 return i->second.second; 370 } 371 |
372 // Turn queue name, and queue context into small int for | 372 // Turn queue name, and queue context into small int for |
373 // annotation output | 373 // annotation output |
374 int | 374 int |
375 getQ(int sys, std::string q, uint64_t id) 376 { 377 int qi; 378 Id qid = Id(q, id); 379 380 qi = qCache[sys-1][qid]; 381 if (qi == 0) { 382 qi = qCache[sys-1][qid] = ++numQs; 383 assert(qi < 65535); 384 qSize.push_back(0); 385 qBytes.push_back(0); 386 qData.push_back(AnnotateList()); 387 numQ[sys-1]++; 388 qMap.push_back(std::make_pair(sys, qid)); 389 } 390 return qi; 391 } 392 | 375 getQ(int sys, std::string q, uint64_t id) 376 { 377 int qi; 378 Id qid = Id(q, id); 379 380 qi = qCache[sys-1][qid]; 381 if (qi == 0) { 382 qi = qCache[sys-1][qid] = ++numQs; 383 assert(qi < 65535); 384 qSize.push_back(0); 385 qBytes.push_back(0); 386 qData.push_back(AnnotateList()); 387 numQ[sys-1]++; 388 qMap.push_back(std::make_pair(sys, qid)); 389 } 390 return qi; 391 } 392 |
393 void swBegin(System *sys, int cpuid, std::string st, uint64_t frame, | 393 void swBegin(System *sys, int cpuid, std::string st, uint64_t frame, |
394 bool expl = false, int flags = FL_NONE); 395 396 AnnDataPtr add(int t, int f, int c, int sm, int stq, int32_t data=0); 397 398 std::ostream *osbin; 399 400 bool _enabled; 401 | 394 bool expl = false, int flags = FL_NONE); 395 396 AnnDataPtr add(int t, int f, int c, int sm, int stq, int32_t data=0); 397 398 std::ostream *osbin; 399 400 bool _enabled; 401 |
402 /** Only allow one CPA object in a system. It doesn't make sense to have | 402 /** Only allow one CPA object in a system. It doesn't make sense to have |
403 * more that one per simulation because if a part of the system was 404 * important it would have annotations and queues, and with more than one 405 * object none of the sanity checking for queues will work. */ 406 static bool exists; 407 static CPA *_cpa; 408 409 410 std::map<std::string, SymbolTable*> userApp; --- 13 unchanged lines hidden (view full) --- 424 void swWe(ThreadContext *tc); 425 void swSq(ThreadContext *tc); 426 void swAq(ThreadContext *tc); 427 void swLink(ThreadContext *tc); 428 void swIdentify(ThreadContext *tc); 429 uint64_t swGetId(ThreadContext *tc); 430 void swSyscallLink(ThreadContext *tc); 431 | 403 * more that one per simulation because if a part of the system was 404 * important it would have annotations and queues, and with more than one 405 * object none of the sanity checking for queues will work. */ 406 static bool exists; 407 static CPA *_cpa; 408 409 410 std::map<std::string, SymbolTable*> userApp; --- 13 unchanged lines hidden (view full) --- 424 void swWe(ThreadContext *tc); 425 void swSq(ThreadContext *tc); 426 void swAq(ThreadContext *tc); 427 void swLink(ThreadContext *tc); 428 void swIdentify(ThreadContext *tc); 429 uint64_t swGetId(ThreadContext *tc); 430 void swSyscallLink(ThreadContext *tc); 431 |
432 inline void hwBegin(flags f, System *sys, uint64_t frame, std::string sm, | 432 inline void hwBegin(flags f, System *sys, uint64_t frame, std::string sm, |
433 std::string st) 434 { 435 if (!enabled()) 436 return; 437 438 int sysi = getSys(sys); 439 int smi = getSm(sysi, sm, frame); 440 add(OP_BEGIN, FL_HW | f, 0, smi, getSt(sm, st)); 441 if (f & FL_BAD) 442 warn("BAD state encountered: at cycle %d: %s\n", curTick(), st); 443 } 444 | 433 std::string st) 434 { 435 if (!enabled()) 436 return; 437 438 int sysi = getSys(sys); 439 int smi = getSm(sysi, sm, frame); 440 add(OP_BEGIN, FL_HW | f, 0, smi, getSt(sm, st)); 441 if (f & FL_BAD) 442 warn("BAD state encountered: at cycle %d: %s\n", curTick(), st); 443 } 444 |
445 inline void hwQ(flags f, System *sys, uint64_t frame, std::string sm, | 445 inline void hwQ(flags f, System *sys, uint64_t frame, std::string sm, |
446 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 447 { 448 if (!enabled()) 449 return; 450 451 int sysi = getSys(sys); 452 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); | 446 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 447 { 448 if (!enabled()) 449 return; 450 451 int sysi = getSys(sys); 452 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); |
453 DPRINTFS(AnnotateQ, sys, | 453 DPRINTFS(AnnotateQ, sys, |
454 "hwQ: %s[%#x] cur size %d %d bytes: %d adding: %d\n", 455 q, qid, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count); 456 doQ(sys, FL_HW | f, 0, getSm(sysi, sm, frame), q, qi, count); 457 458 } 459 | 454 "hwQ: %s[%#x] cur size %d %d bytes: %d adding: %d\n", 455 q, qid, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count); 456 doQ(sys, FL_HW | f, 0, getSm(sysi, sm, frame), q, qi, count); 457 458 } 459 |
460 inline void hwDq(flags f, System *sys, uint64_t frame, std::string sm, | 460 inline void hwDq(flags f, System *sys, uint64_t frame, std::string sm, |
461 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 462 { 463 if (!enabled()) 464 return; 465 466 int sysi = getSys(sys); 467 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); | 461 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 462 { 463 if (!enabled()) 464 return; 465 466 int sysi = getSys(sys); 467 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); |
468 DPRINTFS(AnnotateQ, sys, | 468 DPRINTFS(AnnotateQ, sys, |
469 "hwDQ: %s[%#x] cur size %d %d bytes: %d removing: %d\n", 470 q, qid, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count); 471 doDq(sys, FL_HW | f, 0, getSm(sysi,sm, frame), q, qi, count); 472 } 473 | 469 "hwDQ: %s[%#x] cur size %d %d bytes: %d removing: %d\n", 470 q, qid, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count); 471 doDq(sys, FL_HW | f, 0, getSm(sysi,sm, frame), q, qi, count); 472 } 473 |
474 inline void hwPq(flags f, System *sys, uint64_t frame, std::string sm, | 474 inline void hwPq(flags f, System *sys, uint64_t frame, std::string sm, |
475 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 476 { 477 if (!enabled()) 478 return; 479 480 int sysi = getSys(sys); 481 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); | 475 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 476 { 477 if (!enabled()) 478 return; 479 480 int sysi = getSys(sys); 481 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); |
482 DPRINTFS(AnnotateQ, sys, | 482 DPRINTFS(AnnotateQ, sys, |
483 "hwPQ: %s[%#x] cur size %d %d bytes: %d peeking: %d\n", 484 q, qid, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count); 485 add(OP_PEEK, FL_HW | f, 0, getSm(sysi, sm, frame), qi, count); 486 } 487 | 483 "hwPQ: %s[%#x] cur size %d %d bytes: %d peeking: %d\n", 484 q, qid, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count); 485 add(OP_PEEK, FL_HW | f, 0, getSm(sysi, sm, frame), qi, count); 486 } 487 |
488 inline void hwRq(flags f, System *sys, uint64_t frame, std::string sm, | 488 inline void hwRq(flags f, System *sys, uint64_t frame, std::string sm, |
489 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 490 { 491 if (!enabled()) 492 return; 493 494 int sysi = getSys(sys); 495 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); | 489 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 490 { 491 if (!enabled()) 492 return; 493 494 int sysi = getSys(sys); 495 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); |
496 DPRINTFS(AnnotateQ, sys, | 496 DPRINTFS(AnnotateQ, sys, |
497 "hwRQ: %s[%#x] cur size %d %d bytes: %d reserving: %d\n", 498 q, qid, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count); 499 add(OP_RESERVE, FL_HW | f, 0, getSm(sysi, sm, frame), qi, count); 500 } 501 | 497 "hwRQ: %s[%#x] cur size %d %d bytes: %d reserving: %d\n", 498 q, qid, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count); 499 add(OP_RESERVE, FL_HW | f, 0, getSm(sysi, sm, frame), qi, count); 500 } 501 |
502 inline void hwWf(flags f, System *sys, uint64_t frame, std::string sm, | 502 inline void hwWf(flags f, System *sys, uint64_t frame, std::string sm, |
503 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 504 { 505 if (!enabled()) 506 return; 507 508 int sysi = getSys(sys); 509 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); 510 add(OP_WAIT_FULL, FL_HW | f, 0, getSm(sysi, sm, frame), qi, count); 511 } 512 | 503 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) 504 { 505 if (!enabled()) 506 return; 507 508 int sysi = getSys(sys); 509 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); 510 add(OP_WAIT_FULL, FL_HW | f, 0, getSm(sysi, sm, frame), qi, count); 511 } 512 |
513 inline void hwWe(flags f, System *sys, uint64_t frame, std::string sm, 514 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) | 513 inline void hwWe(flags f, System *sys, uint64_t frame, std::string sm, 514 std::string q, uint64_t qid, System *q_sys = NULL, int32_t count = 1) |
515 { 516 if (!enabled()) 517 return; 518 519 int sysi = getSys(sys); 520 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); 521 add(OP_WAIT_EMPTY, FL_HW | f, 0, getSm(sysi, sm, frame), qi, count); 522 } 523 524 public: 525 CPA(Params *p); 526 void startup(); 527 528 uint64_t getFrame(ThreadContext *tc); 529 530 static bool available() { return true; } 531 | 515 { 516 if (!enabled()) 517 return; 518 519 int sysi = getSys(sys); 520 int qi = getQ(q_sys ? getSys(q_sys) : sysi, q, qid); 521 add(OP_WAIT_EMPTY, FL_HW | f, 0, getSm(sysi, sm, frame), qi, count); 522 } 523 524 public: 525 CPA(Params *p); 526 void startup(); 527 528 uint64_t getFrame(ThreadContext *tc); 529 530 static bool available() { return true; } 531 |
532 bool 533 enabled() 534 { | 532 bool 533 enabled() 534 { |
535 if (!this) 536 return false; 537 return _enabled; 538 } | 535 if (!this) 536 return false; 537 return _enabled; 538 } |
539 | 539 |
540 void dump(bool all); 541 void dumpKey(); 542 543 void serialize(CheckpointOut &cp) const override; 544 void unserialize(CheckpointIn &cp) override; 545}; 546#endif // !CP_ANNOTATE 547 548#endif //__BASE__CP_ANNOTATE_HH__ 549 | 540 void dump(bool all); 541 void dumpKey(); 542 543 void serialize(CheckpointOut &cp) const override; 544 void unserialize(CheckpointIn &cp) override; 545}; 546#endif // !CP_ANNOTATE 547 548#endif //__BASE__CP_ANNOTATE_HH__ 549 |