OpenASIP 2.2
Loading...
Searching...
No Matches
FUPortImplementation.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 FUPortImplementation.cc
26 *
27 * Implementation of FUPortImplementation class.
28 *
29 * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#include <string>
34
36#include "FUImplementation.hh"
37
38using std::string;
39
40namespace HDB {
41
42/**
43 * The constructor.
44 *
45 * Adds the port automatically to the given FUImplementation.
46 *
47 * @param name Name of the port.
48 * @param architecturePort Name of the corresponding port in architecture.
49 * @param widthFormula The formula for the width of the port.
50 * @param loadPort Name of the load enable port.
51 * @param guardPort Name of the guard port if the port is guarded.
52 * @param parent The parent FU implementation.
53 */
55 const std::string& name,
56 const std::string& architecturePort,
57 const std::string& widthFormula,
58 const std::string& loadPort,
59 const std::string& guardPort,
60 FUImplementation& parent) :
61 PortImplementation(name, loadPort),
62 architecturePort_(architecturePort), widthFormula_(widthFormula),
63 guardPort_(guardPort) {
64
65 parent.addArchitecturePort(this);
66}
67
68
69/**
70 * The destructor.
71 */
74
75
76/**
77 * Sets the corresponding port in the FU architecture.
78 *
79 * @param name Name of the port.
80 */
81void
85
86
87/**
88 * Returns the name of the corresponding port in the FU architecture.
89 *
90 * @return The name of the port.
91 */
92std::string
96
97
98/**
99 * Sets the name of the guard port if the port is guarded.
100 *
101 * @param name Name of the guard port.
102 */
103void
104FUPortImplementation::setGuardPort(const std::string& name) {
106}
107
108
109/**
110 * Returns the name of the guard port if the port is guarded.
111 *
112 * @return The name of the guard port.
113 */
114std::string
118
119
120/**
121 * Sets the width formula of the port.
122 *
123 * @param formula The new formula.
124 */
125void
126FUPortImplementation::setWidthFormula(const std::string& formula) {
127 widthFormula_ = formula;
128}
129
130
131/**
132 * Returns the formula for the width of the port.
133 *
134 * @return The formula.
135 */
136std::string
140}
void addArchitecturePort(FUPortImplementation *port)
void setWidthFormula(const std::string &formula)
std::string guardPort_
Name of the guard port.
std::string widthFormula_
The formula for the width of the port.
void setArchitecturePort(const std::string &name)
FUPortImplementation(const std::string &name, const std::string &architecturePort, const std::string &widthFormula, const std::string &loadPort, const std::string &guardPort, FUImplementation &parent)
std::string architecturePort() const
std::string architecturePort_
Name of the corresponding port in architecture.
void setGuardPort(const std::string &name)