OpenASIP  2.0
IPXactModel.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2010 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 IPXactModel.hh
26  *
27  * Declaration of IPXactModel class.
28  *
29  * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
30  * @note rating: red
31  */
32 #ifndef TTA_IP_XACT_MODEL_HH
33 #define TTA_IP_XACT_MODEL_HH
34 
35 #include <string>
36 #include <vector>
37 #include "Serializable.hh"
38 #include "HDLPort.hh"
39 #include "Vlnv.hh"
40 #include "Netlist.hh"
41 #include "Parameter.hh"
42 
43 class IPXactInterface;
44 
45 class IPXactAddressSpace;
46 
47 class IPXactModel : public Serializable {
48 public:
49 
50  enum BusMode {
59  };
60 
61  IPXactModel();
62 
63  IPXactModel(const ObjectState* state);
64 
65  virtual ~IPXactModel();
66 
67  virtual void loadState(const ObjectState* state);
68 
69  virtual ObjectState* saveState() const;
70 
71  void setVLNV(
72  TCEString vendor,
73  TCEString library,
74  TCEString name,
75  TCEString version);
76 
77  void setHdlFile(const TCEString& file);
78 
79  void setFile(const TCEString& file);
80 
81  void setHdlFiles(const std::vector<TCEString>& files);
82 
83  void addSignal(const HDLPort& signal);
84 
85  void addParameter(const ProGe::Parameter& parameter);
86 
87  void addBusInterface(IPXactInterface* interface);
88 
89  void addAddressSpace(IPXactAddressSpace* addrSpace);
90 
92  static const TCEString OSNAME_VENDOR;
93  static const TCEString OSNAME_LIBRARY;
94  static const TCEString OSNAME_NAME;
95  static const TCEString OSNAME_VERSION;
98  static const TCEString OSNAME_BUS_TYPE;
112  static const TCEString OSNAME_MODEL;
113  static const TCEString OSNAME_PORTS;
114  static const TCEString OSNAME_WIRE;
115  static const TCEString OSNAME_VECTOR;
116  static const TCEString OSNAME_PORT;
121  static const TCEString OSNAME_FILESET;
122  static const TCEString OSNAME_FILE;
125  static const std::string OSNAME_ADDRESS_SPACES;
126  static const std::string OSNAME_ADDRESS_SPACE;
127  static const std::string OSNAME_AS_RANGE;
128  static const std::string OSNAME_AS_WIDTH;
129  static const std::string OSNAME_AS_MAU;
133  static const TCEString OSNAME_VALUE;
136  static const TCEString OSNAME_ATTR_ID;
138 
139 private:
140 
141  IPXactModel(const IPXactModel& old);
142 
144  const IPXactInterface* bus,
145  ObjectState* parent) const;
146 
148  const IPXactAddressSpace* as,
149  ObjectState* parent) const;
150 
151  void addSignalObject(const HDLPort* port, ObjectState* parent) const;
152 
153  void addModelParamsObject(ObjectState* parent) const;
154 
155  void addFileObject(
156  const TCEString& name,
157  const TCEString& type,
158  ObjectState* parent) const;
159 
160  void extractVLNV(const ObjectState* root);
161 
162  IPXact::Vlnv extractVlnvFromAttr(const ObjectState* busType) const;
163 
164  void extractBusInterfaces(const ObjectState* busInterfaces);
165 
166  void extractBusInterface(const ObjectState* busInterface);
167 
168  void extractAddressSpaces(const ObjectState* addressSpaces);
169 
170  void extractAddressSpace(const ObjectState* as);
171 
172  BusMode extractBusMode(const ObjectState* busInterface) const;
173 
174  void extractPortMappings(
175  const ObjectState* portMaps,
176  IPXactInterface& interface) const;
177 
178  void extractPortMap(
179  const ObjectState* portMap,
180  IPXactInterface& interface) const;
181 
182 
183  void extractSignals(const ObjectState* signals);
184 
185  void extractModelParams(const ObjectState* modelParameters);
186 
187  void extractModelParam(const ObjectState* modelParameter);
188 
189  void extractFiles(const ObjectState* fileSets);
190 
192  const IPXact::Vlnv& type,
193  const IPXact::Vlnv& absType,
194  const TCEString instanceName,
195  BusMode mode) const;
196 
198 
199  std::vector<HDLPort*> signals_;
200 
201  std::vector<ProGe::Parameter> parameters_;
202 
203  std::vector<IPXactInterface*> busInterfaces_;
204 
205  std::vector<IPXactAddressSpace*> addressSpaces_;
206 
207  std::vector<TCEString> hdlFiles_;
208  std::vector<TCEString> otherFiles_;
209 
210  static const TCEString HDL_SET_ID;
211  static const TCEString VHDL_FILE;
212  static const TCEString OTHER_FILE;
213  static const TCEString RESOLVE_USER;
214  static const TCEString STRING_PARAM;
215  static const TCEString INTEGER_PARAM;
216  static const TCEString LONG_PARAM;
218 
219 };
220 #endif
IPXactModel::addressSpaces_
std::vector< IPXactAddressSpace * > addressSpaces_
Definition: IPXactModel.hh:205
IPXactModel::OSNAME_VECTOR
static const TCEString OSNAME_VECTOR
Definition: IPXactModel.hh:115
IPXactModel::SYSTEM
@ SYSTEM
Definition: IPXactModel.hh:56
Netlist.hh
Vlnv.hh
IPXactModel::SLAVE
@ SLAVE
Definition: IPXactModel.hh:54
IPXactModel::OTHER_FILE
static const TCEString OTHER_FILE
Definition: IPXactModel.hh:212
mode
mode
Definition: tceopgen.cc:45
IPXactModel::extractAddressSpace
void extractAddressSpace(const ObjectState *as)
Definition: IPXactModel.cc:649
IPXactModel::OSNAME_BUS_INTERFACES
static const TCEString OSNAME_BUS_INTERFACES
Definition: IPXactModel.hh:96
IPXact::Vlnv
Definition: Vlnv.hh:41
IPXactModel::extractVlnvFromAttr
IPXact::Vlnv extractVlnvFromAttr(const ObjectState *busType) const
Definition: IPXactModel.cc:541
HDLPort
Definition: PlatformIntegrator/HDLPort.hh:48
IPXactModel::OSNAME_BUS_MASTER
static const TCEString OSNAME_BUS_MASTER
Definition: IPXactModel.hh:100
IPXactModel::OSNAME_ADDRESS_SPACES
static const std::string OSNAME_ADDRESS_SPACES
Definition: IPXactModel.hh:125
Serializable
Definition: Serializable.hh:44
IPXactModel::OSNAME_PORT_LEFT
static const TCEString OSNAME_PORT_LEFT
Definition: IPXactModel.hh:118
IPXactModel::addSignalObject
void addSignalObject(const HDLPort *port, ObjectState *parent) const
Definition: IPXactModel.cc:406
IPXactModel::OSNAME_BUS_SLAVE
static const TCEString OSNAME_BUS_SLAVE
Definition: IPXactModel.hh:102
IPXactModel::OSNAME_LIBRARY
static const TCEString OSNAME_LIBRARY
Definition: IPXactModel.hh:93
IPXactModel::addFileObject
void addFileObject(const TCEString &name, const TCEString &type, ObjectState *parent) const
Definition: IPXactModel.cc:503
IPXactModel::extractBusMode
BusMode extractBusMode(const ObjectState *busInterface) const
Definition: IPXactModel.cc:686
IPXactModel
Definition: IPXactModel.hh:47
IPXactModel::extractVLNV
void extractVLNV(const ObjectState *root)
Definition: IPXactModel.cc:518
IPXactModel::MIRRORED_MASTER
@ MIRRORED_MASTER
Definition: IPXactModel.hh:53
ObjectState
Definition: ObjectState.hh:59
IPXactModel::OSNAME_BUS_PORT_MAP_COMP
static const TCEString OSNAME_BUS_PORT_MAP_COMP
Definition: IPXactModel.hh:110
IPXactModel::OSNAME_FILESET
static const TCEString OSNAME_FILESET
Definition: IPXactModel.hh:121
IPXactModel::~IPXactModel
virtual ~IPXactModel()
Definition: IPXactModel.cc:126
IPXactModel::OSNAME_BUS_INTERFACE
static const TCEString OSNAME_BUS_INTERFACE
Definition: IPXactModel.hh:97
IPXactModel::OSNAME_BUS_MIRRORED_SYSTEM
static const TCEString OSNAME_BUS_MIRRORED_SYSTEM
Definition: IPXactModel.hh:105
IPXactModel::OSNAME_BUS_MONITOR
static const TCEString OSNAME_BUS_MONITOR
Definition: IPXactModel.hh:106
IPXactModel::extractPortMap
void extractPortMap(const ObjectState *portMap, IPXactInterface &interface) const
Definition: IPXactModel.cc:729
IPXactModel::OSNAME_FILE
static const TCEString OSNAME_FILE
Definition: IPXactModel.hh:122
IPXactModel::addBusInterfaceObject
void addBusInterfaceObject(const IPXactInterface *bus, ObjectState *parent) const
Definition: IPXactModel.cc:314
IPXactModel::signals_
std::vector< HDLPort * > signals_
Definition: IPXactModel.hh:199
IPXactModel::HDL_SET_ID
static const TCEString HDL_SET_ID
Definition: IPXactModel.hh:210
IPXactModel::VHDL_FILE
static const TCEString VHDL_FILE
Definition: IPXactModel.hh:211
IPXactModel::RESOLVE_USER
static const TCEString RESOLVE_USER
Definition: IPXactModel.hh:213
IPXactModel::INVALID
@ INVALID
Definition: IPXactModel.hh:51
IPXactModel::OSNAME_BUS_PORT_MAP_NAME
static const TCEString OSNAME_BUS_PORT_MAP_NAME
Definition: IPXactModel.hh:109
IPXactModel::OSNAME_BUS_PORT_MAPS
static const TCEString OSNAME_BUS_PORT_MAPS
Definition: IPXactModel.hh:107
IPXactModel::OSNAME_DISPLAY_NAME
static const TCEString OSNAME_DISPLAY_NAME
Definition: IPXactModel.hh:132
IPXactModel::OSNAME_BUS_MIRRORED_SLAVE
static const TCEString OSNAME_BUS_MIRRORED_SLAVE
Definition: IPXactModel.hh:103
IPXactModel::otherFiles_
std::vector< TCEString > otherFiles_
Definition: IPXactModel.hh:208
IPXactModel::OSNAME_NAME
static const TCEString OSNAME_NAME
Definition: IPXactModel.hh:94
IPXactInterface
Definition: IPXactInterface.hh:41
IPXactModel::BusMode
BusMode
Definition: IPXactModel.hh:50
IPXactModel::parameters_
std::vector< ProGe::Parameter > parameters_
Definition: IPXactModel.hh:201
IPXactModel::setHdlFile
void setHdlFile(const TCEString &file)
Definition: IPXactModel.cc:268
IPXactModel::interfaceByType
IPXactInterface * interfaceByType(const IPXact::Vlnv &type, const IPXact::Vlnv &absType, const TCEString instanceName, BusMode mode) const
Definition: IPXactModel.cc:898
IPXactModel::OSNAME_ADDRESS_SPACE
static const std::string OSNAME_ADDRESS_SPACE
Definition: IPXactModel.hh:126
ProGe::Parameter
Definition: Parameter.hh:62
IPXactModel::OSNAME_MODEL_PARAMS
static const TCEString OSNAME_MODEL_PARAMS
Definition: IPXactModel.hh:130
IPXactModel::OSNAME_BUS_SYSTEM
static const TCEString OSNAME_BUS_SYSTEM
Definition: IPXactModel.hh:104
IPXactModel::OSNAME_PORT_RIGHT
static const TCEString OSNAME_PORT_RIGHT
Definition: IPXactModel.hh:119
IPXactModel::addAddressSpace
void addAddressSpace(IPXactAddressSpace *addrSpace)
Definition: IPXactModel.cc:307
IPXactModel::OSNAME_AS_MAU
static const std::string OSNAME_AS_MAU
Definition: IPXactModel.hh:129
IPXactModel::OSNAME_FILESETS
static const TCEString OSNAME_FILESETS
Definition: IPXactModel.hh:120
IPXactModel::OSNAME_FILE_NAME
static const TCEString OSNAME_FILE_NAME
Definition: IPXactModel.hh:123
IPXactModel::setFile
void setFile(const TCEString &file)
Definition: IPXactModel.cc:274
IPXactModel::OSNAME_VENDOR
static const TCEString OSNAME_VENDOR
Definition: IPXactModel.hh:92
IPXactAddressSpace
Definition: IPXactAddressSpace.hh:38
IPXactModel::OSNAME_BUS_ABS_TYPE
static const TCEString OSNAME_BUS_ABS_TYPE
Definition: IPXactModel.hh:99
HDLPort.hh
IPXactModel::OSNAME_PORTS
static const TCEString OSNAME_PORTS
Definition: IPXactModel.hh:113
IPXactModel::extractPortMappings
void extractPortMappings(const ObjectState *portMaps, IPXactInterface &interface) const
Definition: IPXactModel.cc:712
IPXactModel::addParameter
void addParameter(const ProGe::Parameter &parameter)
Definition: IPXactModel.cc:296
IPXactModel::addModelParamsObject
void addModelParamsObject(ObjectState *parent) const
Definition: IPXactModel.cc:461
IPXactModel::IPXactModel
IPXactModel()
Definition: IPXactModel.cc:110
IPXactModel::LONG_PARAM
static const TCEString LONG_PARAM
Definition: IPXactModel.hh:216
IPXactModel::extractModelParams
void extractModelParams(const ObjectState *modelParameters)
Definition: IPXactModel.cc:930
IPXactModel::OSNAME_AS_RANGE
static const std::string OSNAME_AS_RANGE
Definition: IPXactModel.hh:127
IPXactModel::extractBusInterface
void extractBusInterface(const ObjectState *busInterface)
Definition: IPXactModel.cc:578
IPXactModel::extractBusInterfaces
void extractBusInterfaces(const ObjectState *busInterfaces)
Definition: IPXactModel.cc:562
IPXactModel::MIRRORED_SYSTEM
@ MIRRORED_SYSTEM
Definition: IPXactModel.hh:57
IPXactModel::OSNAME_WIRE
static const TCEString OSNAME_WIRE
Definition: IPXactModel.hh:114
Serializable.hh
IPXactModel::OSNAME_PORT_DIRECTION
static const TCEString OSNAME_PORT_DIRECTION
Definition: IPXactModel.hh:117
IPXactModel::OSNAME_BUS_MIRRORED_MASTER
static const TCEString OSNAME_BUS_MIRRORED_MASTER
Definition: IPXactModel.hh:101
IPXactModel::busInterfaces_
std::vector< IPXactInterface * > busInterfaces_
Definition: IPXactModel.hh:203
IPXactModel::extractAddressSpaces
void extractAddressSpaces(const ObjectState *addressSpaces)
Definition: IPXactModel.cc:633
IPXactModel::setHdlFiles
void setHdlFiles(const std::vector< TCEString > &files)
Definition: IPXactModel.cc:281
IPXactModel::extractSignals
void extractSignals(const ObjectState *signals)
Definition: IPXactModel.cc:773
IPXactModel::OSNAME_AS_WIDTH
static const std::string OSNAME_AS_WIDTH
Definition: IPXactModel.hh:128
IPXactModel::OSNAME_ATTR_FORMAT
static const TCEString OSNAME_ATTR_FORMAT
Definition: IPXactModel.hh:135
TCEString
Definition: TCEString.hh:53
IPXactModel::OSNAME_BUS_TYPE
static const TCEString OSNAME_BUS_TYPE
Definition: IPXactModel.hh:98
IPXactModel::vlnv_
IPXact::Vlnv vlnv_
Definition: IPXactModel.hh:197
IPXactModel::MIRRORED_SLAVE
@ MIRRORED_SLAVE
Definition: IPXactModel.hh:55
IPXactModel::extractModelParam
void extractModelParam(const ObjectState *modelParameter)
Definition: IPXactModel.cc:942
IPXactModel::OSNAME_MODEL
static const TCEString OSNAME_MODEL
Definition: IPXactModel.hh:112
IPXactModel::INTEGER_PARAM
static const TCEString INTEGER_PARAM
Definition: IPXactModel.hh:215
IPXactModel::OSNAME_BUS_PORT_MAP
static const TCEString OSNAME_BUS_PORT_MAP
Definition: IPXactModel.hh:108
IPXactModel::OSNAME_FILE_TYPE
static const TCEString OSNAME_FILE_TYPE
Definition: IPXactModel.hh:124
IPXactModel::MONITOR
@ MONITOR
Definition: IPXactModel.hh:58
IPXactModel::OSNAME_BUS_PORT_MAP_BUS
static const TCEString OSNAME_BUS_PORT_MAP_BUS
Definition: IPXactModel.hh:111
IPXactModel::extractFiles
void extractFiles(const ObjectState *fileSets)
Definition: IPXactModel.cc:851
IPXactModel::OSNAME_ATTR_DATA_TYPE
static const TCEString OSNAME_ATTR_DATA_TYPE
Definition: IPXactModel.hh:134
IPXactModel::loadState
virtual void loadState(const ObjectState *state)
Definition: IPXactModel.cc:145
IPXactModel::addBusInterface
void addBusInterface(IPXactInterface *interface)
Definition: IPXactModel.cc:301
IPXactModel::hdlFiles_
std::vector< TCEString > hdlFiles_
Definition: IPXactModel.hh:207
IPXactModel::addAddressSpaceObject
void addAddressSpaceObject(const IPXactAddressSpace *as, ObjectState *parent) const
Definition: IPXactModel.cc:381
IPXactModel::addSignal
void addSignal(const HDLPort &signal)
Definition: IPXactModel.cc:290
IPXactModel::STRING_PARAM
static const TCEString STRING_PARAM
Definition: IPXactModel.hh:214
IPXactModel::DEV_FAMILY_GENERIC
static const TCEString DEV_FAMILY_GENERIC
Definition: IPXactModel.hh:217
IPXactModel::MASTER
@ MASTER
Definition: IPXactModel.hh:52
IPXactModel::OSNAME_ATTR_ID
static const TCEString OSNAME_ATTR_ID
Definition: IPXactModel.hh:136
Parameter.hh
IPXactModel::OSNAME_VALUE
static const TCEString OSNAME_VALUE
Definition: IPXactModel.hh:133
IPXactModel::OSNAME_PORT
static const TCEString OSNAME_PORT
Definition: IPXactModel.hh:116
IPXactModel::OSNAME_ATTR_RESOLVE
static const TCEString OSNAME_ATTR_RESOLVE
Definition: IPXactModel.hh:137
IPXactModel::OSNAME_MODEL_PARAM
static const TCEString OSNAME_MODEL_PARAM
Definition: IPXactModel.hh:131
IPXactModel::OSNAME_IPXACT_MODEL
static const TCEString OSNAME_IPXACT_MODEL
Definition: IPXactModel.hh:91
IPXactModel::setVLNV
void setVLNV(TCEString vendor, TCEString library, TCEString name, TCEString version)
Definition: IPXactModel.cc:254
IPXactModel::saveState
virtual ObjectState * saveState() const
Definition: IPXactModel.cc:178
IPXactModel::OSNAME_VERSION
static const TCEString OSNAME_VERSION
Definition: IPXactModel.hh:95