OpenASIP
2.0
src
applibs
hdb
RFPortImplementation.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 RFPortImplementation.cc
26
*
27
* Implementation of RFPortImplementation class.
28
*
29
* @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30
* @note rating: red
31
*/
32
33
#include "
RFPortImplementation.hh
"
34
#include "
RFImplementation.hh
"
35
36
namespace
HDB
{
37
38
/**
39
* The constructor.
40
*
41
* Adds the port automatically to the given parent RF implementation.
42
*
43
* @param name Name of the port.
44
* @param direction Direction of the port.
45
* @param loadPort Name of the load enable port.
46
* @param opcodePort Name of the opcode port.
47
* @param parent The parent RF implementation.
48
*/
49
RFPortImplementation::RFPortImplementation
(
50
const
std::string& name,
51
Direction
direction,
52
const
std::string& loadPort,
53
const
std::string& opcodePort,
54
const
std::string& opcodePortWidthFormula,
55
RFImplementation
& parent) :
56
PortImplementation
(name, loadPort), direction_(direction),
57
opcodePort_(opcodePort),
58
opcodePortWidthFormula_(opcodePortWidthFormula) {
59
60
parent.
addPort
(
this
);
61
}
62
63
64
/**
65
* The destructor.
66
*/
67
RFPortImplementation::~RFPortImplementation
() {
68
}
69
70
71
/**
72
* Sets the direction of the port.
73
*
74
* @param direction The new direction.
75
*/
76
void
77
RFPortImplementation::setDirection
(
Direction
direction) {
78
direction_
=
direction
;
79
}
80
81
82
/**
83
* Returns the direction of the port.
84
*
85
* @return The direction of the port.
86
*/
87
Direction
88
RFPortImplementation::direction
()
const
{
89
return
direction_
;
90
}
91
92
93
/**
94
* Sets the name of the opcode port.
95
*
96
* @param name The new name.
97
*/
98
void
99
RFPortImplementation::setOpcodePort
(
const
std::string& name) {
100
opcodePort_
=
name
;
101
}
102
103
104
/**
105
* Returns the name of the opcode port.
106
*
107
* @return The name of the opcode port.
108
*/
109
std::string
110
RFPortImplementation::opcodePort
()
const
{
111
return
opcodePort_
;
112
}
113
114
115
/**
116
* Sets the width formula of the opcode port.
117
*
118
* @param formula The new width formula.
119
*/
120
void
121
RFPortImplementation::setOpcodePortWidthFormula
(
const
std::string& formula) {
122
opcodePortWidthFormula_
= formula;
123
}
124
125
126
/**
127
* Returns the formula of the width of the opcode port.
128
*
129
* @return The formula.
130
*/
131
std::string
132
RFPortImplementation::opcodePortWidthFormula
()
const
{
133
return
opcodePortWidthFormula_
;
134
}
135
}
HDB::RFPortImplementation::opcodePortWidthFormula
std::string opcodePortWidthFormula() const
Definition:
RFPortImplementation.cc:132
HDB
Definition:
CostDatabase.hh:49
HDB::RFPortImplementation::direction
Direction direction() const
Definition:
RFPortImplementation.cc:88
HDB::RFPortImplementation::opcodePort_
std::string opcodePort_
Name of the opcode port.
Definition:
RFPortImplementation.hh:65
HDB::RFImplementation
Definition:
RFImplementation.hh:50
RFImplementation.hh
HDB::RFPortImplementation::~RFPortImplementation
virtual ~RFPortImplementation()
Definition:
RFPortImplementation.cc:67
HDB::Direction
Direction
Direction of port.
Definition:
HDBTypes.hh:40
RFPortImplementation.hh
HDB::PortImplementation
Definition:
PortImplementation.hh:44
HDB::RFPortImplementation::setOpcodePort
void setOpcodePort(const std::string &name)
Definition:
RFPortImplementation.cc:99
HDB::RFPortImplementation::setOpcodePortWidthFormula
void setOpcodePortWidthFormula(const std::string &formula)
Definition:
RFPortImplementation.cc:121
HDB::PortImplementation::name
std::string name() const
Definition:
PortImplementation.cc:74
HDB::RFPortImplementation::opcodePort
std::string opcodePort() const
Definition:
RFPortImplementation.cc:110
HDB::RFPortImplementation::opcodePortWidthFormula_
std::string opcodePortWidthFormula_
Width calculation formula for the opcode port.
Definition:
RFPortImplementation.hh:67
HDB::RFPortImplementation::RFPortImplementation
RFPortImplementation(const std::string &name, Direction direction, const std::string &loadPort, const std::string &opcodePort, const std::string &opcodePortWidthFormula, RFImplementation &parent)
Definition:
RFPortImplementation.cc:49
HDB::RFPortImplementation::direction_
Direction direction_
Direction of the port.
Definition:
RFPortImplementation.hh:63
HDB::RFPortImplementation::setDirection
void setDirection(Direction direction)
Definition:
RFPortImplementation.cc:77
HDB::RFImplementation::addPort
void addPort(RFPortImplementation *port)
Definition:
RFImplementation.cc:204
Generated by
1.8.17