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

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

31#ifndef __SIM_SIM_EVENTS_HH__
32#define __SIM_SIM_EVENTS_HH__
33
34#include "sim/eventq.hh"
35
36//
37// Event to terminate simulation at a particular cycle/instruction
38//
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;

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

31#ifndef __SIM_SIM_EVENTS_HH__
32#define __SIM_SIM_EVENTS_HH__
33
34#include "sim/eventq.hh"
35
36//
37// Event to terminate simulation at a particular cycle/instruction
38//
39class SimExitEvent : public Event
39class SimLoopExitEvent : public Event
40{
41 private:
42 // string explaining why we're terminating
43 std::string cause;
44 int code;
45
46 public:
40{
41 private:
42 // string explaining why we're terminating
43 std::string cause;
44 int code;
45
46 public:
47 SimExitEvent(const std::string &_cause, int c = 0)
47 SimLoopExitEvent(Tick _when, const std::string &_cause, int c = 0)
48 : Event(&mainEventQueue, Sim_Exit_Pri), cause(_cause),
49 code(c)
48 : Event(&mainEventQueue, Sim_Exit_Pri), cause(_cause),
49 code(c)
50 { schedule(curTick); }
50 { setFlags(IsExitEvent); schedule(_when); }
51
51
52 SimExitEvent(Tick _when, const std::string &_cause, int c = 0)
53 : Event(&mainEventQueue, Sim_Exit_Pri), cause(_cause),
54 code(c)
55 { schedule(_when); }
56
57 SimExitEvent(EventQueue *q, const std::string &_cause, int c = 0)
52 SimLoopExitEvent(EventQueue *q,
53 Tick _when, const std::string &_cause, int c = 0)
58 : Event(q, Sim_Exit_Pri), cause(_cause), code(c)
54 : Event(q, Sim_Exit_Pri), cause(_cause), code(c)
59 { schedule(curTick); }
55 { setFlags(IsExitEvent); schedule(_when); }
60
56
61 SimExitEvent(EventQueue *q, Tick _when, const std::string &_cause,
62 int c = 0)
63 : Event(q, Sim_Exit_Pri), cause(_cause), code(c)
64 { schedule(_when); }
57 std::string getCause() { return cause; }
58 int getCode() { return code; }
65
66 void process(); // process event
67
68 virtual const char *description();
69};
70
71//
72// Event class to terminate simulation after 'n' related events have

--- 56 unchanged lines hidden ---
59
60 void process(); // process event
61
62 virtual const char *description();
63};
64
65//
66// Event class to terminate simulation after 'n' related events have

--- 56 unchanged lines hidden ---