scheduler.hh (13133:41d8cd260825) | scheduler.hh (13140:ecd8a58f3884) |
---|---|
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 --- 261 unchanged lines hidden (view full) --- 270 deschedule(ts); 271 timeSlots.erase(tsit); 272 } 273 } 274 275 void 276 completeTimeSlot(TimeSlot *ts) 277 { | 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 --- 261 unchanged lines hidden (view full) --- 270 deschedule(ts); 271 timeSlots.erase(tsit); 272 } 273 } 274 275 void 276 completeTimeSlot(TimeSlot *ts) 277 { |
278 _changeStamp++; |
|
278 assert(ts == timeSlots.begin()->second); 279 timeSlots.erase(timeSlots.begin()); 280 if (!runToTime && starved()) 281 scheduleStarvationEvent(); 282 } 283 284 // Pending activity ignores gem5 activity, much like how a systemc 285 // simulation wouldn't know about asynchronous external events (socket IO --- 36 unchanged lines hidden (view full) --- 322 void oneCycle(); 323 324 void schedulePause(); 325 void scheduleStop(bool finish_delta); 326 327 bool paused() { return _paused; } 328 bool stopped() { return _stopped; } 329 | 279 assert(ts == timeSlots.begin()->second); 280 timeSlots.erase(timeSlots.begin()); 281 if (!runToTime && starved()) 282 scheduleStarvationEvent(); 283 } 284 285 // Pending activity ignores gem5 activity, much like how a systemc 286 // simulation wouldn't know about asynchronous external events (socket IO --- 36 unchanged lines hidden (view full) --- 323 void oneCycle(); 324 325 void schedulePause(); 326 void scheduleStop(bool finish_delta); 327 328 bool paused() { return _paused; } 329 bool stopped() { return _stopped; } 330 |
331 uint64_t changeStamp() { return _changeStamp; } 332 |
|
330 private: 331 typedef const EventBase::Priority Priority; 332 static Priority DefaultPriority = EventBase::Default_Pri; 333 334 static Priority StopPriority = DefaultPriority - 1; 335 static Priority PausePriority = DefaultPriority + 1; 336 static Priority MaxTickPriority = DefaultPriority + 2; 337 static Priority ReadyPriority = DefaultPriority + 3; --- 45 unchanged lines hidden (view full) --- 383 EventWrapper<Scheduler, &Scheduler::pause> starvationEvent; 384 void scheduleStarvationEvent(); 385 386 bool _started; 387 bool _paused; 388 bool _stopped; 389 390 Tick maxTick; | 333 private: 334 typedef const EventBase::Priority Priority; 335 static Priority DefaultPriority = EventBase::Default_Pri; 336 337 static Priority StopPriority = DefaultPriority - 1; 338 static Priority PausePriority = DefaultPriority + 1; 339 static Priority MaxTickPriority = DefaultPriority + 2; 340 static Priority ReadyPriority = DefaultPriority + 3; --- 45 unchanged lines hidden (view full) --- 386 EventWrapper<Scheduler, &Scheduler::pause> starvationEvent; 387 void scheduleStarvationEvent(); 388 389 bool _started; 390 bool _paused; 391 bool _stopped; 392 393 Tick maxTick; |
391 EventWrapper<Scheduler, &Scheduler::pause> maxTickEvent; | 394 Tick lastReadyTick; 395 void 396 maxTickFunc() 397 { 398 if (lastReadyTick != getCurTick()) 399 _changeStamp++; 400 pause(); 401 } 402 EventWrapper<Scheduler, &Scheduler::maxTickFunc> maxTickEvent; |
392 393 uint64_t _numCycles; | 403 404 uint64_t _numCycles; |
405 uint64_t _changeStamp; |
|
394 395 Process *_current; 396 397 bool initDone; 398 bool runToTime; 399 bool runOnce; 400 401 ProcessList initList; --- 21 unchanged lines hidden --- | 406 407 Process *_current; 408 409 bool initDone; 410 bool runToTime; 411 bool runOnce; 412 413 ProcessList initList; --- 21 unchanged lines hidden --- |