OpenASIP  2.0
ExecutableInstruction.cc
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.cc
26  *
27  * Definition 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 #include "ExecutableInstruction.hh"
35 #include "ExecutableMove.hh"
36 #include "LongImmUpdateAction.hh"
37 #include "SequenceTools.hh"
38 
39 /**
40  * Constructor.
41  */
43  exitPoint_(false) {
45 }
46 
47 /**
48  * Destructor.
49  */
53 }
54 
55 /**
56  * Adds move to the instruction.
57  *
58  * Moves must be added in the same order they are in source Program model's
59  * instruction.
60  *
61  * @param move Move to be added.
62  */
63 void
65  moves_.push_back(move);
66 }
67 
68 /**
69  * Adds long immediate update action.
70  *
71  * @param action Action to be added.
72  */
73 void
75  LongImmUpdateAction* action) {
76  updateActions_.push_back(action);
77 }
78 
79 /**
80  * Returns the count of times this instruction has been executed so far.
81  *
82  * @return The execution count of this instruction.
83  */
86  return executionCount_;
87 }
88 
89 /**
90  * Resets the execution counters of this instruction and its moves.
91  */
92 void
94  executionCount_ = 0;
95  for (std::size_t i = 0; i < moves_.size(); ++i) {
96  moves_[i]->resetExecutionCount();
97  }
98 }
99 
100 /**
101  * Returns the count of full executions so far of move at given index.
102  *
103  * Squashed moves are not included in the count. Thus, to get count of
104  * times a move has be squashed, one should get the instruction execution
105  * count and subsract the move's execution count from it.
106  *
107  * @return Count of executions of move at given move slot.
108  */
110 ExecutableInstruction::moveExecutionCount(std::size_t moveIndex) const {
111  return moves_[moveIndex]->executionCount();
112 }
ExecutableInstruction::~ExecutableInstruction
virtual ~ExecutableInstruction()
Definition: ExecutableInstruction.cc:50
ExecutableInstruction::executionCount
ClockCycleCount executionCount() const
Definition: ExecutableInstruction.cc:85
SequenceTools.hh
LongImmUpdateAction
Definition: LongImmUpdateAction.hh:43
SequenceTools::deleteAllItems
static void deleteAllItems(SequenceType &aSequence)
ExecutableInstruction::ExecutableInstruction
ExecutableInstruction()
Definition: ExecutableInstruction.cc:42
LongImmUpdateAction.hh
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::resetExecutionCounts
void resetExecutionCounts()
Definition: ExecutableInstruction.cc:93
ExecutableMove.hh
ExecutableInstruction::moves_
MoveContainer moves_
All moves of the instruction.
Definition: ExecutableInstruction.hh:78
false
find Finds info of the inner loops in the false
Definition: InnerLoopFinder.cc:81
ExecutableInstruction::executionCount_
ClockCycleCount executionCount_
The count of times this instruction has been executed.
Definition: ExecutableInstruction.hh:82
ExecutableInstruction.hh
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
ExecutableInstruction::addLongImmediateUpdateAction
void addLongImmediateUpdateAction(LongImmUpdateAction *action)
Definition: ExecutableInstruction.cc:74
ExecutableInstruction::moveExecutionCount
ClockCycleCount moveExecutionCount(std::size_t moveIndex) const
Definition: ExecutableInstruction.cc:110