atomic.cc (2683:d6b72bb2ed97) atomic.cc (2798:751e9170247e)
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;

--- 131 unchanged lines hidden (view full) ---

140
141AtomicSimpleCPU::~AtomicSimpleCPU()
142{
143}
144
145void
146AtomicSimpleCPU::serialize(ostream &os)
147{
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;

--- 131 unchanged lines hidden (view full) ---

140
141AtomicSimpleCPU::~AtomicSimpleCPU()
142{
143}
144
145void
146AtomicSimpleCPU::serialize(ostream &os)
147{
148 BaseSimpleCPU::serialize(os);
149 SERIALIZE_ENUM(_status);
148 SERIALIZE_ENUM(_status);
149 BaseSimpleCPU::serialize(os);
150 nameOut(os, csprintf("%s.tickEvent", name()));
151 tickEvent.serialize(os);
152}
153
154void
155AtomicSimpleCPU::unserialize(Checkpoint *cp, const string &section)
156{
150 nameOut(os, csprintf("%s.tickEvent", name()));
151 tickEvent.serialize(os);
152}
153
154void
155AtomicSimpleCPU::unserialize(Checkpoint *cp, const string &section)
156{
157 BaseSimpleCPU::unserialize(cp, section);
158 UNSERIALIZE_ENUM(_status);
157 UNSERIALIZE_ENUM(_status);
158 BaseSimpleCPU::unserialize(cp, section);
159 tickEvent.unserialize(cp, csprintf("%s.tickEvent", section));
160}
161
162void
159 tickEvent.unserialize(cp, csprintf("%s.tickEvent", section));
160}
161
162void
163AtomicSimpleCPU::switchOut(Sampler *s)
163AtomicSimpleCPU::switchOut()
164{
164{
165 sampler = s;
166 if (status() == Running) {
167 _status = SwitchedOut;
165 assert(status() == Running || status() == Idle);
166 _status = SwitchedOut;
168
167
169 tickEvent.squash();
170 }
171 sampler->signalSwitched();
168 tickEvent.squash();
172}
173
174
175void
176AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
177{
178 BaseCPU::takeOverFrom(oldCPU);
179

--- 351 unchanged lines hidden ---
169}
170
171
172void
173AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
174{
175 BaseCPU::takeOverFrom(oldCPU);
176

--- 351 unchanged lines hidden ---