OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
AlteraIntegrator Class Reference

#include <AlteraIntegrator.hh>

Inheritance diagram for AlteraIntegrator:
Inheritance graph
Collaboration diagram for AlteraIntegrator:
Collaboration graph

Public Member Functions

 AlteraIntegrator ()
 
 AlteraIntegrator (const TTAMachine::Machine *machine, const IDF::MachineImplementation *idf, ProGe::HDL hdl, TCEString progeOutputDir, TCEString entityName, TCEString outputDir, TCEString programName, int targetClockFreq, std::ostream &warningStream, std::ostream &errorStream, const MemInfo &imem, MemType dmemType)
 
virtual ~AlteraIntegrator ()
 
virtual void integrateProcessor (const ProGe::NetlistBlock *progeBlock)
 
- Public Member Functions inherited from PlatformIntegrator
 PlatformIntegrator ()
 
 PlatformIntegrator (const TTAMachine::Machine *machine, const IDF::MachineImplementation *idf, ProGe::HDL hdl, TCEString progeOutputDir, TCEString coreEntityName, TCEString outputDir, TCEString programName, int targetClockFreq, std::ostream &warningStream, std::ostream &errorStream, const MemInfo &imem, MemType dmemType)
 
virtual ~PlatformIntegrator ()
 
virtual TCEString deviceFamily () const =0
 
virtual void setDeviceFamily (TCEString devFamily)=0
 
void setDeviceName (TCEString devName)
 
TCEString deviceName () const
 
virtual TCEString devicePackage () const =0
 
virtual TCEString deviceSpeedClass () const =0
 
virtual int targetClockFrequency () const
 
virtual void printInfo (std::ostream &stream) const =0
 
const ProGe::NetlistBlockprogeBlock () const
 
const ProGe::NetlistBlocktoplevelBlock () const
 
void setSharedOutputDir (const TCEString &sharedDir)
 
TCEString outputPath () const
 
TCEString outputFilePath (TCEString fileName, bool absolute=false) const
 
TCEString coreEntityName () const
 
const TTAMachine::Machinemachine () const
 
const IDF::MachineImplementationidf () const
 
const MemInfoimemInfo () const
 
const MemInfodmemInfo (TTAMachine::AddressSpace *as) const
 
const MemInfodmemInfo (int index) const
 
int dmemCount () const
 
ProGe::NetlistPortclockPort () const
 
ProGe::NetlistPortresetPort () const
 

Protected Member Functions

virtual MemoryGeneratorimemInstance (MemInfo imem, int coreId)
 
virtual MemoryGeneratordmemInstance (MemInfo dmem, TTAMachine::FunctionUnit &lsuArch, std::vector< std::string > lsuPorts)
 
- Protected Member Functions inherited from PlatformIntegrator
ProGe::NetlistBlockintegratorBlock ()
 
virtual void initPlatformNetlist (const ProGe::NetlistBlock *progeBlock)
 
virtual bool integrateCore (const ProGe::NetlistBlock &cores, int coreId)
 
virtual void exportUnconnectedPorts (int coreId)
 
virtual void connectToplevelPort (const ProGe::NetlistPort &corePort, const TCEString signalPrefix="")
 
virtual TCEString pinTag () const =0
 
virtual bool chopTaggedSignals () const =0
 
virtual bool hasPinTag (const TCEString &signal) const
 
void copyProgeBlockToNetlist (const ProGe::NetlistBlock *progeBlock)
 
virtual bool createMemories (int coreId)
 
virtual bool generateMemory (MemoryGenerator &memGen, std::vector< TCEString > &generatedFiles, int memIndex, int coreId)
 
virtual void writeNewToplevel ()
 
virtual ProjectFileGeneratorprojectFileGenerator () const =0
 
void addProGeFiles () const
 
TCEString programName () const
 
TCEString progeFilePath (TCEString fileName, bool absolute=false) const
 
TCEString chopSignalToTag (const TCEString &original, const TCEString &tag) const
 
void progeOutputHdlFiles (std::vector< TCEString > &files) const
 
std::ostream & warningStream () const
 
std::ostream & errorStream () const
 
TCEString platformEntityName () const
 
void parseDataMemories ()
 
void clearDataMemories ()
 
MemInfo readLsuParameters (const TTAMachine::FunctionUnit &lsu)
 

Private Attributes

MemoryGeneratorimemGen_
 
std::map< TCEString, MemoryGenerator * > dmemGen_
 

Additional Inherited Members

- Static Protected Attributes inherited from PlatformIntegrator
static const TCEString TTA_CORE_CLK = "clk"
 
static const TCEString TTA_CORE_RSTX = "rstx"
 

Detailed Description

Definition at line 39 of file AlteraIntegrator.hh.

Constructor & Destructor Documentation

◆ AlteraIntegrator() [1/2]

AlteraIntegrator::AlteraIntegrator ( )

Definition at line 44 of file AlteraIntegrator.cc.

44  : PlatformIntegrator() {
45 }

◆ AlteraIntegrator() [2/2]

