OpenASIP  2.0
RFImplementation.hh
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 RFImplementation.hh
26  *
27  * Declaration of RFImplementation class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_RF_IMPLEMENTATION_HH
34 #define TTA_RF_IMPLEMENTATION_HH
35 
36 #include <vector>
37 #include "HWBlockImplementation.hh"
38 #include "Exception.hh"
39 #include "HDBTypes.hh"
40 
41 namespace HDB {
42 
43 class RFEntry;
44 class RFExternalPort;
45 class RFPortImplementation;
46 
47 /**
48  * Repsesents an implementation of a RF in HDB.
49  */
51 public:
52  /// Parameter of FU implementation.
54 
56  const std::string& moduleName,
57  const std::string& clkPort,
58  const std::string& rstPort,
59  const std::string& glockPort,
60  const std::string& sizeParam,
61  const std::string& widthParam,
62  const std::string& guardPort,
63  bool sacParam = false);
64  virtual ~RFImplementation();
65 
67 
68  void setSizeParameter(const std::string& sizeParam);
69  std::string sizeParameter() const;
70 
71  void setWidthParameter(const std::string& widthParam);
72  std::string widthParameter() const;
73 
74  void setGuardPort(const std::string& guardPort);
75  std::string guardPort() const;
76 
77  void setSeparateAddressCycleParameter(bool enable);
78  bool separateAddressCycleParameter() const;
79 
81  void addExternalPort(RFExternalPort* extPort);
84  int portCount() const;
85  int externalPortCount() const;
86  RFPortImplementation& port(int index) const;
87  RFExternalPort& externalPort(int index) const;
88 
89  void addParameter(
90  const std::string& name, const std::string& type,
91  const std::string& value);
92  void removeParameter(const std::string& name);
93  int parameterCount() const;
94  Parameter parameter(int index) const;
95  bool hasParameter(const std::string& name) const;
96 
97 private:
98  /// Vector type for RFPortImplementation.
99  typedef std::vector<RFPortImplementation*> PortTable;
100  /// Vector type for FUExternalPort.
101  typedef std::vector<RFExternalPort*> ExternalPortTable;
102  /// Vector type for parameter names.
103  typedef std::vector<Parameter> ParameterTable;
104 
105  /// Name of the size parameter.
106  std::string sizeParam_;
107  /// Name of the width parameter.
108  std::string widthParam_;
109  /// Name of the guard port.
110  std::string guardPort_;
111  /// State of separate address cycle parameter.
113 
114  /// Contains the ports.
116  /// Contains the external ports.
118  /// Contains the parameters.
120 };
121 }
122 
123 #endif
HDB::RFImplementation::setWidthParameter
void setWidthParameter(const std::string &widthParam)
Definition: RFImplementation.cc:143
HDB::HWBlockImplementation::clkPort
std::string clkPort() const
Definition: HWBlockImplementation.cc:175
HDBTypes.hh
HDB::RFImplementation::removeParameter
void removeParameter(const std::string &name)
Definition: RFImplementation.cc:335
HDB::RFImplementation::deleteExternalPort
void deleteExternalPort(RFExternalPort *port)
Definition: RFImplementation.cc:242
HDB
Definition: CostDatabase.hh:49
HDB::RFImplementation::setSeparateAddressCycleParameter
void setSeparateAddressCycleParameter(bool enable)
Definition: RFImplementation.cc:185
Exception.hh
HDB::RFImplementation::parameterCount
int parameterCount() const
Definition: RFImplementation.cc:352
HDB::RFImplementation::widthParameter
std::string widthParameter() const
Definition: RFImplementation.cc:154
HDB::RFImplementation::sizeParam_
std::string sizeParam_
Name of the size parameter.
Definition: RFImplementation.hh:106
HDB::RFImplementation::parameters_
ParameterTable parameters_
Contains the parameters.
Definition: RFImplementation.hh:119
HDB::HWBlockImplementation::rstPort
std::string rstPort() const
Definition: HWBlockImplementation.cc:197
HDB::RFImplementation::externalPorts_
ExternalPortTable externalPorts_
Contains the external ports.
Definition: RFImplementation.hh:117
HDB::RFImplementation::Parameter
HDB::Parameter Parameter
Parameter of FU implementation.
Definition: RFImplementation.hh:53
HDB::RFImplementation::hasParameter
bool hasParameter(const std::string &name) const
Definition: RFImplementation.cc:381
HDB::RFExternalPort
Definition: RFExternalPort.hh:41
HDB::RFImplementation::externalPort
RFExternalPort & externalPort(int index) const
Definition: RFImplementation.cc:299
HDB::RFImplementation
Definition: RFImplementation.hh:50
HDB::RFImplementation::ParameterTable
std::vector< Parameter > ParameterTable
Vector type for parameter names.
Definition: RFImplementation.hh:103
HDB::RFImplementation::sizeParameter
std::string sizeParameter() const
Definition: RFImplementation.cc:132
HDB::RFImplementation::setGuardPort
void setGuardPort(const std::string &guardPort)
Definition: RFImplementation.cc:165
HDB::RFImplementation::widthParam_
std::string widthParam_
Name of the width parameter.
Definition: RFImplementation.hh:108
HDB::RFImplementation::~RFImplementation
virtual ~RFImplementation()
Definition: RFImplementation.cc:110
HDB::RFImplementation::ExternalPortTable
std::vector< RFExternalPort * > ExternalPortTable
Vector type for FUExternalPort.
Definition: RFImplementation.hh:101
HDB::RFImplementation::addExternalPort
void addExternalPort(RFExternalPort *extPort)
Definition: RFImplementation.cc:214
HDB::RFImplementation::setSizeParameter
void setSizeParameter(const std::string &sizeParam)
Definition: RFImplementation.cc:121
HDB::HWBlockImplementation
Definition: HWBlockImplementation.hh:49
HDB::RFImplementation::port
RFPortImplementation & port(int index) const
Definition: RFImplementation.cc:281
HDB::RFImplementation::PortTable
std::vector< RFPortImplementation * > PortTable
Vector type for RFPortImplementation.
Definition: RFImplementation.hh:99
HDB::RFPortImplementation
Definition: RFPortImplementation.hh:43
HDB::RFImplementation::ports_
PortTable ports_
Contains the ports.
Definition: RFImplementation.hh:115
HDB::RFImplementation::guardPort_
std::string guardPort_
Name of the guard port.
Definition: RFImplementation.hh:110
HDB::RFImplementation::guardPort
std::string guardPort() const
Definition: RFImplementation.cc:176
HDB::RFImplementation::portCount
int portCount() const
Definition: RFImplementation.cc:255
HDB::RFImplementation::sepAddrCycleParam_
bool sepAddrCycleParam_
State of separate address cycle parameter.
Definition: RFImplementation.hh:112
HDB::RFImplementation::deletePort
void deletePort(RFPortImplementation *port)
Definition: RFImplementation.cc:227
HDB::RFImplementation::parameter
Parameter parameter(int index) const
Definition: RFImplementation.cc:366
HDB::Parameter
Definition: HDBTypes.hh:46
HDB::HWBlockImplementation::moduleName
std::string moduleName() const
Definition: HWBlockImplementation.cc:153
HDB::HWBlockImplementation::glockPort
std::string glockPort() const
Definition: HWBlockImplementation.cc:219
HDB::RFImplementation::RFImplementation
RFImplementation(const std::string &moduleName, const std::string &clkPort, const std::string &rstPort, const std::string &glockPort, const std::string &sizeParam, const std::string &widthParam, const std::string &guardPort, bool sacParam=false)
Definition: RFImplementation.cc:61
HDB::RFImplementation::externalPortCount
int externalPortCount() const
Definition: RFImplementation.cc:266
HDB::RFImplementation::addParameter
void addParameter(const std::string &name, const std::string &type, const std::string &value)
Definition: RFImplementation.cc:318
HDB::RFImplementation::separateAddressCycleParameter
bool separateAddressCycleParameter() const
Definition: RFImplementation.cc:194
HWBlockImplementation.hh
HDB::RFImplementation::addPort
void addPort(RFPortImplementation *port)
Definition: RFImplementation.cc:204