eventq.cc (5602:9abcc140f346) | eventq.cc (5605:b194a80157e2) |
---|---|
1/* 2 * Copyright (c) 2000-2005 The Regents of The University of Michigan 3 * Copyright (c) 2008 The Hewlett-Packard Development Company 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 37 unchanged lines hidden (view full) --- 46using namespace std; 47 48// 49// Main Event Queue 50// 51// Events on this queue are processed at the *beginning* of each 52// cycle, before the pipeline simulation is performed. 53// | 1/* 2 * Copyright (c) 2000-2005 The Regents of The University of Michigan 3 * Copyright (c) 2008 The Hewlett-Packard Development Company 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 37 unchanged lines hidden (view full) --- 46using namespace std; 47 48// 49// Main Event Queue 50// 51// Events on this queue are processed at the *beginning* of each 52// cycle, before the pipeline simulation is performed. 53// |
54EventQueue mainEventQueue("MainEventQueue"); | 54EventQueue mainEventQueue("Main Event Queue"); |
55 56#ifndef NDEBUG 57Counter Event::instanceCounter = 0; 58#endif 59 60Event * 61Event::insertBefore(Event *event, Event *curr) 62{ --- 141 unchanged lines hidden (view full) --- 204 SERIALIZE_SCALAR(_when); 205 SERIALIZE_SCALAR(_priority); 206 SERIALIZE_ENUM(_flags); 207} 208 209void 210Event::unserialize(Checkpoint *cp, const string §ion) 211{ | 55 56#ifndef NDEBUG 57Counter Event::instanceCounter = 0; 58#endif 59 60Event * 61Event::insertBefore(Event *event, Event *curr) 62{ --- 141 unchanged lines hidden (view full) --- 204 SERIALIZE_SCALAR(_when); 205 SERIALIZE_SCALAR(_priority); 206 SERIALIZE_ENUM(_flags); 207} 208 209void 210Event::unserialize(Checkpoint *cp, const string §ion) 211{ |
212 if (scheduled()) 213 deschedule(); | 212 assert(!scheduled() && "we used to deschedule these events"); |
214 215 UNSERIALIZE_SCALAR(_when); 216 UNSERIALIZE_SCALAR(_priority); 217 218 // need to see if original event was in a scheduled, unsquashed 219 // state, but don't want to restore those flags in the current 220 // object itself (since they aren't immediately true) 221 UNSERIALIZE_ENUM(_flags); 222 bool wasScheduled = (_flags & Scheduled) && !(_flags & Squashed); 223 _flags &= ~(Squashed | Scheduled); 224 225 if (wasScheduled) { 226 DPRINTF(Config, "rescheduling at %d\n", _when); | 213 214 UNSERIALIZE_SCALAR(_when); 215 UNSERIALIZE_SCALAR(_priority); 216 217 // need to see if original event was in a scheduled, unsquashed 218 // state, but don't want to restore those flags in the current 219 // object itself (since they aren't immediately true) 220 UNSERIALIZE_ENUM(_flags); 221 bool wasScheduled = (_flags & Scheduled) && !(_flags & Squashed); 222 _flags &= ~(Squashed | Scheduled); 223 224 if (wasScheduled) { 225 DPRINTF(Config, "rescheduling at %d\n", _when); |
227 schedule(_when); | 226 panic("need to figure out how to unserialize scheduled events"); 227 //schedule(_when); |
228 } 229} 230 231void 232EventQueue::serialize(ostream &os) 233{ 234 std::list<Event *> eventPtrs; 235 --- 154 unchanged lines hidden --- | 228 } 229} 230 231void 232EventQueue::serialize(ostream &os) 233{ 234 std::list<Event *> eventPtrs; 235 --- 154 unchanged lines hidden --- |