OpenASIP  2.0
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 
)

Definition at line 57 of file IPXactFileGenerator.cc.

◆ ~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 }

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 }

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 
87  addBusInterfaces(ip);
88 
89  addAddressSpaces(ip);
90 
91  ip->setHdlFiles(hdlFileList());
92  for (unsigned int i = 0; i < memInitFileList().size(); i++) {
93  ip->setFile(memInitFileList().at(i));
94  }
95 
98  delete ip;
99 }

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:
ProjectFileGenerator::integrator
const PlatformIntegrator * integrator() const
Definition: ProjectFileGenerator.cc:101
IPXactClkInterface
Definition: IPXactClkInterface.hh:37
ProGe::NetlistBlock
Definition: NetlistBlock.hh:61
DEF_VERSION
const TCEString DEF_VERSION
Definition: IPXactFileGenerator.cc:54
ProjectFileGenerator::toplevelEntity
TCEString toplevelEntity() const
Definition: ProjectFileGenerator.hh:66
HDLPort
Definition: PlatformIntegrator/HDLPort.hh:48
ProGe::BaseNetlistBlock::parameterCount
virtual size_t parameterCount() const
Definition: BaseNetlistBlock.cc:231
DEF_LIBRARY
const TCEString DEF_LIBRARY
Definition: IPXactFileGenerator.cc:53
IPXactModel
Definition: IPXactModel.hh:47
ProGe::NetlistBlock::portCount
virtual size_t portCount() const
Definition: BaseNetlistBlock.cc:248
IPXactHibiInterface
Definition: IPXactHibiInterface.hh:38
PlatformIntegrator::dmemCount
int dmemCount() const
Definition: PlatformIntegrator.cc:685
ProjectFileGenerator::ProjectFileGenerator
ProjectFileGenerator(TCEString coreEntity, const PlatformIntegrator *integrator)
Definition: ProjectFileGenerator.cc:40
IPXactFileGenerator::addBusInterfaces
void addBusInterfaces(IPXactModel *model)
Definition: IPXactFileGenerator.cc:102
ProjectFileGenerator::memInitFileList
const std::vector< TCEString > & memInitFileList() const
Definition: ProjectFileGenerator.cc:94
IPXactFileGenerator::addAddressSpaces
void addAddressSpaces(IPXactModel *model)
Definition: IPXactFileGenerator.cc:124
IPXactSerializer::writeIPXactModel
void writeIPXactModel(const IPXactModel &model)
Definition: IPXactSerializer.cc:56
IPXactModel::addAddressSpace
void addAddressSpace(IPXactAddressSpace *addrSpace)
Definition: IPXactModel.cc:307
IPXactModel::setFile
void setFile(const TCEString &file)
Definition: IPXactModel.cc:274
XMLSerializer::setDestinationFile
void setDestinationFile(const std::string &fileName)
Definition: XMLSerializer.cc:142
DEF_VENDOR
const TCEString DEF_VENDOR
Definition: IPXactFileGenerator.cc:52
IPXactAddressSpace
Definition: IPXactAddressSpace.hh:38
IPXactModel::addParameter
void addParameter(const ProGe::Parameter &parameter)
Definition: IPXactModel.cc:296
PlatformIntegrator::toplevelBlock
const ProGe::NetlistBlock & toplevelBlock() const
Definition: PlatformIntegrator.cc:537
IPXactFileGenerator::outputFileName
TCEString outputFileName() const
Definition: IPXactFileGenerator.cc:139
IPXactFileGenerator::ipXactWriter_
IPXactSerializer * ipXactWriter_
Definition: IPXactFileGenerator.hh:61
IPXactSerializer
Definition: IPXactSerializer.hh:40
IPXactModel::setHdlFiles
void setHdlFiles(const std::vector< TCEString > &files)
Definition: IPXactModel.cc:281
ProjectFileGenerator::hdlFileList
const std::vector< TCEString > & hdlFileList() const
Definition: ProjectFileGenerator.cc:87
IPXactResetInterface
Definition: IPXactResetInterface.hh:37
IPXactModel::addBusInterface
void addBusInterface(IPXactInterface *interface)
Definition: IPXactModel.cc:301
IPXactModel::addSignal
void addSignal(const HDLPort &signal)
Definition: IPXactModel.cc:290
ProGe::NetlistBlock::parameter
virtual const Parameter & parameter(const std::string &name) const
Definition: BaseNetlistBlock.cc:198
ProGe::NetlistBlock::port
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
Definition: NetlistBlock.cc:97
IPXactModel::setVLNV
void setVLNV(TCEString vendor, TCEString library, TCEString name, TCEString version)
Definition: IPXactModel.cc:254