OpenASIP 2.2
Loading...
Searching...
No Matches
StopPointManager.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 StopPointManager.hh
26 *
27 * Declaration of StopPointManager 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_MANAGER_HH
34#define TTA_STOP_POINT_MANAGER_HH
35
36#include <vector>
37#include <map>
38
39#include "Exception.hh"
40#include "StopPoint.hh"
41#include "SimulatorConstants.hh"
42#include "Listener.hh"
43
46
47/**
48 * Keeps book of user-set simulation stop points.
49 */
50class StopPointManager : public Listener {
51public:
53 TTASimulationController& controller,
54 SimulationEventHandler& eventHandler);
55
56 virtual ~StopPointManager();
57 unsigned int add(const StopPoint& stopPoint);
58 void deleteStopPoint(unsigned int handle);
59 void deleteAll();
60
61 void enable(unsigned int handle);
62 void enableAll();
63
64 void enableOnceAndDelete(unsigned int handle);
65 void enableOnceAndDisable(unsigned int handle);
66
67 void disable(unsigned int handle);
68 void disableAll();
69
70 const StopPoint& stopPointWithHandleConst(unsigned int handle) const;
71
72 unsigned int stopPointHandle(unsigned int index);
73 unsigned int stopPointCount();
74
75 void setIgnore(unsigned int handle, unsigned int count);
76 void setCondition(unsigned int handle, const ConditionScript& condition);
77 void removeCondition(unsigned int handle);
78
79 unsigned int stopCausingStopPoint(unsigned int index) const;
80 unsigned int stopCausingStopPointCount() const;
81
82 void handleEvent();
83
84private:
85 /// The breakpoint storage.
86 typedef std::map<unsigned int, StopPoint*> StopPointIndex;
87 /// The handle storage.
88 typedef std::vector<unsigned int> HandleContainer;
89
90 StopPoint* findStopPoint(unsigned int handle);
91
92 /// The stop points.
94 /// The stop point handles.
96 /// Represents the next free handle.
97 unsigned int handleCount_;
98 /// The clock cycle in which simulation was stopped last.
100 /// The simulation controller to use to stop the simulation.
102 /// The event handler to use to register stop points to.
104
105};
106
107#endif
CycleCount ClockCycleCount
Alias for ClockCycleCount.
StopPointIndex stopPoints_
The stop points.
std::vector< unsigned int > HandleContainer
The handle storage.
void disable(unsigned int handle)
unsigned int handleCount_
Represents the next free handle.
void enableOnceAndDisable(unsigned int handle)
TTASimulationController & controller_
The simulation controller to use to stop the simulation.
virtual ~StopPointManager()
unsigned int stopPointCount()
void enable(unsigned int handle)
unsigned int stopCausingStopPointCount() const
ClockCycleCount lastStopCycle_
The clock cycle in which simulation was stopped last.
void enableOnceAndDelete(unsigned int handle)
unsigned int stopCausingStopPoint(unsigned int index) const
void removeCondition(unsigned int handle)
void deleteStopPoint(unsigned int handle)
SimulationEventHandler & eventHandler_
The event handler to use to register stop points to.
std::map< unsigned int, StopPoint * > StopPointIndex
The breakpoint storage.
unsigned int add(const StopPoint &stopPoint)
HandleContainer handles_
The stop point handles.
StopPoint * findStopPoint(unsigned int handle)
void setCondition(unsigned int handle, const ConditionScript &condition)
const StopPoint & stopPointWithHandleConst(unsigned int handle) const
void setIgnore(unsigned int handle, unsigned int count)
unsigned int stopPointHandle(unsigned int index)