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

#include <AlteraOnchipRamGenerator.hh>

Inheritance diagram for AlteraOnchipRamGenerator:
Inheritance graph
Collaboration diagram for AlteraOnchipRamGenerator:
Collaboration graph

Public Member Functions

 AlteraOnchipRamGenerator (int memMauWidth, int widthInMaus, int addrWidth, TCEString initFile, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream)
 
virtual ~AlteraOnchipRamGenerator ()
 
virtual bool generatesComponentHdlFile () const
 
virtual std::vector< TCEStringgenerateComponentFile (TCEString outputPath)
 
- Public Member Functions inherited from AlteraMemGenerator
 AlteraMemGenerator (int memMauWidth, int widthInMaus, int addrWidth, TCEString initFile, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream)
 
virtual ~AlteraMemGenerator ()
 
virtual void addMemory (const ProGe::NetlistBlock &ttaCore, ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId)
 
- Public Member Functions inherited from MemoryGenerator
 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
 
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 Member Functions

virtual TCEString moduleName () const
 
virtual TCEString instanceName (int coreId, int memIndex) const
 
- Protected Member Functions inherited from AlteraMemGenerator
std::vector< TCEStringinstantiateAlteraTemplate (const TCEString &templateFile, const TCEString &outputPath) const
 
virtual void addGenerics (ProGe::NetlistBlock &topBlock, const TCEString &addrWidth, const TCEString &dataWidth, int memIndex)
 
- Protected Member Functions inherited from MemoryGenerator
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 PlatformIntegratorplatformIntegrator () const
 
std::ostream & warningStream ()
 
std::ostream & errorStream ()
 
int portCount () const
 
const HDLPortport (int index) const
 
const HDLPortportByKeyName (TCEString name) const
 
TCEString portKeyName (const HDLPort *port) const
 
void addPort (const TCEString &name, HDLPort *port)
 
int parameterCount () const
 
const ProGe::Parameterparameter (int index) const
 
void addParameter (const ProGe::Parameter &add)
 
TCEString ttaCoreName () const
 
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::FunctionUnitlsuArchitecture () const
 
TCEString corePortName (const TCEString &portBaseName, int coreId) const
 

Static Private Attributes

static const TCEString COMPONENT_FILE
 

Additional Inherited Members

- Protected Types inherited from MemoryGenerator
typedef std::multimap< TCEString, HDLPort * > PortMap
 
typedef std::pair< ProGe::NetlistBlock *, ProGe::VirtualNetlistBlock * > BlockPair
 
- Static Protected Attributes inherited from AlteraMemGenerator
static const TCEString INIT_FILE_G = "init_file_g"
 
static const TCEString DEV_FAMILY_G = "dev_family_g"
 
static const TCEString ADDRW_G = "addrw_g"
 
static const TCEString DATAW_G = "dataw_g"
 

Detailed Description

Definition at line 43 of file AlteraOnchipRamGenerator.hh.

Constructor & Destructor Documentation

◆ AlteraOnchipRamGenerator()

AlteraOnchipRamGenerator::AlteraOnchipRamGenerator ( int  memMauWidth,
int  widthInMaus,
int  addrWidth,
TCEString  initFile,
const PlatformIntegrator integrator,
std::ostream &  warningStream,
std::ostream &  errorStream 
)

Definition at line 43 of file AlteraOnchipRamGenerator.cc.

50  :
51  AlteraMemGenerator(memMauWidth, widthInMaus, addrWidth, initFile,
52  integrator, warningStream, errorStream) {
53 
54  bool inverted = true;
55  bool noInvert = false;
56  TCEString byteEnableWidth;
57  byteEnableWidth << DATAW_G << "/8";
58  addPort("dmem_data_in",
59  new HDLPort("q", DATAW_G,
60  ProGe::BIT_VECTOR, ProGe::OUT, noInvert,
61  memoryTotalWidth()));
62  addPort("dmem_data_out",
63  new HDLPort("data", DATAW_G,
64  ProGe::BIT_VECTOR, ProGe::IN, noInvert,
65  memoryTotalWidth()));
66  addPort("dmem_addr",
67  new HDLPort("address", ADDRW_G,
68  ProGe::BIT_VECTOR, ProGe::IN, noInvert,
69  memoryAddrWidth()));
70  addPort("dmem_mem_en_x",
71  new HDLPort("clken", "1", ProGe::BIT, ProGe::IN, inverted, 1));
72  addPort("dmem_wr_en_x",
73  new HDLPort("wren", "1", ProGe::BIT, ProGe::IN, inverted, 1));
74  addPort("dmem_bytemask",
75  new HDLPort("byteena", byteEnableWidth, ProGe::BIT_VECTOR,
76  ProGe::IN, noInvert, memoryWidthInMaus()));
77  addPort("clk",
78  new HDLPort("clock", "1", ProGe::BIT, ProGe::IN, noInvert, 1));
79 }

