OpenASIP 2.2
Loading...
Searching...
No Matches
OpcodeSettingVirtualInputPortState.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 OpcodeSettingVirtualInputPortState.cc
26 *
27 * Definition of OpcodeSettingVirtualInputPortState 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
36#include "Operation.hh"
37#include "FUState.hh"
38#include "SimValue.hh"
39#include "Application.hh"
40
41using std::string;
42
43/**
44 * Constructor.
45 *
46 * @param Operation Operation of the port.
47 * @param parent Parent function unit.
48 * @param real The real port in which this port belongs to.
49 */
51 Operation& operation,
52 FUState& parent,
53 InputPortState& real) :
54 InputPortState(parent, real.value().width()),
55 operation_(operation), executor_(NULL),
56 real_(real) {
57}
58
59/**
60 * Constructor.
61 *
62 * @param Operation Operation of the port.
63 * @param executor OperationExecutor to use to execute the operation when it's
64 * triggered.
65 * @param parent Parent function unit.
66 * @param real The real port in which this port belongs to.
67 */
69 Operation& operation,
70 OperationExecutor& executor,
71 FUState& parent,
72 InputPortState& real) :
73 InputPortState(parent, real.value().width()),
74 operation_(operation), executor_(&executor),
75 real_(real) {
76}
77
78
79/**
80 * Destructor.
81 */
84
85/**
86 * Sets the value of the port and sets operation to function unit.
87 */
88void
99
100/**
101 * Returns the value of the parent port.
102 *
103 * @return The value of the parent port.
104 */
105const SimValue&
109
110/**
111 * Returns the real port.
112 *
113 * @return The real port.
114 */
void setTriggered()
void setOperation(Operation &operation)
OperationExecutor * executor_
Operation executor used to execute the operation in the target FU, this is an optimization to avoid s...
OpcodeSettingVirtualInputPortState(Operation &operation, OperationExecutor &executor, FUState &parent, InputPortState &real)
FUState * parent_
Parent of the port.
Definition PortState.hh:61
virtual void setValue(const SimValue &value)
virtual const SimValue & value() const