scheduler.hh (13403:cebee63981d3) | scheduler.hh (13701:d84e5d2979a7) |
---|---|
1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 349 unchanged lines hidden (view full) --- 358 bool inEvaluate() { return status() == StatusEvaluate; } 359 bool inUpdate() { return status() == StatusUpdate; } 360 bool inDelta() { return status() == StatusDelta; } 361 bool inTiming() { return status() == StatusTiming; } 362 363 uint64_t changeStamp() { return _changeStamp; } 364 void stepChangeStamp() { _changeStamp++; } 365 | 1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 349 unchanged lines hidden (view full) --- 358 bool inEvaluate() { return status() == StatusEvaluate; } 359 bool inUpdate() { return status() == StatusUpdate; } 360 bool inDelta() { return status() == StatusDelta; } 361 bool inTiming() { return status() == StatusTiming; } 362 363 uint64_t changeStamp() { return _changeStamp; } 364 void stepChangeStamp() { _changeStamp++; } 365 |
366 void throwToScMain(); | 366 // Throw upwards, either to sc_main or to the report handler if sc_main 367 // isn't running. 368 void throwUp(); |
367 368 Status status() { return _status; } 369 void status(Status s) { _status = s; } 370 371 void registerTraceFile(TraceFile *tf) { traceFiles.insert(tf); } 372 void unregisterTraceFile(TraceFile *tf) { traceFiles.erase(tf); } 373 374 private: --- 44 unchanged lines hidden (view full) --- 419 EventWrapper<Scheduler, &Scheduler::runReady> readyEvent; 420 void scheduleReadyEvent(); 421 422 void pause(); 423 void stop(); 424 EventWrapper<Scheduler, &Scheduler::pause> pauseEvent; 425 EventWrapper<Scheduler, &Scheduler::stop> stopEvent; 426 | 369 370 Status status() { return _status; } 371 void status(Status s) { _status = s; } 372 373 void registerTraceFile(TraceFile *tf) { traceFiles.insert(tf); } 374 void unregisterTraceFile(TraceFile *tf) { traceFiles.erase(tf); } 375 376 private: --- 44 unchanged lines hidden (view full) --- 421 EventWrapper<Scheduler, &Scheduler::runReady> readyEvent; 422 void scheduleReadyEvent(); 423 424 void pause(); 425 void stop(); 426 EventWrapper<Scheduler, &Scheduler::pause> pauseEvent; 427 EventWrapper<Scheduler, &Scheduler::stop> stopEvent; 428 |
427 const ::sc_core::sc_report *_throwToScMain; | 429 const ::sc_core::sc_report *_throwUp; |
428 429 bool 430 starved() 431 { 432 return (readyListMethods.empty() && readyListThreads.empty() && 433 updateList.empty() && deltas.empty() && 434 (timeSlots.empty() || timeSlots.begin()->first > maxTick) && 435 initList.empty()); --- 64 unchanged lines hidden (view full) --- 500 try { 501 while (!events.empty()) 502 events.front()->run(); 503 } catch (...) { 504 if (events.empty()) 505 scheduler.completeTimeSlot(this); 506 else 507 scheduler.schedule(this); | 430 431 bool 432 starved() 433 { 434 return (readyListMethods.empty() && readyListThreads.empty() && 435 updateList.empty() && deltas.empty() && 436 (timeSlots.empty() || timeSlots.begin()->first > maxTick) && 437 initList.empty()); --- 64 unchanged lines hidden (view full) --- 502 try { 503 while (!events.empty()) 504 events.front()->run(); 505 } catch (...) { 506 if (events.empty()) 507 scheduler.completeTimeSlot(this); 508 else 509 scheduler.schedule(this); |
508 scheduler.throwToScMain(); | 510 scheduler.throwUp(); |
509 } 510 511 scheduler.status(StatusOther); 512 scheduler.completeTimeSlot(this); 513} 514 515const ::sc_core::sc_report reportifyException(); 516 517} // namespace sc_gem5 518 519#endif // __SYSTEMC_CORE_SCHEDULER_H__ | 511 } 512 513 scheduler.status(StatusOther); 514 scheduler.completeTimeSlot(this); 515} 516 517const ::sc_core::sc_report reportifyException(); 518 519} // namespace sc_gem5 520 521#endif // __SYSTEMC_CORE_SCHEDULER_H__ |