atomic.cc (5487:f0ac4112e128) | atomic.cc (5496:6899b894166f) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 162 unchanged lines hidden (view full) --- 171{ 172} 173 174void 175AtomicSimpleCPU::serialize(ostream &os) 176{ 177 SimObject::State so_state = SimObject::getState(); 178 SERIALIZE_ENUM(so_state); | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 162 unchanged lines hidden (view full) --- 171{ 172} 173 174void 175AtomicSimpleCPU::serialize(ostream &os) 176{ 177 SimObject::State so_state = SimObject::getState(); 178 SERIALIZE_ENUM(so_state); |
179 Status _status = status(); 180 SERIALIZE_ENUM(_status); | |
181 BaseSimpleCPU::serialize(os); 182 nameOut(os, csprintf("%s.tickEvent", name())); 183 tickEvent.serialize(os); 184} 185 186void 187AtomicSimpleCPU::unserialize(Checkpoint *cp, const string §ion) 188{ 189 SimObject::State so_state; 190 UNSERIALIZE_ENUM(so_state); | 179 BaseSimpleCPU::serialize(os); 180 nameOut(os, csprintf("%s.tickEvent", name())); 181 tickEvent.serialize(os); 182} 183 184void 185AtomicSimpleCPU::unserialize(Checkpoint *cp, const string §ion) 186{ 187 SimObject::State so_state; 188 UNSERIALIZE_ENUM(so_state); |
191 UNSERIALIZE_ENUM(_status); | |
192 BaseSimpleCPU::unserialize(cp, section); 193 tickEvent.unserialize(cp, csprintf("%s.tickEvent", section)); 194} 195 196void 197AtomicSimpleCPU::resume() 198{ 199 if (_status == Idle || _status == SwitchedOut) --- 8 unchanged lines hidden (view full) --- 208 tickEvent.schedule(nextCycle()); 209 } 210 } 211} 212 213void 214AtomicSimpleCPU::switchOut() 215{ | 189 BaseSimpleCPU::unserialize(cp, section); 190 tickEvent.unserialize(cp, csprintf("%s.tickEvent", section)); 191} 192 193void 194AtomicSimpleCPU::resume() 195{ 196 if (_status == Idle || _status == SwitchedOut) --- 8 unchanged lines hidden (view full) --- 205 tickEvent.schedule(nextCycle()); 206 } 207 } 208} 209 210void 211AtomicSimpleCPU::switchOut() 212{ |
216 assert(status() == Running || status() == Idle); | 213 assert(_status == Running || _status == Idle); |
217 _status = SwitchedOut; 218 219 tickEvent.squash(); 220} 221 222 223void 224AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU) --- 629 unchanged lines hidden --- | 214 _status = SwitchedOut; 215 216 tickEvent.squash(); 217} 218 219 220void 221AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU) --- 629 unchanged lines hidden --- |