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 SimLoopExitEvent : public Event |
40{ 41 private: 42 // string explaining why we're terminating 43 std::string cause; 44 int code; 45 46 public: |
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 65// 66// Event class to terminate simulation after 'n' related events have --- 56 unchanged lines hidden --- |