sim_events.hh (2667:fe64b8353b1c) sim_events.hh (2797:b5f26b4eacef)
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;

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

39class SimLoopExitEvent : public Event
40{
41 private:
42 // string explaining why we're terminating
43 std::string cause;
44 int code;
45
46 public:
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;

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

39class SimLoopExitEvent : public Event
40{
41 private:
42 // string explaining why we're terminating
43 std::string cause;
44 int code;
45
46 public:
47 // Default constructor. Only really used for derived classes.
48 SimLoopExitEvent()
49 : Event(&mainEventQueue, Sim_Exit_Pri)
50 { }
51
47 SimLoopExitEvent(Tick _when, const std::string &_cause, int c = 0)
48 : Event(&mainEventQueue, Sim_Exit_Pri), cause(_cause),
49 code(c)
50 { setFlags(IsExitEvent); schedule(_when); }
51
52 SimLoopExitEvent(EventQueue *q,
53 Tick _when, const std::string &_cause, int c = 0)
54 : Event(q, Sim_Exit_Pri), cause(_cause), code(c)
55 { setFlags(IsExitEvent); schedule(_when); }
56
57 std::string getCause() { return cause; }
58 int getCode() { return code; }
59
60 void process(); // process event
61
62 virtual const char *description();
63};
64
52 SimLoopExitEvent(Tick _when, const std::string &_cause, int c = 0)
53 : Event(&mainEventQueue, Sim_Exit_Pri), cause(_cause),
54 code(c)
55 { setFlags(IsExitEvent); schedule(_when); }
56
57 SimLoopExitEvent(EventQueue *q,
58 Tick _when, const std::string &_cause, int c = 0)
59 : Event(q, Sim_Exit_Pri), cause(_cause), code(c)
60 { setFlags(IsExitEvent); schedule(_when); }
61
62 std::string getCause() { return cause; }
63 int getCode() { return code; }
64
65 void process(); // process event
66
67 virtual const char *description();
68};
69
70class CountedQuiesceEvent : public SimLoopExitEvent
71{
72 private:
73 // Count down to quiescing
74 int count;
75 public:
76 CountedQuiesceEvent()
77 : count(0)
78 { }
79 void process();
80
81 void setCount(int _count) { count = _count; }
82
83 int getCount() { return count; }
84};
85
65//
66// Event class to terminate simulation after 'n' related events have
67// occurred using a shared counter: used to terminate when *all*
68// threads have reached a particular instruction count
69//
70class CountedExitEvent : public Event
71{
72 private:

--- 50 unchanged lines hidden ---
86//
87// Event class to terminate simulation after 'n' related events have
88// occurred using a shared counter: used to terminate when *all*
89// threads have reached a particular instruction count
90//
91class CountedExitEvent : public Event
92{
93 private:

--- 50 unchanged lines hidden ---