AlteraIntegrator::AlteraIntegrator ( const TTAMachine::Machine machine,
const IDF::MachineImplementation idf,
ProGe::HDL  hdl,
TCEString  progeOutputDir,
TCEString  entityName,
TCEString  outputDir,
TCEString  programName,
int  targetClockFreq,
std::ostream &  warningStream,
std::ostream &  errorStream,
const MemInfo imem,
MemType  dmemType 
)

Definition at line 48 of file AlteraIntegrator.cc.

60  :
61  PlatformIntegrator(machine, idf, hdl, progeOutputDir, coreEntityName,
62  outputDir, programName, targetClockFreq, warningStream,
63  errorStream, imem, dmemType),
64  imemGen_(NULL), dmemGen_() {
65 }

◆ ~AlteraIntegrator()

AlteraIntegrator::~AlteraIntegrator ( )
virtual

Definition at line 68 of file AlteraIntegrator.cc.

68  {
69 
70  if (imemGen_ != NULL) {
71  delete imemGen_;
72  }
73  if (!dmemGen_.empty()) {
74  std::map<TCEString, MemoryGenerator*>::iterator iter =
75  dmemGen_.begin();
76  while (iter != dmemGen_.end()) {
77  delete iter->second;
78  iter++;
79  }
80  }
81 }

References dmemGen_, and imemGen_.

Member Function Documentation

◆ dmemInstance()

MemoryGenerator & AlteraIntegrator::dmemInstance ( MemInfo  dmem,
TTAMachine::FunctionUnit lsuArch,
std::vector< std::string >  lsuPorts 
)
protectedvirtual

Implements PlatformIntegrator.

Reimplemented in Stratix2DSPBoardIntegrator, and KoskiIntegrator.

Definition at line 134 of file AlteraIntegrator.cc.

136  {
137  MemoryGenerator* memGen = NULL;
138  if (dmemGen_.find(dmem.asName) != dmemGen_.end()) {
139  memGen = dmemGen_.find(dmem.asName)->second;
140  } else {
141  if (dmem.type == ONCHIP) {
142  TCEString initFile = programName() + "_" + dmem.asName + ".mif";
143  // onchip mem size is scalable, use value from adf's Address Space
144  int addrw = dmem.portAddrw;
145  memGen =
147  dmem.mauWidth, dmem.widthInMaus, addrw, initFile,
148  this, warningStream(), errorStream());
149  projectFileGenerator()->addMemInitFile(initFile);
150  } else {
151  TCEString msg = "Unsupported data memory type";
152  throw InvalidData(__FILE__, __LINE__, "AlteraIntegrator", msg);
153  }
154  memGen->addLsu(lsuArch, lsuPorts);
155  dmemGen_[dmem.asName] = memGen;
156  }
157  return *memGen;
158 }

References MemoryGenerator::addLsu(), ProjectFileGenerator::addMemInitFile(), MemInfo::asName, dmemGen_, PlatformIntegrator::errorStream(), MemInfo::mauWidth, ONCHIP, MemInfo::portAddrw, PlatformIntegrator::programName(), PlatformIntegrator::projectFileGenerator(), MemInfo::type, PlatformIntegrator::warningStream(), and MemInfo::widthInMaus.

Referenced by Stratix2DSPBoardIntegrator::dmemInstance().

Here is the call graph for this function:

◆ imemInstance()

MemoryGenerator & AlteraIntegrator::imemInstance ( MemInfo  imem,
int  coreId 
)
protectedvirtual

Implements PlatformIntegrator.

Definition at line 104 of file AlteraIntegrator.cc.

104  {
105  assert(imem.type != UNKNOWN && "Imem type not set!");
106 
107  TCEString initFile;
108  if (imem.type == ONCHIP) {
109  initFile = programName() + ".mif";
111  } else if (imem.type == VHDL_ARRAY) {
112  initFile = programName() + "_imem_pkg.vhdl";
113  }
114 
115  if (imemGen_ == NULL) {
116  if (imem.type == ONCHIP) {
117  imemGen_ =
119  imem.mauWidth, imem.widthInMaus, imem.portAddrw, initFile,
120  this, warningStream(), errorStream());
121  } else if (imem.type == VHDL_ARRAY) {
123  imem.mauWidth, imem.widthInMaus, imem.portAddrw, initFile,
124  this, warningStream(), errorStream());
125  } else {
126  TCEString msg = "Unsupported instruction memory type";
127  throw InvalidData(__FILE__, __LINE__, "AlteraIntegrator", msg);
128  }
129  }
130  return *imemGen_;
131 }

References ProjectFileGenerator::addMemInitFile(), assert, PlatformIntegrator::errorStream(), imemGen_, MemInfo::mauWidth, ONCHIP, MemInfo::portAddrw, PlatformIntegrator::programName(), PlatformIntegrator::projectFileGenerator(), MemInfo::type, UNKNOWN, VHDL_ARRAY, PlatformIntegrator::warningStream(), and MemInfo::widthInMaus.

Here is the call graph for this function:

◆ integrateProcessor()

void AlteraIntegrator::integrateProcessor ( const ProGe::NetlistBlock progeBlock)
virtual

Integrates the TTA core(s) generated by ProGe

Parameters
progeBlockThe toplevel netlist block created by ProGe

