scheduler.hh (12962:004cc9133bd6) | scheduler.hh (12985:ec84697e4e63) |
---|---|
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 --- 173 unchanged lines hidden (view full) --- 182 // Get the current time according to gem5. 183 Tick getCurTick() { return eq ? eq->getCurTick() : 0; } 184 185 // For scheduling delayed/timed notifications/timeouts. 186 void 187 schedule(::Event *event, Tick tick) 188 { 189 pendingTicks[tick]++; | 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 --- 173 unchanged lines hidden (view full) --- 182 // Get the current time according to gem5. 183 Tick getCurTick() { return eq ? eq->getCurTick() : 0; } 184 185 // For scheduling delayed/timed notifications/timeouts. 186 void 187 schedule(::Event *event, Tick tick) 188 { 189 pendingTicks[tick]++; |
190 eq->schedule(event, tick); | 190 191 if (initReady) 192 eq->schedule(event, tick); 193 else 194 eventsToSchedule[event] = tick; |
191 } 192 193 // For descheduling delayed/timed notifications/timeouts. 194 void 195 deschedule(::Event *event) 196 { 197 auto it = pendingTicks.find(event->when()); 198 if (--it->second == 0) 199 pendingTicks.erase(it); | 195 } 196 197 // For descheduling delayed/timed notifications/timeouts. 198 void 199 deschedule(::Event *event) 200 { 201 auto it = pendingTicks.find(event->when()); 202 if (--it->second == 0) 203 pendingTicks.erase(it); |
200 eq->deschedule(event); | 204 205 if (initReady) 206 eq->deschedule(event); 207 else 208 eventsToSchedule.erase(event); |
201 } 202 203 // Tell the scheduler than an event fired for bookkeeping purposes. 204 void 205 eventHappened() 206 { 207 auto it = pendingTicks.begin(); 208 if (--it->second == 0) --- 88 unchanged lines hidden (view full) --- 297 298 bool initReady; 299 300 ProcessList initList; 301 ProcessList toFinalize; 302 ProcessList readyList; 303 304 ChannelList updateList; | 209 } 210 211 // Tell the scheduler than an event fired for bookkeeping purposes. 212 void 213 eventHappened() 214 { 215 auto it = pendingTicks.begin(); 216 if (--it->second == 0) --- 88 unchanged lines hidden (view full) --- 305 306 bool initReady; 307 308 ProcessList initList; 309 ProcessList toFinalize; 310 ProcessList readyList; 311 312 ChannelList updateList; |
313 314 std::map<::Event *, Tick> eventsToSchedule; |
|
305}; 306 307extern Scheduler scheduler; 308 309} // namespace sc_gem5 310 311#endif // __SYSTEMC_CORE_SCHEDULER_H__ | 315}; 316 317extern Scheduler scheduler; 318 319} // namespace sc_gem5 320 321#endif // __SYSTEMC_CORE_SCHEDULER_H__ |