OpenASIP  2.0
ExecutableInstruction.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 ExecutableInstruction.hh
26  *
27  * Declaration of ExecutableInstruction class.
28  *
29  * @author Jussi Nykänen 2005 (nykanen-no.spam-cs.tut.fi)
30  * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
31  * @note rating: red
32  */
33 
34 #ifndef TTA_EXECUTABLE_INSTRUCTION_HH
35 #define TTA_EXECUTABLE_INSTRUCTION_HH
36 
37 #include <vector>
38 #include "SimulatorConstants.hh"
39 
40 class ExecutableMove;
42 
43 /**
44  * Represents an interpreted TTA instruction.
45  *
46  * This class is used to simulate the data transports performed by a TTA
47  * instruction.
48  */
50 public:
52  virtual ~ExecutableInstruction();
53 
56 
57  void execute();
58 
60  ClockCycleCount moveExecutionCount(std::size_t moveIndex) const;
61  void resetExecutionCounts();
62 
63  bool moveSquashed(std::size_t moveIndex) const;
64 
65  void setExitPoint(bool b);
66  bool isExitPoint() const;
67 
68 private:
69  /// Copying not allowed.
71  /// Assignment not allowed.
73  /// Contains ExecutableMoves.
74  typedef std::vector<ExecutableMove*> MoveContainer;
75  /// Contains long immediate update actions.
76  typedef std::vector<LongImmUpdateAction*> UpdateContainer;
77  /// All moves of the instruction.
79  /// All long immediate update actions.
81  /// The count of times this instruction has been executed.
83  /// True in case the instruction is considered a program exit point.
84  bool exitPoint_;
85 };
86 
88 
89 #endif
ExecutableInstruction::~ExecutableInstruction
virtual ~ExecutableInstruction()
Definition: ExecutableInstruction.cc:50
ExecutableInstruction
Definition: ExecutableInstruction.hh:49
ExecutableInstruction::execute
void execute()
ExecutableInstruction::UpdateContainer
std::vector< LongImmUpdateAction * > UpdateContainer
Contains long immediate update actions.
Definition: ExecutableInstruction.hh:76
ExecutableInstruction::executionCount
ClockCycleCount executionCount() const
Definition: ExecutableInstruction.cc:85
LongImmUpdateAction
Definition: LongImmUpdateAction.hh:43
ExecutableInstruction::MoveContainer
std::vector< ExecutableMove * > MoveContainer
Contains ExecutableMoves.
Definition: ExecutableInstruction.hh:74
SimulatorConstants.hh
ExecutableInstruction::ExecutableInstruction
ExecutableInstruction()
Definition: ExecutableInstruction.cc:42
ExecutableInstruction.icc
ExecutableInstruction::setExitPoint
void setExitPoint(bool b)
ExecutableInstruction::moveSquashed
bool moveSquashed(std::size_t moveIndex) const
ExecutableMove
Definition: ExecutableMove.hh:52
ExecutableInstruction::addExecutableMove
void addExecutableMove(ExecutableMove *move)
Definition: ExecutableInstruction.cc:64
ExecutableInstruction::updateActions_
UpdateContainer updateActions_
All long immediate update actions.
Definition: ExecutableInstruction.hh:80
ExecutableInstruction::isExitPoint
bool isExitPoint() const
ExecutableInstruction::resetExecutionCounts
void resetExecutionCounts()
Definition: ExecutableInstruction.cc:93
ExecutableInstruction::moves_
MoveContainer moves_
All moves of the instruction.
Definition: ExecutableInstruction.hh:78
ExecutableInstruction::executionCount_
ClockCycleCount executionCount_
The count of times this instruction has been executed.
Definition: ExecutableInstruction.hh:82
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
ExecutableInstruction::operator=
ExecutableInstruction & operator=(const ExecutableInstruction &)
Assignment not allowed.
ExecutableInstruction::addLongImmediateUpdateAction
void addLongImmediateUpdateAction(LongImmUpdateAction *action)
Definition: ExecutableInstruction.cc:74
ExecutableInstruction::exitPoint_
bool exitPoint_
True in case the instruction is considered a program exit point.
Definition: ExecutableInstruction.hh:84
ExecutableInstruction::moveExecutionCount
ClockCycleCount moveExecutionCount(std::size_t moveIndex) const
Definition: ExecutableInstruction.cc:110