Deleted Added
sdiff udiff text old ( 10906:3ab1d7ed6545 ) new ( 11070:d9560edaf0a9 )
full compact
1/*
2 * Copyright (c) 2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

50#include "sim/sim_events.hh"
51#include "sim/sim_exit.hh"
52#include "sim/stats.hh"
53
54using namespace std;
55
56GlobalSimLoopExitEvent::GlobalSimLoopExitEvent(Tick when,
57 const std::string &_cause,
58 int c, Tick r, bool serialize)
59 : GlobalEvent(when, Sim_Exit_Pri,
60 IsExitEvent | (serialize ? AutoSerialize : 0)),
61 cause(_cause), code(c), repeat(r)
62{
63}
64
65const char *
66GlobalSimLoopExitEvent::description() const
67{
68 return "global simulation loop exit";

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

78 schedule(curTick() + repeat);
79 }
80}
81
82void
83exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat,
84 bool serialize)
85{
86 new GlobalSimLoopExitEvent(when + simQuantum, message, exit_code, repeat,
87 serialize);
88}
89
90LocalSimLoopExitEvent::LocalSimLoopExitEvent()
91 : Event(Sim_Exit_Pri, IsExitEvent | AutoSerialize),
92 cause(""), code(0), repeat(0)
93{
94}
95
96LocalSimLoopExitEvent::LocalSimLoopExitEvent(const std::string &_cause, int c,
97 Tick r, bool serialize)
98 : Event(Sim_Exit_Pri, IsExitEvent | (serialize ? AutoSerialize : 0)),
99 cause(_cause), code(c), repeat(r)
100{
101}
102
103//
104// handle termination event
105//
106void

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

114LocalSimLoopExitEvent::description() const
115{
116 return "simulation loop exit";
117}
118
119void
120LocalSimLoopExitEvent::serialize(CheckpointOut &cp) const
121{
122 paramOut(cp, "type", string("SimLoopExitEvent"));
123 Event::serialize(cp);
124
125 SERIALIZE_SCALAR(cause);
126 SERIALIZE_SCALAR(code);
127 SERIALIZE_SCALAR(repeat);
128}
129
130void
131LocalSimLoopExitEvent::unserialize(CheckpointIn &cp)
132{
133 Event::unserialize(cp);
134
135 UNSERIALIZE_SCALAR(cause);
136 UNSERIALIZE_SCALAR(code);
137 UNSERIALIZE_SCALAR(repeat);
138}
139
140Serializable *
141LocalSimLoopExitEvent::createForUnserialize(CheckpointIn &cp,
142 const string &section)
143{
144 return new LocalSimLoopExitEvent();
145}
146
147REGISTER_SERIALIZEABLE("LocalSimLoopExitEvent", LocalSimLoopExitEvent)
148
149//
150// constructor: automatically schedules at specified time
151//
152CountedExitEvent::CountedExitEvent(const std::string &_cause, int &counter)
153 : Event(Sim_Exit_Pri), cause(_cause), downCounter(counter)
154{
155 // catch stupid mistakes
156 assert(downCounter > 0);

--- 20 unchanged lines hidden ---