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

#include <AlteraHibiDpRamGenerator.hh>

Inheritance diagram for AlteraHibiDpRamGenerator:
Inheritance graph
Collaboration diagram for AlteraHibiDpRamGenerator:
Collaboration graph

Public Member Functions

 AlteraHibiDpRamGenerator (int memMauWidth, int widthInMaus, int addrWidth, TCEString initFile, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream)
 
virtual ~AlteraHibiDpRamGenerator ()
 
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 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 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 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 AlteraHibiDpRamGenerator.hh.

Constructor & Destructor Documentation

◆ AlteraHibiDpRamGenerator()

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

Definition at line 52 of file AlteraHibiDpRamGenerator.cc.

59 :
60 AlteraMemGenerator(memMauWidth, widthInMaus, addrWidth, initFile,
61 integrator, warningStream, errorStream) {
62
63 bool noInvert = false;
64 TCEString byteEnableWidth;
65 byteEnableWidth << DATAW_G << "/8";
66 // memory port 1
67 addPort("dmem1_data_in",
68 new HDLPort("q_a", DATAW_G, ProGe::BIT_VECTOR, ProGe::OUT, noInvert,
70 addPort("dmem1_data_out",
72 noInvert, memoryTotalWidth()));
73 addPort("dmem1_addr",
74 new HDLPort("address_a", ADDRW_G, ProGe::BIT_VECTOR, ProGe::IN,
75 noInvert, memoryAddrWidth()));
76 addPort("dmem1_mem_en",
77 new HDLPort("enable_a", "1", ProGe::BIT, ProGe::IN, noInvert, 1));
78 addPort("dmem1_wr_en",
79 new HDLPort("wren_a", "1", ProGe::BIT, ProGe::IN, noInvert, 1));
80 addPort("dmem1_wr_mask",
81 new HDLPort("byteena_a", byteEnableWidth, ProGe::BIT_VECTOR,
82 ProGe::IN, noInvert, memoryWidthInMaus()));
83 addPort("clk",
84 new HDLPort("clock_a", "1", ProGe::BIT, ProGe::IN, noInvert, 1));
85
86 // memory port 2
87 addPort("dmem2_data_in",
88 new HDLPort("q_b", DATAW_G, ProGe::BIT_VECTOR, ProGe::OUT, noInvert,
90 addPort("dmem2_data_out",
92 noInvert, memoryTotalWidth()));
93 addPort("dmem2_addr",
94 new HDLPort("address_b", ADDRW_G, ProGe::BIT_VECTOR, ProGe::IN,
95 noInvert, memoryAddrWidth()));
96 addPort("dmem2_mem_en",
97 new HDLPort("enable_b", "1", ProGe::BIT, ProGe::IN, noInvert, 1));
98 addPort("dmem2_wr_en",
99 new HDLPort("wren_b", "1", ProGe::BIT, ProGe::IN, noInvert, 1));
100 addPort("dmem2_wr_mask",
101 new HDLPort("byteena_b", byteEnableWidth, ProGe::BIT_VECTOR,
102 ProGe::IN, noInvert, memoryWidthInMaus()));
103 addPort("clk",
104 new HDLPort("clock_b", "1", ProGe::BIT, ProGe::IN, noInvert, 1));
105}
static const TCEString ADDRW_G
static const TCEString DATAW_G
int memoryWidthInMaus() const
std::ostream & warningStream()
void addPort(const TCEString &name, HDLPort *port)
int memoryTotalWidth() const
std::ostream & errorStream()
int memoryAddrWidth() const
@ BIT
One bit.
Definition ProGeTypes.hh:47
@ BIT_VECTOR
Several bits.
Definition ProGeTypes.hh:48
@ OUT
Output port.
Definition ProGeTypes.hh:54
@ IN
Input port.
Definition ProGeTypes.hh:53

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:

◆ ~AlteraHibiDpRamGenerator()

AlteraHibiDpRamGenerator::~AlteraHibiDpRamGenerator ( )
virtual

Definition at line 108 of file AlteraHibiDpRamGenerator.cc.

108 {
109}

Member Function Documentation

◆ checkFuPort()

bool AlteraHibiDpRamGenerator::checkFuPort ( const std::string  fuPort,
std::vector< TCEString > &  reasons 
) const
protectedvirtual

Reimplemented from MemoryGenerator.

Definition at line 113 of file AlteraHibiDpRamGenerator.cc.

115 {
116
117 // skip the hibi ports
118 TCEString hibiSignal = "hibi_";
119 if (fuPort.find(hibiSignal) != TCEString::npos) {
120 return true;
121 }
122 return MemoryGenerator::checkFuPort(fuPort, reasons);
123}
virtual bool checkFuPort(const std::string fuPort, std::vector< TCEString > &reasons) const

References MemoryGenerator::checkFuPort().

Here is the call graph for this function:

◆ connectPorts()

void AlteraHibiDpRamGenerator::connectPorts ( ProGe::NetlistBlock netlistBlock,
const ProGe::NetlistPort memPort,
const ProGe::NetlistPort corePort,
bool  inverted,
int  coreId 
)
protectedvirtual

Reimplemented from MemoryGenerator.

Definition at line 127 of file AlteraHibiDpRamGenerator.cc.

132 {
133
134 // address ports need special connection
135 if (memPort.name().find("address_") != TCEString::npos) {
136 netlistBlock.netlist().connect(
137 memPort, corePort, 0, 0, memoryAddrWidth());
138 } else {
140 netlistBlock, memPort, corePort, inverted, coreId);
141 }
142}
virtual void connectPorts(ProGe::NetlistBlock &netlistBlock, const ProGe::NetlistPort &memPort, const ProGe::NetlistPort &corePort, bool inverted, int coreId)
virtual const Netlist & netlist() const
std::string name() const
bool connect(const NetlistPort &port1, const NetlistPort &port2, int port1FirstBit, int port2FirstBit, int width=1)
Definition Netlist.cc:83

References ProGe::Netlist::connect(), MemoryGenerator::connectPorts(), MemoryGenerator::memoryAddrWidth(), ProGe::NetlistPort::name(), and ProGe::NetlistBlock::netlist().

Here is the call graph for this function:

◆ generateComponentFile()

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

Implements MemoryGenerator.

Definition at line 151 of file AlteraHibiDpRamGenerator.cc.

151 {
152
153 return instantiateAlteraTemplate(COMPONENT_FILE, outputPath);
154}
static const TCEString COMPONENT_FILE
std::vector< TCEString > instantiateAlteraTemplate(const TCEString &templateFile, const TCEString &outputPath) const

References COMPONENT_FILE, and AlteraMemGenerator::instantiateAlteraTemplate().

Here is the call graph for this function:

◆ generatesComponentHdlFile()

bool AlteraHibiDpRamGenerator::generatesComponentHdlFile ( ) const
virtual

Implements MemoryGenerator.

Definition at line 145 of file AlteraHibiDpRamGenerator.cc.

145 {
146 return true;
147}

◆ instanceName()

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

Implements MemoryGenerator.

Definition at line 165 of file AlteraHibiDpRamGenerator.cc.

165 {
166
167 TCEString iname("onchip_dp_dmem_");
168 return iname << memoryIndexString(coreId, memIndex);
169}
TCEString memoryIndexString(int coreId, int memIndex) const

References MemoryGenerator::memoryIndexString().

Here is the call graph for this function:

◆ moduleName()

TCEString AlteraHibiDpRamGenerator::moduleName ( ) const
protectedvirtual

Implements MemoryGenerator.

Definition at line 158 of file AlteraHibiDpRamGenerator.cc.

158 {
159
160 return ttaCoreName() + "_altera_onchip_dp_ram_comp";
161}
TCEString ttaCoreName() const

References MemoryGenerator::ttaCoreName().

Here is the call graph for this function:

Member Data Documentation

◆ COMPONENT_FILE

const TCEString AlteraHibiDpRamGenerator::COMPONENT_FILE
staticprivate
Initial value:
=
"altera_onchip_dp_ram_comp.vhd"

Definition at line 81 of file AlteraHibiDpRamGenerator.hh.

Referenced by generateComponentFile().


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