OpenASIP  2.0
Watch.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 Watch.hh
26  *
27  * Declaration of Watch class.
28  *
29  * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_WATCH_HH
34 #define TTA_WATCH_HH
35 
36 #include "SimulatorConstants.hh"
37 #include "BaseType.hh"
38 #include "StopPoint.hh"
39 #include "ExpressionScript.hh"
40 
41 class SimulatorFrontend;
42 
43 /**
44  * Represents a simulation watch point.
45  *
46  * Watch stops simulation when user-given expression changes its value.
47  */
48 class Watch : public StopPoint {
49 public:
50  Watch(
51  const SimulatorFrontend& frontend,
53  virtual ~Watch();
54 
55  virtual bool isTriggered() const;
56  virtual std::string description() const;
57  virtual StopPoint* copy() const;
58 
59  virtual const ExpressionScript& expression() const;
60  virtual void setExpression(const ExpressionScript& expression);
61 
62 private:
63  /// Static copying not allowed (should use copy()).
64  Watch(const Watch& source);
65  /// The expression that is watched.
67  /// The simulator frontend which is used to fetch the current PC.
69  /// Flag which tells whether the watch was triggered in current simulation
70  /// cycle.
71  mutable bool isTriggered_;
72  /// The simulation clock cycle in which the expression was checked the
73  /// last time.
75 };
76 
77 #endif
BaseType.hh
Watch::frontend_
const SimulatorFrontend & frontend_
The simulator frontend which is used to fetch the current PC.
Definition: Watch.hh:68
Watch
Definition: Watch.hh:48
ExpressionScript
Definition: ExpressionScript.hh:44
Watch::expression
virtual const ExpressionScript & expression() const
Definition: Watch.cc:88
SimulatorConstants.hh
Watch::~Watch
virtual ~Watch()
Definition: Watch.cc:58
Watch::description
virtual std::string description() const
Definition: Watch.cc:134
StopPoint
Definition: StopPoint.hh:53
Watch::expression_
ExpressionScript expression_
The expression that is watched.
Definition: Watch.hh:66
StopPoint.hh
Watch::Watch
Watch(const SimulatorFrontend &frontend, const ExpressionScript &expression)
Definition: Watch.cc:48
Watch::copy
virtual StopPoint * copy() const
Definition: Watch.cc:65
Watch::isTriggered_
bool isTriggered_
Flag which tells whether the watch was triggered in current simulation cycle.
Definition: Watch.hh:71
Watch::setExpression
virtual void setExpression(const ExpressionScript &expression)
Definition: Watch.cc:98
Watch::lastCheckedCycle_
ClockCycleCount lastCheckedCycle_
The simulation clock cycle in which the expression was checked the last time.
Definition: Watch.hh:74
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
ExpressionScript.hh
Watch::isTriggered
virtual bool isTriggered() const
Definition: Watch.cc:110