Implements PlatformIntegrator.

Reimplemented in Stratix2DSPBoardIntegrator, and Stratix3DevKitIntegrator.

Definition at line 85 of file AlteraIntegrator.cc.

86  {
87 
88  initPlatformNetlist(progeBlockInOldNetlist);
89 
90  const NetlistBlock& core = progeBlock();
91  int coreId = -1;
92  if (!integrateCore(core, coreId)) {
93  return;
94  }
95 
97 
98  addProGeFiles();
99 
101 }

References PlatformIntegrator::addProGeFiles(), PlatformIntegrator::initPlatformNetlist(), PlatformIntegrator::integrateCore(), PlatformIntegrator::progeBlock(), PlatformIntegrator::projectFileGenerator(), PlatformIntegrator::writeNewToplevel(), and ProjectFileGenerator::writeProjectFiles().

Here is the call graph for this function:

Member Data Documentation

◆ dmemGen_

std::map<TCEString, MemoryGenerator*> AlteraIntegrator::dmemGen_
private

Definition at line 74 of file AlteraIntegrator.hh.

Referenced by dmemInstance(), and ~AlteraIntegrator().

◆ imemGen_

MemoryGenerator* AlteraIntegrator::imemGen_
private

Definition at line 73 of file AlteraIntegrator.hh.

Referenced by imemInstance(), and ~AlteraIntegrator().


The documentation for this class was generated from the following files:
PlatformIntegrator::initPlatformNetlist
virtual void initPlatformNetlist(const ProGe::NetlistBlock *progeBlock)
Definition: PlatformIntegrator.cc:317
PlatformIntegrator::coreEntityName
TCEString coreEntityName() const
Definition: PlatformIntegrator.cc:126
AlteraIntegrator::imemGen_
MemoryGenerator * imemGen_
Definition: AlteraIntegrator.hh:73
ProGe::NetlistBlock
Definition: NetlistBlock.hh:61
PlatformIntegrator::writeNewToplevel
virtual void writeNewToplevel()
Definition: PlatformIntegrator.cc:609
ProjectFileGenerator::writeProjectFiles
virtual void writeProjectFiles()=0
AlteraIntegrator::dmemGen_
std::map< TCEString, MemoryGenerator * > dmemGen_
Definition: AlteraIntegrator.hh:74
PlatformIntegrator::projectFileGenerator
virtual ProjectFileGenerator * projectFileGenerator() const =0
assert
#define assert(condition)
Definition: Application.hh:86
AlteraOnchipRomGenerator
Definition: AlteraOnchipRomGenerator.hh:43
MemInfo::type
MemType type
Definition: MemoryGenerator.hh:68
InvalidData
Definition: Exception.hh:149
MemInfo::asName
TCEString asName
Definition: MemoryGenerator.hh:74
PlatformIntegrator::progeBlock
const ProGe::NetlistBlock & progeBlock() const
Definition: PlatformIntegrator.cc:530
PlatformIntegrator::PlatformIntegrator
PlatformIntegrator()
Definition: PlatformIntegrator.cc:68
PlatformIntegrator::idf
const IDF::MachineImplementation * idf() const
Definition: PlatformIntegrator.cc:304
PlatformIntegrator::machine
const TTAMachine::Machine * machine() const
Definition: PlatformIntegrator.cc:297
MemoryGenerator::addLsu
void addLsu(TTAMachine::FunctionUnit &lsuArch, std::vector< std::string > lsuPorts)
Definition: MemoryGenerator.cc:376
MemInfo::widthInMaus
int widthInMaus
Definition: MemoryGenerator.hh:70
VhdlRomGenerator
Definition: VhdlRomGenerator.hh:42
MemInfo::mauWidth
int mauWidth
Definition: MemoryGenerator.hh:69
PlatformIntegrator::programName
TCEString programName() const
Definition: PlatformIntegrator.cc:133
ONCHIP
@ ONCHIP
Definition: MemoryGenerator.hh:61
TCEString
Definition: TCEString.hh:53
PlatformIntegrator::warningStream
std::ostream & warningStream() const
Definition: PlatformIntegrator.cc:271
PlatformIntegrator::integrateCore
virtual bool integrateCore(const ProGe::NetlistBlock &cores, int coreId)
Definition: PlatformIntegrator.cc:434
UNKNOWN
@ UNKNOWN
Definition: MemoryGenerator.hh:58
VHDL_ARRAY
@ VHDL_ARRAY
Definition: MemoryGenerator.hh:60
ProjectFileGenerator::addMemInitFile
void addMemInitFile(const TCEString &memInit)
Definition: ProjectFileGenerator.cc:72
MemInfo::portAddrw
int portAddrw
Definition: MemoryGenerator.hh:71
PlatformIntegrator::errorStream
std::ostream & errorStream() const
Definition: PlatformIntegrator.cc:278
PlatformIntegrator::addProGeFiles
void addProGeFiles() const
Definition: PlatformIntegrator.cc:640
AlteraOnchipRamGenerator
Definition: AlteraOnchipRamGenerator.hh:43
MemoryGenerator
Definition: MemoryGenerator.hh:85