OpenASIP 2.2
Loading...
Searching...
No Matches
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
41#include "Exception.hh"
42#include "HDBTypes.hh"
43
44namespace HDB {
45
46class FUEntry;
47class FUExternalPort;
48class FUPortImplementation;
49
50/**
51 * Represents the implementation specific properties of an FU in HDB.
52 */
54public:
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
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
108private:
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
void removeParameter(const std::string &name)
FUPortImplementation & architecturePort(int index) const
std::map< std::string, int > OpcodeMap
Map type for operation codes.
ParameterTable parameters_
Contains the parameters.
HDB::Parameter Parameter
Parameter of FU implementation.
void setGlockReqPort(const std::string &name)
void addArchitecturePort(FUPortImplementation *port)
Parameter parameter(int index) const
void unsetOpcode(const std::string &operation)
void setOpcodePort(const std::string &name)
bool hasOpcode(const std::string &operation) const
std::vector< FUExternalPort * > ExternalPortTable
Vector type for FUExternalPort.
std::string glockReqPort_
Name of the global lock request port.
std::string glockReqPort() const
bool hasParameter(const std::string &name) const
std::vector< FUPortImplementation * > PortTable
Vector type for FUPortImplementation.
std::string opcodeOperation(int index) const
void deleteExternalPort(FUExternalPort *port)
std::string opcodePort_
Name of the opcode port.
OpcodeMap opcodes_
Contains the operation codes.
void addExternalPort(FUExternalPort *port)
void addParameter(const std::string &name, const std::string &type, const std::string &value)
void deleteArchitecturePort(FUPortImplementation *port)
FUPortImplementation & portImplementationByArchitectureName(const std::string &architectureName) const
std::vector< Parameter > ParameterTable
Vector type for parameter names.
PortTable ports_
Contains the architectural ports.
FUExternalPort & externalPort(int index) const
std::string opcodePort() const
int opcode(const std::string &operation) const
ExternalPortTable externalPorts_
Contains the external ports.
void setOpcode(const std::string &operation, int opcode)