Deleted Added
sdiff udiff text old ( 10905:a6ca6831e775 ) new ( 10906:3ab1d7ed6545 )
full compact
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * Copyright (c) 2008 The Hewlett-Packard Development Company
4 * Copyright (c) 2013 Advanced Micro Devices, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

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

36#include <iostream>
37#include <string>
38#include <vector>
39
40#include "base/hashmap.hh"
41#include "base/misc.hh"
42#include "base/trace.hh"
43#include "cpu/smt.hh"
44#include "debug/Config.hh"
45#include "sim/core.hh"
46#include "sim/eventq_impl.hh"
47
48using namespace std;
49
50Tick simQuantum = 0;
51
52//

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

248 SERIALIZE_SCALAR(_priority);
249 short _flags = flags;
250 SERIALIZE_SCALAR(_flags);
251}
252
253void
254Event::unserialize(CheckpointIn &cp)
255{
256}
257
258void
259Event::unserializeEvent(CheckpointIn &cp, EventQueue *eventq)
260{
261 if (scheduled())
262 eventq->deschedule(this);
263
264 UNSERIALIZE_SCALAR(_when);
265 UNSERIALIZE_SCALAR(_priority);
266
267 short _flags;
268 UNSERIALIZE_SCALAR(_flags);
269
270 // Old checkpoints had no concept of the Initialized flag
271 // so restoring from old checkpoints always fail.
272 // Events are initialized on construction but original code
273 // "flags = _flags" would just overwrite the initialization.
274 // So, read in the checkpoint flags, but then set the Initialized
275 // flag on top of it in order to avoid failures.
276 assert(initialized());
277 flags = _flags;
278 flags.set(Initialized);
279
280 // need to see if original event was in a scheduled, unsquashed
281 // state, but don't want to restore those flags in the current
282 // object itself (since they aren't immediately true)
283 bool wasScheduled = flags.isSet(Scheduled) && !flags.isSet(Squashed);
284 flags.clear(Squashed | Scheduled);
285
286 if (wasScheduled) {
287 DPRINTF(Config, "rescheduling at %d\n", _when);
288 eventq->schedule(this, _when);
289 }
290}
291
292void
293EventQueue::serialize(CheckpointOut &cp) const
294{
295 std::list<Event *> eventPtrs;
296

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

324 UNSERIALIZE_SCALAR(numEvents);
325
326 std::string eventName;
327 for (int i = 0; i < numEvents; i++) {
328 // get the pointer value associated with the event
329 paramIn(cp, csprintf("event%d", i), eventName);
330
331 // create the event based on its pointer value
332 Serializable::create(cp, eventName);
333 }
334}
335
336void
337EventQueue::dump() const
338{
339 cprintf("============================================================\n");
340 cprintf("EventQueue Dump (cycle %d)\n", curTick());
341 cprintf("------------------------------------------------------------\n");
342
343 if (empty())
344 cprintf("<No Events>\n");

--- 140 unchanged lines hidden ---