References MemoryGenerator::addPort(), AlteraMemGenerator::ADDRW_G, ProGe::BIT, ProGe::BIT_VECTOR, AlteraMemGenerator::DATAW_G, ProGe::IN, MemoryGenerator::memoryAddrWidth(), MemoryGenerator::memoryTotalWidth(), MemoryGenerator::memoryWidthInMaus(), and ProGe::OUT.

Here is the call graph for this function:

◆ ~AlteraOnchipRamGenerator()

AlteraOnchipRamGenerator::~AlteraOnchipRamGenerator ( )
virtual

Definition at line 81 of file AlteraOnchipRamGenerator.cc.

81  {
82 }

Member Function Documentation

◆ generateComponentFile()

std::vector< TCEString > AlteraOnchipRamGenerator::generateComponentFile ( TCEString  outputPath)
virtual

Implements MemoryGenerator.

Definition at line 91 of file AlteraOnchipRamGenerator.cc.

91  {
92 
93  return instantiateAlteraTemplate(COMPONENT_FILE, outputPath);
94 }

References COMPONENT_FILE, and AlteraMemGenerator::instantiateAlteraTemplate().

Here is the call graph for this function:

◆ generatesComponentHdlFile()

bool AlteraOnchipRamGenerator::generatesComponentHdlFile ( ) const
virtual

Implements MemoryGenerator.

Definition at line 85 of file AlteraOnchipRamGenerator.cc.

85  {
86  return true;
87 }

◆ instanceName()

TCEString AlteraOnchipRamGenerator::instanceName ( int  coreId,
int  memIndex 
) const
protectedvirtual

Implements MemoryGenerator.

Definition at line 105 of file AlteraOnchipRamGenerator.cc.

105  {
106 
107  TCEString iname("onchip_dmem_");
108  return iname << memoryIndexString(coreId, memIndex);
109 }

References MemoryGenerator::memoryIndexString().

Here is the call graph for this function:

◆ moduleName()

TCEString AlteraOnchipRamGenerator::moduleName ( ) const
protectedvirtual

Implements MemoryGenerator.

Definition at line 98 of file AlteraOnchipRamGenerator.cc.

98  {
99 
100  return ttaCoreName() + "_altera_onchip_ram_comp";
101 }

References MemoryGenerator::ttaCoreName().

Here is the call graph for this function:

Member Data Documentation

◆ COMPONENT_FILE

const TCEString AlteraOnchipRamGenerator::COMPONENT_FILE
staticprivate
Initial value:
=
"altera_onchip_ram_comp.vhd"

Definition at line 70 of file AlteraOnchipRamGenerator.hh.

Referenced by generateComponentFile().


The documentation for this class was generated from the following files:
AlteraMemGenerator::ADDRW_G
static const TCEString ADDRW_G
Definition: AlteraMemGenerator.hh:77
AlteraMemGenerator::DATAW_G
static const TCEString DATAW_G
Definition: AlteraMemGenerator.hh:78
MemoryGenerator::addPort
void addPort(const TCEString &name, HDLPort *port)
Definition: MemoryGenerator.cc:294
HDLPort
Definition: PlatformIntegrator/HDLPort.hh:48
ProGe::BIT_VECTOR
@ BIT_VECTOR
Several bits.
Definition: ProGeTypes.hh:48
MemoryGenerator::ttaCoreName
TCEString ttaCoreName() const
Definition: MemoryGenerator.cc:319
MemoryGenerator::memoryIndexString
TCEString memoryIndexString(int coreId, int memIndex) const
Definition: MemoryGenerator.cc:383
ProGe::BIT
@ BIT
One bit.
Definition: ProGeTypes.hh:47
MemoryGenerator::warningStream
std::ostream & warningStream()
Definition: MemoryGenerator.cc:231
AlteraMemGenerator::AlteraMemGenerator
AlteraMemGenerator(int memMauWidth, int widthInMaus, int addrWidth, TCEString initFile, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream)
Definition: AlteraMemGenerator.cc:45
ProGe::OUT
@ OUT
Output port.
Definition: ProGeTypes.hh:54
AlteraOnchipRamGenerator::COMPONENT_FILE
static const TCEString COMPONENT_FILE
Definition: AlteraOnchipRamGenerator.hh:70
AlteraMemGenerator::instantiateAlteraTemplate
std::vector< TCEString > instantiateAlteraTemplate(const TCEString &templateFile, const TCEString &outputPath) const
Definition: AlteraMemGenerator.cc:62
MemoryGenerator::memoryWidthInMaus
int memoryWidthInMaus() const
Definition: MemoryGenerator.cc:205
TCEString
Definition: TCEString.hh:53
MemoryGenerator::errorStream
std::ostream & errorStream()
Definition: MemoryGenerator.cc:237
MemoryGenerator::memoryTotalWidth
int memoryTotalWidth() const
Definition: MemoryGenerator.cc:193
MemoryGenerator::memoryAddrWidth
int memoryAddrWidth() const
Definition: MemoryGenerator.cc:212
ProGe::IN
@ IN
Input port.
Definition: ProGeTypes.hh:53