OpenASIP 2.2
Loading...
Searching...
No Matches
ICDecoderEstimatorPlugin.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 ICDecoderEstimatorPlugin.cc
26 *
27 * Implementation of ICDecoderEstimatorPlugin class.
28 *
29 * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
34#include "ControlUnit.hh"
35#include "FUPort.hh"
37#include "HWOperation.hh"
38#include "ExecutionPipeline.hh"
39
40namespace CostEstimator {
41/**
42 * Constructor.
43 *
44 * @param name The name of the cost estimation plugin in the HDB.
45 * @param dataSource The HDB that stores the cost estimation data of
46 * the plugin. This reference can also be used to add new
47 * data, in case required by the algorithm.
48 */
53
54/**
55 * Destructor.
56 */
59
60/**
61 * Estimates the delay of the given path in the interconnection network.
62 *
63 * The estimated path starts from source socket and traverses through a bus
64 * to a target socket. The delay caused by reading and writing from ports are
65 * not included in this value. The default implementation returns false to
66 * signal that the estimation functionality is not implemented by the plugin.
67 *
68 * @param hdbRegistry The registry for accessing HDBs.
69 * @param path The path.
70 * @param machineImplementation The implementation of the machine.
71 * @param sourceSocketImplementation The implementation identification of
72 * the source socket.
73 * @param busImplementation The implementation identification of the bus.
74 * @param destinationSocketImplementation The implementation identification
75 * of the destination socket.
76 * @param delay The calculated delay should be stored in this argument.
77 * @return True in case the delay can be estimated, false if it cannot.
78 */
79bool
91
92/**
93 * Estimates the area of the IC of the given machine.
94 *
95 * @param hdbRegistry The registry for accessing HDBs.
96 * @param machine Architecture of the machine.
97 * @param machineImplementation The implementation of the machine.
98 * @param area The calculated area should be stored in this argument.
99 * @return True in case the area can be estimated, false if it cannot.
100 */
101bool
110
111/**
112 * Estimates the energy consumed by the IC of the given machine by running
113 * the given program.
114 *
115 * @param hdbRegistry The registry for accessing HDBs.
116 * @param machine Architecture of the processor.
117 * @param machineImplementation Implementation defintions of the processor.
118 * @param traceDB The simulation trace database obtained from running the
119 * program.
120 * @param energy The calculated energy should be stored in this argument.
121 * @return True in case energy can be estimated, false if it cannot.
122 */
123bool
134
135/**
136 * Generates a control unit.
137 *
138 * @return The control unit.
139 */
142
143 const std::string RA_PORT_NAME = "ra";
144 const std::string OP_PORT_NAME = "pc";
145 const std::string OPNAME_JUMP = "jump";
146 const std::string OPNAME_CALL = "call";
147 const std::string COMP_DEFAULT_NAME_GCU = "gcu";
148
149 // Add default ports.
151 COMP_DEFAULT_NAME_GCU, 3, 1);
152
153 TTAMachine::FUPort* opPort =
154 new TTAMachine::FUPort(OP_PORT_NAME, 32, *gcu, true, true);
156 new TTAMachine::SpecialRegisterPort(RA_PORT_NAME, 32, *gcu);
157
158 gcu->setReturnAddressPort(*raPort);
159
160 // Add default operations.
162 new TTAMachine::HWOperation(OPNAME_JUMP, *gcu);
163 jump->bindPort(1, *opPort);
164 jump->pipeline()->addPortRead(1, 0, 1);
165
167 new TTAMachine::HWOperation(OPNAME_CALL, *gcu);
168 call->bindPort(1, *opPort);
169 call->pipeline()->addPortRead(1, 0, 1);
170
171 return gcu;
172}
173
174}
175
virtual bool estimateICDelayOfPath(HDB::HDBRegistry &hdbRegistry, const TransportPath &path, const IDF::MachineImplementation &machineImplementation, const IDF::SocketImplementationLocation &sourceSocketImplementation, const IDF::BusImplementationLocation &busImplementation, const IDF::SocketImplementationLocation &destinationSocketImplementation, DelayInNanoSeconds &delay)
virtual bool estimateICEnergy(HDB::HDBRegistry &hdbRegistry, const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB, EnergyInMilliJoules &energy)
virtual bool estimateICArea(HDB::HDBRegistry &hdbRegistry, const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, AreaInGates &area)
virtual TTAMachine::ControlUnit * generateControlUnit()
void setReturnAddressPort(const SpecialRegisterPort &port)
void addPortRead(int operand, int start, int duration)
ExecutionPipeline * pipeline() const
virtual void bindPort(int operand, const FUPort &port)
double AreaInGates
type for area values in equivalent gates
double DelayInNanoSeconds
type for propagation delays in nano seconds
double EnergyInMilliJoules
type for consumed energy in milli joules