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 // Throw upwards, either to sc_main or to the report handler if sc_main 367 // isn't running. 368 void throwUp(); |
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 |
429 const ::sc_core::sc_report *_throwUp; |
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); |
510 scheduler.throwUp(); |
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__ |