OpenASIP
2.0
|
#include <MemoryGenerator.hh>
Public Member Functions | |
MemoryGenerator (int memMauWidth, int widthInMaus, int addrWidth, TCEString initFile, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream) | |
virtual | ~MemoryGenerator () |
virtual bool | isCompatible (const ProGe::NetlistBlock &ttaCore, int coreId, std::vector< TCEString > &reasons) const |
virtual void | addMemory (const ProGe::NetlistBlock &ttaCore, ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId) |
virtual bool | generatesComponentHdlFile () const =0 |
virtual std::vector< TCEString > | generateComponentFile (TCEString outputPath)=0 |
int | memoryTotalWidth () const |
int | memoryMauSize () const |
int | memoryWidthInMaus () const |
int | memoryAddrWidth () const |
TCEString | initializationFile () const |
void | addLsu (TTAMachine::FunctionUnit &lsuArch, std::vector< std::string > lsuPorts) |
Protected Types | |
typedef std::multimap< TCEString, HDLPort * > | PortMap |
typedef std::pair< ProGe::NetlistBlock *, ProGe::VirtualNetlistBlock * > | BlockPair |
Protected Member Functions | |
virtual bool | checkFuPort (const std::string fuPort, std::vector< TCEString > &reasons) const |
virtual void | connectPorts (ProGe::NetlistBlock &netlistBlock, const ProGe::NetlistPort &memPort, const ProGe::NetlistPort &corePort, bool inverted, int coreId) |
virtual MemoryGenerator::BlockPair | createMemoryNetlistBlock (ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId) |
const PlatformIntegrator * | platformIntegrator () const |
std::ostream & | warningStream () |
std::ostream & | errorStream () |
int | portCount () const |
const HDLPort * | port (int index) const |
const HDLPort * | portByKeyName (TCEString name) const |
TCEString | portKeyName (const HDLPort *port) const |
void | addPort (const TCEString &name, HDLPort *port) |
int | parameterCount () const |
const ProGe::Parameter & | parameter (int index) const |
void | addParameter (const ProGe::Parameter &add) |
TCEString | ttaCoreName () const |
virtual TCEString | moduleName () const =0 |
virtual TCEString | instanceName (int coreId, int memIndex) const =0 |
TCEString | memoryIndexString (int coreId, int memIndex) const |
TCEString | templatePath () const |
void | instantiateTemplate (const TCEString &inFile, const TCEString &outFile, const TCEString &entity) const |
bool | hasLSUArchitecture () const |
const TTAMachine::FunctionUnit & | lsuArchitecture () const |
TCEString | corePortName (const TCEString &portBaseName, int coreId) const |
Private Types | |
typedef std::vector< ProGe::Parameter > | ParameterList |
Private Attributes | |
int | mauWidth_ |
int | widthInMaus_ |
int | addrWidth_ |
TCEString | initFile_ |
const PlatformIntegrator * | integrator_ |
std::ostream & | warningStream_ |
std::ostream & | errorStream_ |
PortMap | memPorts_ |
ParameterList | params_ |
TTAMachine::FunctionUnit * | lsuArch_ |
std::vector< std::string > | lsuPorts_ |
Static Private Attributes | |
static const TCEString | CLOCK_PORT = "clk" |
static const TCEString | RESET_PORT = "rstx" |
Definition at line 85 of file MemoryGenerator.hh.
|
protected |
Definition at line 148 of file MemoryGenerator.hh.
|
private |
Definition at line 215 of file MemoryGenerator.hh.
|
protected |
Definition at line 145 of file MemoryGenerator.hh.
MemoryGenerator::MemoryGenerator | ( | int | memMauWidth, |
int | widthInMaus, | ||
int | addrWidth, | ||
TCEString | initFile, | ||
const PlatformIntegrator * | integrator, | ||
std::ostream & | warningStream, | ||
std::ostream & | errorStream | ||
) |
Definition at line 59 of file MemoryGenerator.cc.
|
virtual |
void MemoryGenerator::addLsu | ( | TTAMachine::FunctionUnit & | lsuArch, |
std::vector< std::string > | lsuPorts | ||
) |
For data memories
Definition at line 376 of file MemoryGenerator.cc.
References lsuArch_, and lsuPorts_.
Referenced by AlteraIntegrator::dmemInstance(), KoskiIntegrator::dmemInstance(), AlmaIFIntegrator::dmemInstance(), and Stratix2DSPBoardIntegrator::dmemInstance().
|
virtual |
Reimplemented in AlteraOnchipRomGenerator, XilinxBlockRamGenerator, AlteraMemGenerator, Stratix2SramGenerator, and DummyMemGenerator.
Definition at line 119 of file MemoryGenerator.cc.
References ProGe::NetlistBlock::addSubBlock(), assert, PlatformIntegrator::clockPort(), connectPorts(), corePortName(), createMemoryNetlistBlock(), HDLPort::name(), HDLPort::needsInversion(), platformIntegrator(), ProGe::NetlistBlock::port(), port(), ProGe::NetlistBlock::portCount(), portCount(), portKeyName(), and PlatformIntegrator::resetPort().
Referenced by AlteraMemGenerator::addMemory(), AlteraOnchipRomGenerator::addMemory(), and PlatformIntegrator::generateMemory().
|
protected |
Definition at line 313 of file MemoryGenerator.cc.
References ProGe::Parameter::name(), params_, ProGe::Parameter::type(), and ProGe::Parameter::value().
Referenced by AlteraMemGenerator::addGenerics(), Stratix2SramGenerator::Stratix2SramGenerator(), VhdlRomGenerator::VhdlRomGenerator(), and XilinxBlockRamGenerator::XilinxBlockRamGenerator().
Definition at line 294 of file MemoryGenerator.cc.
References assert, memPorts_, and port().
Referenced by XilinxBlockRamGenerator::addPorts(), AlteraHibiDpRamGenerator::AlteraHibiDpRamGenerator(), AlteraOnchipRamGenerator::AlteraOnchipRamGenerator(), AlteraOnchipRomGenerator::AlteraOnchipRomGenerator(), Stratix2SramGenerator::Stratix2SramGenerator(), VhdlRomGenerator::VhdlRomGenerator(), and XilinxBlockRamGenerator::XilinxBlockRamGenerator().
|
protectedvirtual |
Reimplemented in DummyMemGenerator, and AlteraHibiDpRamGenerator.
Definition at line 106 of file MemoryGenerator.cc.
References memPorts_.
Referenced by AlteraHibiDpRamGenerator::checkFuPort(), and isCompatible().
|
protectedvirtual |
Reimplemented in AlteraHibiDpRamGenerator.
Definition at line 392 of file MemoryGenerator.cc.
References ProGe::NetlistBlock::addSubBlock(), ProGe::Netlist::connect(), ProGe::NetlistPort::dataType(), ProGe::InverterBlock::inputPort(), ProGe::NetlistBlock::netlist(), and ProGe::InverterBlock::outputPort().
Referenced by Stratix2SramGenerator::addMemory(), XilinxBlockRamGenerator::addMemory(), addMemory(), and AlteraHibiDpRamGenerator::connectPorts().
|
protected |
Definition at line 356 of file MemoryGenerator.cc.
References PlatformIntegrator::clockPort(), integrator_, lsuArch_, lsuArchitecture(), TTAMachine::Component::name(), ProGe::NetlistPort::name(), and PlatformIntegrator::resetPort().
Referenced by Stratix2SramGenerator::addMemory(), XilinxBlockRamGenerator::addMemory(), addMemory(), and isCompatible().
|
protectedvirtual |
Definition at line 163 of file MemoryGenerator.cc.
References ProGe::NetlistBlock::addSubBlock(), assert, HDLPort::convertToNetlistPort(), HDLPort::hasStaticValue(), instanceName(), moduleName(), parameter(), parameterCount(), port(), portCount(), and ProGe::NetlistBlock::setParameter().
Referenced by XilinxBlockRamGenerator::addMemory(), and addMemory().
|
protected |
Definition at line 237 of file MemoryGenerator.cc.
References errorStream_.
|
pure virtual |
Implemented in DummyMemGenerator, Stratix2SramGenerator, AlteraHibiDpRamGenerator, AlteraOnchipRamGenerator, AlteraOnchipRomGenerator, VhdlRomGenerator, and XilinxBlockRamGenerator.
Referenced by PlatformIntegrator::generateMemory().
|
pure virtual |
Implemented in Stratix2SramGenerator, AlteraHibiDpRamGenerator, AlteraOnchipRamGenerator, AlteraOnchipRomGenerator, DummyMemGenerator, VhdlRomGenerator, and XilinxBlockRamGenerator.
Referenced by PlatformIntegrator::generateMemory().
|
protected |
Definition at line 344 of file MemoryGenerator.cc.
References lsuArch_.
TCEString MemoryGenerator::initializationFile | ( | ) | const |
Definition at line 219 of file MemoryGenerator.cc.
References initFile_.
Referenced by AlteraMemGenerator::addGenerics(), and VhdlRomGenerator::generateComponentFile().
|
protectedpure virtual |
Implemented in DummyMemGenerator, XilinxBlockRamGenerator, AlteraHibiDpRamGenerator, AlteraOnchipRomGenerator, Stratix2SramGenerator, AlteraOnchipRamGenerator, and VhdlRomGenerator.
Referenced by AlteraMemGenerator::addGenerics(), and createMemoryNetlistBlock().
|
protected |
Definition at line 333 of file MemoryGenerator.cc.
References HDLTemplateInstantiator::instantiateTemplateFile(), and HDLTemplateInstantiator::setEntityString().
Referenced by AlteraMemGenerator::instantiateAlteraTemplate().
|
virtual |
Tests that the memory generator is compatible with TTA core. If incompatible, reasons are appended to the reasons vector
ttaCore | TTA toplevel |
coreId | The core ID number |
reasons | Reasons why incompatible |
Reimplemented in XilinxBlockRamGenerator.
Definition at line 82 of file MemoryGenerator.cc.
References checkFuPort(), corePortName(), lsuPorts_, memPorts_, ProGe::NetlistBlock::port(), and port().
Referenced by PlatformIntegrator::generateMemory(), and XilinxBlockRamGenerator::isCompatible().
|
protected |
Definition at line 349 of file MemoryGenerator.cc.
References assert, and lsuArch_.
Referenced by corePortName().
int MemoryGenerator::memoryAddrWidth | ( | ) | const |
Definition at line 212 of file MemoryGenerator.cc.
References addrWidth_.
Referenced by AlteraMemGenerator::addMemory(), AlteraHibiDpRamGenerator::AlteraHibiDpRamGenerator(), AlteraOnchipRamGenerator::AlteraOnchipRamGenerator(), AlteraHibiDpRamGenerator::connectPorts(), VhdlRomGenerator::VhdlRomGenerator(), and XilinxBlockRamGenerator::XilinxBlockRamGenerator().
|
protected |
Definition at line 383 of file MemoryGenerator.cc.
Referenced by VhdlRomGenerator::instanceName(), AlteraOnchipRamGenerator::instanceName(), Stratix2SramGenerator::instanceName(), AlteraOnchipRomGenerator::instanceName(), and AlteraHibiDpRamGenerator::instanceName().
int MemoryGenerator::memoryMauSize | ( | ) | const |
Definition at line 199 of file MemoryGenerator.cc.
References mauWidth_.
int MemoryGenerator::memoryTotalWidth | ( | ) | const |
Definition at line 193 of file MemoryGenerator.cc.
References mauWidth_, and widthInMaus_.
Referenced by AlteraMemGenerator::addMemory(), AlteraHibiDpRamGenerator::AlteraHibiDpRamGenerator(), AlteraOnchipRamGenerator::AlteraOnchipRamGenerator(), VhdlRomGenerator::VhdlRomGenerator(), and XilinxBlockRamGenerator::XilinxBlockRamGenerator().
int MemoryGenerator::memoryWidthInMaus | ( | ) | const |
Definition at line 205 of file MemoryGenerator.cc.
References widthInMaus_.
Referenced by AlteraHibiDpRamGenerator::AlteraHibiDpRamGenerator(), and AlteraOnchipRamGenerator::AlteraOnchipRamGenerator().
|
protectedpure virtual |
|
protected |
Definition at line 308 of file MemoryGenerator.cc.
References params_.
Referenced by Stratix2SramGenerator::addMemory(), and createMemoryNetlistBlock().
|
protected |
Definition at line 302 of file MemoryGenerator.cc.
References params_.
Referenced by Stratix2SramGenerator::addMemory(), and createMemoryNetlistBlock().
|
protected |
Definition at line 225 of file MemoryGenerator.cc.
References integrator_.
Referenced by AlteraMemGenerator::addGenerics(), XilinxBlockRamGenerator::addMemory(), addMemory(), XilinxBlockRamGenerator::almaifPortName(), and ttaCoreName().
|
protected |
Definition at line 249 of file MemoryGenerator.cc.
References memPorts_.
Referenced by Stratix2SramGenerator::addMemory(), XilinxBlockRamGenerator::addMemory(), addMemory(), addPort(), createMemoryNetlistBlock(), isCompatible(), and portKeyName().
|
protected |
Definition at line 243 of file MemoryGenerator.cc.
References memPorts_.
Referenced by Stratix2SramGenerator::addMemory(), XilinxBlockRamGenerator::addMemory(), addMemory(), and createMemoryNetlistBlock().
Definition at line 275 of file MemoryGenerator.cc.
References memPorts_, HDLPort::name(), and port().
Referenced by Stratix2SramGenerator::addMemory(), XilinxBlockRamGenerator::addMemory(), and addMemory().
|
protected |
Returns base path to template files.
Definition at line 325 of file MemoryGenerator.cc.
References Environment::dataDirPath(), and FileSystem::DIRECTORY_SEPARATOR.
Referenced by XilinxBlockRamGenerator::generateComponentFile(), and AlteraMemGenerator::instantiateAlteraTemplate().
|
protected |
Definition at line 319 of file MemoryGenerator.cc.
References PlatformIntegrator::coreEntityName(), and platformIntegrator().
Referenced by VhdlRomGenerator::imagePackageName(), AlteraMemGenerator::instantiateAlteraTemplate(), VhdlRomGenerator::moduleName(), AlteraOnchipRamGenerator::moduleName(), AlteraOnchipRomGenerator::moduleName(), and AlteraHibiDpRamGenerator::moduleName().
|
protected |
Definition at line 231 of file MemoryGenerator.cc.
References warningStream_.
|
private |
Definition at line 219 of file MemoryGenerator.hh.
Referenced by memoryAddrWidth().
|
staticprivate |
Definition at line 234 of file MemoryGenerator.hh.
|
private |
Definition at line 226 of file MemoryGenerator.hh.
Referenced by errorStream().
|
private |
Definition at line 221 of file MemoryGenerator.hh.
Referenced by initializationFile().
|
private |
Definition at line 223 of file MemoryGenerator.hh.
Referenced by corePortName(), and platformIntegrator().
|
private |
Definition at line 231 of file MemoryGenerator.hh.
Referenced by addLsu(), corePortName(), hasLSUArchitecture(), and lsuArchitecture().
|
private |
Definition at line 232 of file MemoryGenerator.hh.
Referenced by addLsu(), and isCompatible().
|
private |
Definition at line 217 of file MemoryGenerator.hh.
Referenced by memoryMauSize(), and memoryTotalWidth().
|
private |
Definition at line 228 of file MemoryGenerator.hh.
Referenced by addPort(), checkFuPort(), isCompatible(), port(), portByKeyName(), portCount(), portKeyName(), and ~MemoryGenerator().
|
private |
Definition at line 229 of file MemoryGenerator.hh.
Referenced by addParameter(), parameter(), and parameterCount().
|
staticprivate |
Definition at line 235 of file MemoryGenerator.hh.
|
private |
Definition at line 225 of file MemoryGenerator.hh.
Referenced by warningStream().
|
private |
Definition at line 218 of file MemoryGenerator.hh.
Referenced by memoryTotalWidth(), and memoryWidthInMaus().