OpenASIP 2.2
Loading...
Searching...
No Matches
OneCycleOperationExecutor.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 OneCycleOperationExecutor.cc
26 *
27 * Definition of OneCycleOperationExecutor class.
28 *
29 * @author Jussi Nykänen 2004 (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
35#include "OperationContext.hh"
36#include "SimValue.hh"
37#include "Operation.hh"
38#include "SequenceTools.hh"
39#include "PortState.hh"
40#include "OperationPool.hh"
41#include "SimulatorToolbox.hh"
42#include "Application.hh"
43
44using std::vector;
45using std::string;
46
47/// a dummy simvalue which is given for operands that are not bound
49
50/**
51 * Constructor.
52 *
53 * @param parent Parent of the executor.
54 */
56 OperationExecutor(parent), context_(NULL), operation_(NULL),
57 io_(NULL), ready_(false), ioVectorInitialized_(false) {
58}
59
60/**
61 * Destructor.
62 */
67
68/**
69 * Returns the latency of the executor.
70 *
71 * @return The latency of the executor.
72 */
73int
75 return 1;
76}
77
78/**
79 * Initializes the operation input/output vector.
80 *
81 * The I/O vector points directly to the function unit port register
82 * values. This is possible because there cannot be any other pending
83 * operations at once because of latency of 1.
84 */
85inline void
88 return;
89 io_ = new SimValue*[bindings_.size()];
90 for (size_t i = 0; i < bindings_.size(); ++i) {
91 io_[i] = const_cast<SimValue*>(&bindings_[i]->value());
92 }
94}
95
96/**
97 * Starts the execution of the operation.
98 *
99 * @param op Operation to be triggered.
100 */
101void
108
109/**
110 * Advances clock by one cycle.
111 */
112void
117
118/**
119 * Copies OperationExecutor.
120 *
121 * @return The copied OperationExecutor.
122 */
127
128/**
129 * Sets new context for the OperationExecutor.
130 *
131 * @param context New OperationContext.
132 */
133void
137
find Finds info of the inner loops in the false
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
bool ready_
True if all the results are ready.
OperationContext * context_
Operation context.
virtual OperationExecutor * copy()
virtual void startOperation(Operation &op)
SimValue ** io_
Inputs and outputs for the operation.
Operation * operation_
Operation to be executed next.
virtual void setContext(OperationContext &context)
bool ioVectorInitialized_
True if the io_ vector is initialized-.
bool hasPendingOperations_
This is set to true if the OperationExecutor is not in 'idle' mode.
std::vector< PortState * > bindings_
PortStates that are bound to a certain input or output operand.
virtual bool simulateTrigger(SimValue **, OperationContext &context) const
Definition Operation.cc:555