scheduler.hh (13264:cdb71995fe75) | scheduler.hh (13287:fa657c66fc83) |
---|---|
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 --- 273 unchanged lines hidden (view full) --- 282 deschedule(ts); 283 timeSlots.erase(tsit); 284 } 285 } 286 287 void 288 completeTimeSlot(TimeSlot *ts) 289 { | 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 --- 273 unchanged lines hidden (view full) --- 282 deschedule(ts); 283 timeSlots.erase(tsit); 284 } 285 } 286 287 void 288 completeTimeSlot(TimeSlot *ts) 289 { |
290 _changeStamp++; | |
291 assert(ts == timeSlots.begin()->second); 292 timeSlots.erase(timeSlots.begin()); 293 if (!runToTime && starved()) 294 scheduleStarvationEvent(); 295 scheduleTimeAdvancesEvent(); 296 } 297 298 // Pending activity ignores gem5 activity, much like how a systemc --- 60 unchanged lines hidden (view full) --- 359 bool paused() { return status() == StatusPaused; } 360 bool stopped() { return status() == StatusStopped; } 361 bool inEvaluate() { return status() == StatusEvaluate; } 362 bool inUpdate() { return status() == StatusUpdate; } 363 bool inDelta() { return status() == StatusDelta; } 364 bool inTiming() { return status() == StatusTiming; } 365 366 uint64_t changeStamp() { return _changeStamp; } | 290 assert(ts == timeSlots.begin()->second); 291 timeSlots.erase(timeSlots.begin()); 292 if (!runToTime && starved()) 293 scheduleStarvationEvent(); 294 scheduleTimeAdvancesEvent(); 295 } 296 297 // Pending activity ignores gem5 activity, much like how a systemc --- 60 unchanged lines hidden (view full) --- 358 bool paused() { return status() == StatusPaused; } 359 bool stopped() { return status() == StatusStopped; } 360 bool inEvaluate() { return status() == StatusEvaluate; } 361 bool inUpdate() { return status() == StatusUpdate; } 362 bool inDelta() { return status() == StatusDelta; } 363 bool inTiming() { return status() == StatusTiming; } 364 365 uint64_t changeStamp() { return _changeStamp; } |
366 void stepChangeStamp() { _changeStamp++; } |
|
367 368 void throwToScMain(); 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); } --- 114 unchanged lines hidden (view full) --- 489 void trace(bool delta); 490}; 491 492extern Scheduler scheduler; 493 494inline void 495Scheduler::TimeSlot::process() 496{ | 367 368 void throwToScMain(); 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); } --- 114 unchanged lines hidden (view full) --- 489 void trace(bool delta); 490}; 491 492extern Scheduler scheduler; 493 494inline void 495Scheduler::TimeSlot::process() 496{ |
497 scheduler.stepChangeStamp(); |
|
497 scheduler.status(StatusTiming); 498 499 try { 500 while (!events.empty()) 501 events.front()->run(); 502 } catch (...) { 503 if (events.empty()) 504 scheduler.completeTimeSlot(this); --- 14 unchanged lines hidden --- | 498 scheduler.status(StatusTiming); 499 500 try { 501 while (!events.empty()) 502 events.front()->run(); 503 } catch (...) { 504 if (events.empty()) 505 scheduler.completeTimeSlot(this); --- 14 unchanged lines hidden --- |