OpenASIP  2.0
FUImplementation.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 FUImplementation.hh
26  *
27  * Declaration of FUImplementation class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_FU_IMPLEMENTATION_HH
34 #define TTA_FU_IMPLEMENTATION_HH
35 
36 #include <string>
37 #include <vector>
38 #include <map>
39 
40 #include "HWBlockImplementation.hh"
41 #include "Exception.hh"
42 #include "HDBTypes.hh"
43 
44 namespace HDB {
45 
46 class FUEntry;
47 class FUExternalPort;
48 class FUPortImplementation;
49 
50 /**
51  * Represents the implementation specific properties of an FU in HDB.
52  */
54 public:
55  /// Parameter of FU implementation.
56  /*struct Parameter {
57  std::string name; ///< Name of the parameter.
58  std::string type; ///< Type of the parameter.
59  std::string value; ///< Value of the parameter.
60  };*/
62 
64  const std::string& name,
65  const std::string& opcodePort,
66  const std::string& clkPort,
67  const std::string& rstPort,
68  const std::string& glockPort,
69  const std::string& glockReqPort);
70  virtual ~FUImplementation();
71 
73 
74  void setOpcodePort(const std::string& name);
75  std::string opcodePort() const;
76  void setGlockReqPort(const std::string& name);
77  std::string glockReqPort() const;
78 
79  void setOpcode(const std::string& operation, int opcode);
80  void unsetOpcode(const std::string& operation);
81  int opcodeCount() const;
82  std::string opcodeOperation(int index) const;
83  bool hasOpcode(const std::string& operation) const;
84  int opcode(const std::string& operation) const;
85  int maxOpcodeWidth() const;
86 
89  void addExternalPort(FUExternalPort* port);
91 
92  int architecturePortCount() const;
93  int externalPortCount() const;
94 
95  FUPortImplementation& architecturePort(int index) const;
97  const std::string& architectureName) const;
98  FUExternalPort& externalPort(int index) const;
99 
100  void addParameter(
101  const std::string& name, const std::string& type,
102  const std::string& value);
103  void removeParameter(const std::string& name);
104  int parameterCount() const;
105  Parameter parameter(int index) const;
106  bool hasParameter(const std::string& name) const;
107 
108 private:
109  /// Vector type for FUPortImplementation.
110  typedef std::vector<FUPortImplementation*> PortTable;
111  /// Vector type for FUExternalPort.
112  typedef std::vector<FUExternalPort*> ExternalPortTable;
113  /// Map type for operation codes.
114  typedef std::map<std::string, int> OpcodeMap;
115  /// Vector type for parameter names.
116  typedef std::vector<Parameter> ParameterTable;
117 
118  /// Name of the opcode port.
119  std::string opcodePort_;
120  /// Name of the global lock request port.
121  std::string glockReqPort_;
122 
123  /// Contains the architectural ports.
125  /// Contains the external ports.
127  /// Contains the operation codes.
129  /// Contains the parameters.
131 };
132 }
133 
134 #endif
HDB::FUImplementation::parameters_
ParameterTable parameters_
Contains the parameters.
Definition: FUImplementation.hh:130
HDB::FUExternalPort
Definition: FUExternalPort.hh:52
HDB::HWBlockImplementation::clkPort
std::string clkPort() const
Definition: HWBlockImplementation.cc:175
HDBTypes.hh
HDB::FUImplementation::ParameterTable
std::vector< Parameter > ParameterTable
Vector type for parameter names.
Definition: FUImplementation.hh:116
HDB::FUImplementation::addArchitecturePort
void addArchitecturePort(FUPortImplementation *port)
Definition: FUImplementation.cc:274
HDB::FUImplementation::opcodes_
OpcodeMap opcodes_
Contains the operation codes.
Definition: FUImplementation.hh:128
HDB::FUImplementation::hasOpcode
bool hasOpcode(const std::string &operation) const
Definition: FUImplementation.cc:227
HDB::FUImplementation::opcodeCount
int opcodeCount() const
Definition: FUImplementation.cc:194
HDB::FUImplementation::glockReqPort_
std::string glockReqPort_
Name of the global lock request port.
Definition: FUImplementation.hh:121
HDB
Definition: CostDatabase.hh:49
Exception.hh
HDB::FUImplementation::OpcodeMap
std::map< std::string, int > OpcodeMap
Map type for operation codes.
Definition: FUImplementation.hh:114
HDB::FUImplementation::PortTable
std::vector< FUPortImplementation * > PortTable
Vector type for FUPortImplementation.
Definition: FUImplementation.hh:110
HDB::FUPortImplementation
Definition: FUPortImplementation.hh:46
HDB::FUImplementation::addExternalPort
void addExternalPort(FUExternalPort *port)
Definition: FUImplementation.cc:300
HDB::FUImplementation::Parameter
HDB::Parameter Parameter
Parameter of FU implementation.
Definition: FUImplementation.hh:61
HDB::FUImplementation::externalPort
FUExternalPort & externalPort(int index) const
Definition: FUImplementation.cc:390
HDB::FUImplementation::opcodePort
std::string opcodePort() const
Definition: FUImplementation.cc:135
HDB::FUImplementation::opcodePort_
std::string opcodePort_
Name of the opcode port.
Definition: FUImplementation.hh:119
HDB::HWBlockImplementation::rstPort
std::string rstPort() const
Definition: HWBlockImplementation.cc:197
HDB::FUImplementation::glockReqPort
std::string glockReqPort() const
Definition: FUImplementation.cc:157
HDB::FUImplementation::parameterCount
int parameterCount() const
Definition: FUImplementation.cc:443
HDB::FUImplementation::setGlockReqPort
void setGlockReqPort(const std::string &name)
Definition: FUImplementation.cc:146
HDB::FUImplementation::ExternalPortTable
std::vector< FUExternalPort * > ExternalPortTable
Vector type for FUExternalPort.
Definition: FUImplementation.hh:112
HDB::FUImplementation::externalPorts_
ExternalPortTable externalPorts_
Contains the external ports.
Definition: FUImplementation.hh:126
HDB::FUImplementation::addParameter
void addParameter(const std::string &name, const std::string &type, const std::string &value)
Definition: FUImplementation.cc:409
HDB::FUImplementation::opcodeOperation
std::string opcodeOperation(int index) const
Definition: FUImplementation.cc:207
HDB::FUImplementation::FUImplementation
FUImplementation(const std::string &name, const std::string &opcodePort, const std::string &clkPort, const std::string &rstPort, const std::string &glockPort, const std::string &glockReqPort)
Definition: FUImplementation.cc:62
HDB::HWBlockImplementation
Definition: HWBlockImplementation.hh:49
HDB::FUImplementation::setOpcode
void setOpcode(const std::string &operation, int opcode)
Definition: FUImplementation.cc:169
HDB::FUImplementation::deleteExternalPort
void deleteExternalPort(FUExternalPort *port)
Definition: FUImplementation.cc:313
HDB::FUImplementation::setOpcodePort
void setOpcodePort(const std::string &name)
Definition: FUImplementation.cc:124
HDB::FUImplementation
Definition: FUImplementation.hh:53
HDB::FUImplementation::opcode
int opcode(const std::string &operation) const
Definition: FUImplementation.cc:242
HDB::FUImplementation::deleteArchitecturePort
void deleteArchitecturePort(FUPortImplementation *port)
Definition: FUImplementation.cc:287
HDB::FUImplementation::parameter
Parameter parameter(int index) const
Definition: FUImplementation.cc:457
HDB::FUImplementation::unsetOpcode
void unsetOpcode(const std::string &operation)
Definition: FUImplementation.cc:182
HDB::FUImplementation::architecturePortCount
int architecturePortCount() const
Definition: FUImplementation.cc:326
HDB::FUImplementation::~FUImplementation
virtual ~FUImplementation()
Definition: FUImplementation.cc:113
HDB::Parameter
Definition: HDBTypes.hh:46
HDB::FUImplementation::maxOpcodeWidth
int maxOpcodeWidth() const
Definition: FUImplementation.cc:257
HDB::HWBlockImplementation::glockPort
std::string glockPort() const
Definition: HWBlockImplementation.cc:219
HDB::FUImplementation::portImplementationByArchitectureName
FUPortImplementation & portImplementationByArchitectureName(const std::string &architectureName) const
Definition: FUImplementation.cc:370
HDB::FUImplementation::architecturePort
FUPortImplementation & architecturePort(int index) const
Definition: FUImplementation.cc:351
HDB::FUImplementation::externalPortCount
int externalPortCount() const
Definition: FUImplementation.cc:337
HWBlockImplementation.hh
HDB::FUImplementation::hasParameter
bool hasParameter(const std::string &name) const
Definition: FUImplementation.cc:472
HDB::FUImplementation::removeParameter
void removeParameter(const std::string &name)
Definition: FUImplementation.cc:426
HDB::FUImplementation::ports_
PortTable ports_
Contains the architectural ports.
Definition: FUImplementation.hh:124