OpenASIP 2.2
Loading...
Searching...
No Matches
CostEstimationData.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 CostEstimationData.cc
26 *
27 * Implementation of CostEstimationData class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2006 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#include "CostEstimationData.hh"
34
35/**
36 * The Constructor.
37 */
39 hasName_(false), hasValue_(false),
40 hasFUReference_(false), hasRFReference_(false),
41 hasBusReference_(false), hasSocketReference_(false),
42 hasPluginID_(false) {
43
44}
45
46/**
47 * Destructor.
48 */
51
52/**
53 * Returns name of the cost estimation data value.
54 *
55 * @return Cost data name.
56 */
57std::string
59 if (!hasName_) {
60 throw NotAvailable(
61 __FILE__, __LINE__, __func__, "Attribute value not set.");
62 }
63
64 return name_;
65}
66
67/**
68 * Returns value of the cost estimation data.
69 *
70 * @return Cost data value.
71 */
74 if (!hasValue_) {
75 throw NotAvailable(
76 __FILE__, __LINE__, __func__, "Attribute value not set.");
77 }
78
79 return value_;
80}
81
82/**
83 * Returns the cost function plugin ID.
84 *
85 * @return Cost function plugin ID.
86 */
89 if (!hasPluginID_) {
90 throw NotAvailable(
91 __FILE__, __LINE__, __func__, "Attribute value not set.");
92 }
93
94 return pluginID_;
95}
96
97/**
98 * Returns the FU entry reference.
99 *
100 * @return Function unit entry reference.
101 */
102RowID
104 if (!hasFUReference_) {
105 throw NotAvailable(
106 __FILE__, __LINE__, __func__, "Attribute value not set.");
107 }
108
109 return fuReference_;
110}
111
112/**
113 * Returns the RF entry reference.
114 *
115 * @return Register file entry reference.
116 */
117RowID
119 if (!hasRFReference_) {
120 throw NotAvailable(
121 __FILE__, __LINE__, __func__, "Attribute value not set.");
122 }
123
124 return rfReference_;
125}
126
127/**
128 * Returns the bus entry reference.
129 *
130 * @return Register file entry reference.
131 */
132RowID
134 if (!hasBusReference_) {
135 throw NotAvailable(
136 __FILE__, __LINE__, __func__, "Attribute value not set.");
137 }
138
139 return busReference_;
140}
141
142/**
143 * Returns the socket entry reference.
144 *
145 * @return Register file entry reference.
146 */
147RowID
149 if (!hasSocketReference_) {
150 throw NotAvailable(
151 __FILE__, __LINE__, __func__, "Attribute value not set.");
152 }
153
154 return socketReference_;
155}
#define __func__
int RowID
Type definition of row ID in relational databases.
Definition DBTypes.hh:37
find Finds info of the inner loops in the false
DataObject value() const
bool hasSocketReference_
Is the socket reference set?
bool hasRFReference_
Is the RF reference set?
std::string name() const
RowID socketReference_
Socket reference.
bool hasPluginID_
Is the plugin ID set?
RowID pluginID_
Plugin ID.
RowID socketReference() const
RowID busReference_
Bus reference.
RowID rfReference_
RF reference.
bool hasName_
Is the data name set?
bool hasBusReference_
Is the bus reference set?
DataObject value_
Value data.
bool hasValue_
Is the value set?
std::string name_
Name of the data.
RowID fuReference_
FU reference.
bool hasFUReference_
Is the fu reference set?