OpenASIP  2.0
StopPoint.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file Stoppoint.hh
26  *
27  * Declaration of StopPoint class.
28  *
29  * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_STOP_POINT_HH
34 #define TTA_STOP_POINT_HH
35 
36 #include "ConditionScript.hh"
37 #include "SimulatorConstants.hh"
38 #include "BaseType.hh"
39 
42 
43 /**
44  * Represents a stop point in simulation.
45  *
46  * StopPointManager uses this class to store information of each stop point of
47  * the simulation phase. StopPoint is a parent class for different types of
48  * user-set simulation stop conditions (currently breakpoints and watches).
49  *
50  * Each StopPoint listens to a simulation event (usually PC advance) and
51  * evaluates its stop condition.
52  */
53 class StopPoint {
54 public:
55  StopPoint();
56  virtual ~StopPoint();
57 
58  virtual void setEnabled(bool flag);
59  virtual bool isEnabled() const;
60 
61  virtual void setDisabledAfterTriggered(bool flag);
62  virtual bool isDisabledAfterTriggered() const;
63 
64  virtual void setDeletedAfterTriggered(bool flag);
65  virtual bool isDeletedAfterTriggered() const;
66 
67  virtual void setCondition(const ConditionScript& condition);
68  virtual void removeCondition();
69  virtual const ConditionScript& condition() const;
70  virtual bool isConditional() const;
71 
72  virtual void setIgnoreCount(unsigned int count);
73  virtual unsigned int ignoreCount() const;
74 
75  virtual bool isConditionOK();
76  virtual bool isTriggered() const = 0;
77  virtual std::string description() const = 0;
78  virtual StopPoint* copy() const = 0;
79 
80  virtual void decreaseIgnoreCount();
81 
82 protected:
83  /// Tells whether the breakpoint is enabled or disabled.
84  bool enabled_;
85  /// Tells if the breakpoint is disabled after it is triggered
86  /// the next time.
88  /// Tells if the breakpoint is deleted after it is triggered the next time.
90  /// Tells whether the breakpoint is conditional or not.
92  /// The condition which is used to determine whether the breakpoint
93  /// should be fired or not.
95  /// The number of times the condition is to be ignored before enabling
96  /// the breakpoint.
97  unsigned int ignoreCount_;
98 };
99 
100 #endif
101 
StopPoint::~StopPoint
virtual ~StopPoint()
Definition: StopPoint.cc:52
StopPoint::conditional_
bool conditional_
Tells whether the breakpoint is conditional or not.
Definition: StopPoint.hh:91
StopPoint::setEnabled
virtual void setEnabled(bool flag)
Definition: StopPoint.cc:63
BaseType.hh
StopPoint::setIgnoreCount
virtual void setIgnoreCount(unsigned int count)
Definition: StopPoint.cc:182
StopPoint::setDisabledAfterTriggered
virtual void setDisabledAfterTriggered(bool flag)
Definition: StopPoint.cc:85
StopPoint::enabled_
bool enabled_
Tells whether the breakpoint is enabled or disabled.
Definition: StopPoint.hh:84
SimulationEventHandler
Definition: SimulationEventHandler.hh:41
StopPoint::isDeletedAfterTriggered
virtual bool isDeletedAfterTriggered() const
Definition: StopPoint.cc:119
StopPoint::condition_
ConditionScript * condition_
The condition which is used to determine whether the breakpoint should be fired or not.
Definition: StopPoint.hh:94
StopPoint::ignoreCount
virtual unsigned int ignoreCount() const
Definition: StopPoint.cc:193
ConditionScript.hh
SimulatorConstants.hh
ConditionScript
Definition: ConditionScript.hh:45
StopPoint::copy
virtual StopPoint * copy() const =0
StopPoint::StopPoint
StopPoint()
Definition: StopPoint.cc:43
StopPoint::condition
virtual const ConditionScript & condition() const
Definition: StopPoint.cc:156
StopPoint
Definition: StopPoint.hh:53
StopPoint::isDisabledAfterTriggered
virtual bool isDisabledAfterTriggered() const
Definition: StopPoint.cc:97
StopPoint::isConditional
virtual bool isConditional() const
Definition: StopPoint.cc:173
StopPoint::deletedAfterTriggered_
bool deletedAfterTriggered_
Tells if the breakpoint is deleted after it is triggered the next time.
Definition: StopPoint.hh:89
StopPoint::isConditionOK
virtual bool isConditionOK()
Definition: StopPoint.cc:215
StopPoint::isEnabled
virtual bool isEnabled() const
Definition: StopPoint.cc:73
StopPoint::disabledAfterTriggered_
bool disabledAfterTriggered_
Tells if the breakpoint is disabled after it is triggered the next time.
Definition: StopPoint.hh:87
StopPoint::isTriggered
virtual bool isTriggered() const =0
SimulationController
Definition: SimulationController.hh:46
StopPoint::removeCondition
virtual void removeCondition()
Definition: StopPoint.cc:142
StopPoint::ignoreCount_
unsigned int ignoreCount_
The number of times the condition is to be ignored before enabling the breakpoint.
Definition: StopPoint.hh:97
StopPoint::description
virtual std::string description() const =0
Definition: StopPoint.cc:239
StopPoint::setDeletedAfterTriggered
virtual void setDeletedAfterTriggered(bool flag)
Definition: StopPoint.cc:107
StopPoint::setCondition
virtual void setCondition(const ConditionScript &condition)
Definition: StopPoint.cc:131
StopPoint::decreaseIgnoreCount
virtual void decreaseIgnoreCount()
Definition: StopPoint.cc:201