OpenASIP 2.2
Loading...
Searching...
No Matches
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
43class IPXactInterface;
44
46
47class IPXactModel : public Serializable {
48public:
49
60
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
94 static const TCEString OSNAME_NAME;
114 static const TCEString OSNAME_WIRE;
116 static const TCEString OSNAME_PORT;
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;
138
139private:
140
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
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;
216 static const TCEString LONG_PARAM;
218
219};
220#endif
static const TCEString OSNAME_VALUE
static const TCEString OSNAME_BUS_ABS_TYPE
void extractModelParams(const ObjectState *modelParameters)
virtual ~IPXactModel()
static const TCEString RESOLVE_USER
static const TCEString OSNAME_FILE
std::vector< IPXactAddressSpace * > addressSpaces_
static const TCEString OSNAME_VENDOR
static const TCEString OSNAME_PORT_DIRECTION
static const TCEString OSNAME_VERSION
static const TCEString OSNAME_PORT_RIGHT
void extractAddressSpace(const ObjectState *as)
void setVLNV(TCEString vendor, TCEString library, TCEString name, TCEString version)
IPXactInterface * interfaceByType(const IPXact::Vlnv &type, const IPXact::Vlnv &absType, const TCEString instanceName, BusMode mode) const
void addFileObject(const TCEString &name, const TCEString &type, ObjectState *parent) const
static const TCEString OSNAME_MODEL
std::vector< ProGe::Parameter > parameters_
static const TCEString OSNAME_FILE_TYPE
static const TCEString OSNAME_BUS_PORT_MAP_BUS
void addAddressSpace(IPXactAddressSpace *addrSpace)
static const TCEString OSNAME_BUS_PORT_MAP_COMP
static const TCEString OSNAME_BUS_INTERFACES
IPXact::Vlnv vlnv_
std::vector< TCEString > otherFiles_
static const TCEString OSNAME_BUS_PORT_MAP
static const TCEString OSNAME_FILESET
static const TCEString OSNAME_NAME
void extractAddressSpaces(const ObjectState *addressSpaces)
void extractBusInterfaces(const ObjectState *busInterfaces)
BusMode extractBusMode(const ObjectState *busInterface) const
void addSignalObject(const HDLPort *port, ObjectState *parent) const
void extractPortMappings(const ObjectState *portMaps, IPXactInterface &interface) const
void extractVLNV(const ObjectState *root)
static const TCEString OTHER_FILE
static const TCEString OSNAME_PORT
void addParameter(const ProGe::Parameter &parameter)
static const TCEString OSNAME_BUS_SLAVE
static const TCEString OSNAME_FILESETS
static const std::string OSNAME_AS_MAU
static const TCEString OSNAME_ATTR_FORMAT
static const TCEString OSNAME_PORTS
static const TCEString VHDL_FILE
static const TCEString LONG_PARAM
static const TCEString STRING_PARAM
static const TCEString OSNAME_ATTR_ID
static const TCEString OSNAME_BUS_MONITOR
void addAddressSpaceObject(const IPXactAddressSpace *as, ObjectState *parent) const
void extractPortMap(const ObjectState *portMap, IPXactInterface &interface) const
void setHdlFiles(const std::vector< TCEString > &files)
void extractModelParam(const ObjectState *modelParameter)
static const TCEString OSNAME_BUS_PORT_MAPS
virtual ObjectState * saveState() const
void extractFiles(const ObjectState *fileSets)
void extractSignals(const ObjectState *signals)
IPXactModel(const IPXactModel &old)
void addModelParamsObject(ObjectState *parent) const
static const TCEString OSNAME_IPXACT_MODEL
void addBusInterfaceObject(const IPXactInterface *bus, ObjectState *parent) const
static const TCEString OSNAME_LIBRARY
static const TCEString OSNAME_DISPLAY_NAME
static const TCEString OSNAME_BUS_INTERFACE
static const std::string OSNAME_ADDRESS_SPACES
static const TCEString HDL_SET_ID
static const TCEString OSNAME_MODEL_PARAM
static const TCEString OSNAME_PORT_LEFT
static const TCEString OSNAME_BUS_TYPE
virtual void loadState(const ObjectState *state)
static const TCEString OSNAME_BUS_PORT_MAP_NAME
void extractBusInterface(const ObjectState *busInterface)
static const TCEString OSNAME_FILE_NAME
void setFile(const TCEString &file)
static const std::string OSNAME_ADDRESS_SPACE
static const TCEString OSNAME_BUS_MIRRORED_MASTER
static const TCEString OSNAME_VECTOR
static const TCEString OSNAME_MODEL_PARAMS
static const TCEString OSNAME_WIRE
static const TCEString OSNAME_BUS_SYSTEM
static const TCEString OSNAME_ATTR_DATA_TYPE
static const std::string OSNAME_AS_RANGE
std::vector< HDLPort * > signals_
static const TCEString INTEGER_PARAM
void setHdlFile(const TCEString &file)
static const TCEString OSNAME_ATTR_RESOLVE
std::vector< IPXactInterface * > busInterfaces_
static const TCEString OSNAME_BUS_MASTER
static const TCEString OSNAME_BUS_MIRRORED_SLAVE
void addSignal(const HDLPort &signal)
void addBusInterface(IPXactInterface *interface)
static const TCEString OSNAME_BUS_MIRRORED_SYSTEM
std::vector< TCEString > hdlFiles_
static const TCEString DEV_FAMILY_GENERIC
IPXact::Vlnv extractVlnvFromAttr(const ObjectState *busType) const
static const std::string OSNAME_AS_WIDTH
mode
Definition tceopgen.cc:45