serialize.cc (2868:6a7e69fa92d3) serialize.cc (3125:febd811bccc6)
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;

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

47#include "base/trace.hh"
48#include "sim/eventq.hh"
49#include "sim/param.hh"
50#include "sim/serialize.hh"
51#include "sim/sim_events.hh"
52#include "sim/sim_exit.hh"
53#include "sim/sim_object.hh"
54
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;

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

47#include "base/trace.hh"
48#include "sim/eventq.hh"
49#include "sim/param.hh"
50#include "sim/serialize.hh"
51#include "sim/sim_events.hh"
52#include "sim/sim_exit.hh"
53#include "sim/sim_object.hh"
54
55// For stat reset hack
56#include "sim/stat_control.hh"
57
55using namespace std;
56
57int Serializable::ckptMaxCount = 0;
58int Serializable::ckptCount = 0;
59int Serializable::ckptPrevCount = -1;
60
61void
62Serializable::nameOut(ostream &os)

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

399}
400
401
402bool
403Checkpoint::sectionExists(const std::string &section)
404{
405 return db->sectionExists(section);
406}
58using namespace std;
59
60int Serializable::ckptMaxCount = 0;
61int Serializable::ckptCount = 0;
62int Serializable::ckptPrevCount = -1;
63
64void
65Serializable::nameOut(ostream &os)

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

402}
403
404
405bool
406Checkpoint::sectionExists(const std::string &section)
407{
408 return db->sectionExists(section);
409}
410
411/** Hacked stat reset event */
412
413class StatresetParamContext : public ParamContext
414{
415 public:
416 StatresetParamContext(const string &section);
417 ~StatresetParamContext();
418 void startup();
419};
420
421StatresetParamContext statParams("statsreset");
422
423Param<Tick> reset_cycle(&statParams, "reset_cycle",
424 "Cycle to reset stats on", 0);
425
426StatresetParamContext::StatresetParamContext(const string &section)
427 : ParamContext(section)
428{ }
429
430StatresetParamContext::~StatresetParamContext()
431{
432}
433
434void
435StatresetParamContext::startup()
436{
437 if (reset_cycle > 0) {
438 Stats::SetupEvent(Stats::Reset, curTick + reset_cycle, 0);
439 cprintf("Stats reset event scheduled for %lli\n",
440 curTick + reset_cycle);
441 }
442}