OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IPXactFileGenerator Class Reference

#include <IPXactFileGenerator.hh>

Inheritance diagram for IPXactFileGenerator:
Inheritance graph
Collaboration diagram for IPXactFileGenerator:
Collaboration graph

Public Member Functions

 IPXactFileGenerator (TCEString toplevelEntity, const PlatformIntegrator *integrator)
 
virtual ~IPXactFileGenerator ()
 
virtual void writeProjectFiles ()
 
- Public Member Functions inherited from ProjectFileGenerator
 ProjectFileGenerator (TCEString coreEntity, const PlatformIntegrator *integrator)
 
virtual ~ProjectFileGenerator ()
 
void addHdlFile (const TCEString &file)
 
void addHdlFiles (const std::vector< TCEString > &files)
 
void addMemInitFile (const TCEString &memInit)
 
void addSignalMapping (const PlatInt::SignalMapping &mapping)
 

Private Member Functions

void addBusInterfaces (IPXactModel *model)
 
void addAddressSpaces (IPXactModel *model)
 
TCEString outputFileName () const
 

Private Attributes

IPXactSerializeripXactWriter_
 

Additional Inherited Members

- Protected Member Functions inherited from ProjectFileGenerator
const std::vector< TCEString > & hdlFileList () const
 
const std::vector< TCEString > & memInitFileList () const
 
const PlatformIntegratorintegrator () const
 
TCEString coreEntity () const
 
TCEString toplevelEntity () const
 
int signalMappingCount () const
 
const PlatInt::SignalMappingsignalMapping (int index) const
 
TCEString extractFUName (const TCEString &port, const TCEString &delimiter) const
 

Detailed Description

Definition at line 43 of file IPXactFileGenerator.hh.

Constructor & Destructor Documentation

◆ IPXactFileGenerator()

IPXactFileGenerator::IPXactFileGenerator ( TCEString  toplevelEntity,
const PlatformIntegrator integrator 
)

◆ ~IPXactFileGenerator()

IPXactFileGenerator::~IPXactFileGenerator ( )
virtual

Definition at line 65 of file IPXactFileGenerator.cc.

65 {
66
67 delete ipXactWriter_;
68}

References ipXactWriter_.

Member Function Documentation

◆ addAddressSpaces()

void IPXactFileGenerator::addAddressSpaces ( IPXactModel model)
private

Definition at line 124 of file IPXactFileGenerator.cc.

124 {
125
126 IPXactAddressSpace* imemAs =
127 new IPXactAddressSpace(integrator()->imemInfo());
128 model->addAddressSpace(imemAs);
129
130 for (int i = 0; i < integrator()->dmemCount(); i++) {
131 IPXactAddressSpace* dmemAs =
132 new IPXactAddressSpace(integrator()->dmemInfo(i));
133 model->addAddressSpace(dmemAs);
134 }
135}
void addAddressSpace(IPXactAddressSpace *addrSpace)

References IPXactModel::addAddressSpace(), PlatformIntegrator::dmemCount(), and ProjectFileGenerator::integrator().

Referenced by writeProjectFiles().

Here is the call graph for this function:

◆ addBusInterfaces()

void IPXactFileGenerator::addBusInterfaces ( IPXactModel model)
private

Definition at line 102 of file IPXactFileGenerator.cc.

102 {
103
104 std::vector<IPXactInterface*> interfaces;
105 interfaces.push_back(new IPXactClkInterface());
106 interfaces.push_back(new IPXactResetInterface());
107 interfaces.push_back(new IPXactHibiInterface());
108
109
110 const NetlistBlock& toplevel = integrator()->toplevelBlock();
111 for (unsigned int i = 0; i < interfaces.size(); i++) {
112 if (interfaces.at(i)->mapPortsToInterface(toplevel)) {
113 // mapping was successful, add interface
114 model->addBusInterface(interfaces.at(i));
115 } else {
116 delete interfaces.at(i);
117 interfaces.at(i) = NULL;
118 }
119 }
120}
void addBusInterface(IPXactInterface *interface)
const ProGe::NetlistBlock & toplevelBlock() const

References IPXactModel::addBusInterface(), ProjectFileGenerator::integrator(), and PlatformIntegrator::toplevelBlock().

Referenced by writeProjectFiles().

Here is the call graph for this function:

◆ outputFileName()

TCEString IPXactFileGenerator::outputFileName ( ) const
private

Definition at line 139 of file IPXactFileGenerator.cc.

139 {
140
141 return "spirit_comp_def_" + toplevelEntity() + ".xml";
142}

References ProjectFileGenerator::toplevelEntity().

Referenced by writeProjectFiles().

Here is the call graph for this function:

◆ writeProjectFiles()

void IPXactFileGenerator::writeProjectFiles ( )
virtual

Implements ProjectFileGenerator.

Definition at line 72 of file IPXactFileGenerator.cc.

72 {
73
74 IPXactModel* ip = new IPXactModel();
76
77 const ProGe::NetlistBlock& toplevel = integrator()->toplevelBlock();
78 for (size_t i = 0; i < toplevel.portCount(); i++) {
79 HDLPort port(toplevel.port(i));
80 ip->addSignal(port);
81 }
82
83 for (size_t i = 0; i < toplevel.parameterCount(); i++) {
84 ip->addParameter(toplevel.parameter(i));
85 }
86
88
90
92 for (unsigned int i = 0; i < memInitFileList().size(); i++) {
93 ip->setFile(memInitFileList().at(i));
94 }
95
98 delete ip;
99}
const TCEString DEF_LIBRARY
const TCEString DEF_VERSION
const TCEString DEF_VENDOR
void addBusInterfaces(IPXactModel *model)
TCEString outputFileName() const
void addAddressSpaces(IPXactModel *model)
void setVLNV(TCEString vendor, TCEString library, TCEString name, TCEString version)
void addParameter(const ProGe::Parameter &parameter)
void setHdlFiles(const std::vector< TCEString > &files)
void setFile(const TCEString &file)
void addSignal(const HDLPort &signal)
void writeIPXactModel(const IPXactModel &model)
virtual size_t parameterCount() const
virtual const Parameter & parameter(const std::string &name) const
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
virtual size_t portCount() const
const std::vector< TCEString > & hdlFileList() const
const std::vector< TCEString > & memInitFileList() const
void setDestinationFile(const std::string &fileName)

References addAddressSpaces(), addBusInterfaces(), IPXactModel::addParameter(), IPXactModel::addSignal(), DEF_LIBRARY, DEF_VENDOR, DEF_VERSION, ProjectFileGenerator::hdlFileList(), ProjectFileGenerator::integrator(), ipXactWriter_, ProjectFileGenerator::memInitFileList(), outputFileName(), ProGe::NetlistBlock::parameter(), ProGe::BaseNetlistBlock::parameterCount(), ProGe::NetlistBlock::port(), ProGe::NetlistBlock::portCount(), XMLSerializer::setDestinationFile(), IPXactModel::setFile(), IPXactModel::setHdlFiles(), IPXactModel::setVLNV(), PlatformIntegrator::toplevelBlock(), ProjectFileGenerator::toplevelEntity(), and IPXactSerializer::writeIPXactModel().

Here is the call graph for this function:

Member Data Documentation

◆ ipXactWriter_

IPXactSerializer* IPXactFileGenerator::ipXactWriter_
private

Definition at line 61 of file IPXactFileGenerator.hh.

Referenced by writeProjectFiles(), and ~IPXactFileGenerator().


The documentation for this class was generated from the following files: