OpenASIP  2.0
Public Member Functions | Protected Member Functions | List of all members
Stratix2SramGenerator Class Reference

#include <Stratix2SramGenerator.hh>

Inheritance diagram for Stratix2SramGenerator:
Inheritance graph
Collaboration diagram for Stratix2SramGenerator:
Collaboration graph

Public Member Functions

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

Additional Inherited Members

- Protected Types inherited from MemoryGenerator
typedef std::multimap< TCEString, HDLPort * > PortMap
 
typedef std::pair< ProGe::NetlistBlock *, ProGe::VirtualNetlistBlock * > BlockPair
 

Detailed Description

Definition at line 42 of file Stratix2SramGenerator.hh.

Constructor & Destructor Documentation

◆ Stratix2SramGenerator()

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

Definition at line 48 of file Stratix2SramGenerator.cc.

55  :
56  MemoryGenerator(memMauWidth, widthInMaus, addrWidth, initFile,
57  integrator, warningStream, errorStream) {
58 
59  ProGe::Parameter dataw("sram_dataw", "integer", "32");
60  ProGe::Parameter addrw("sram_addrw", "integer", "18");
61  addParameter(dataw);
62  addParameter(addrw);
63  addPort("STRATIXII_SRAM_DQ",
64  new HDLPort("STRATIXII_SRAM_DQ", "sram_dataw", ProGe::BIT_VECTOR,
65  ProGe::BIDIR, false, 32));
66  addPort("STRATIXII_SRAM_ADDR",
67  new HDLPort("STRATIXII_SRAM_ADDR", "sram_addrw",
68  ProGe::BIT_VECTOR, ProGe::OUT, false, 18));
69  addPort("STRATIXII_SRAM_WE_N",
70  new HDLPort("STRATIXII_SRAM_WE_N", "1", ProGe::BIT_VECTOR,
71  ProGe::OUT, false, 1));
72  addPort("STRATIXII_SRAM_OE_N",
73  new HDLPort("STRATIXII_SRAM_OE_N", "1", ProGe::BIT_VECTOR,
74  ProGe::OUT, false, 1));
75  addPort("STRATIXII_SRAM_CS_N",
76  new HDLPort("STRATIXII_SRAM_CS_N", "1", ProGe::BIT_VECTOR,
77  ProGe::OUT, false, 1));
78  addPort("STRATIXII_SRAM_BE_N0",
79  new HDLPort("STRATIXII_SRAM_BE_N0", "1", ProGe::BIT_VECTOR,
80  ProGe::OUT, false, 1));
81  addPort("STRATIXII_SRAM_BE_N1",
82  new HDLPort("STRATIXII_SRAM_BE_N1", "1", ProGe::BIT_VECTOR,
83  ProGe::OUT, false, 1));
84  addPort("STRATIXII_SRAM_BE_N2",
85  new HDLPort("STRATIXII_SRAM_BE_N2", "1", ProGe::BIT_VECTOR,
86  ProGe::OUT, false, 1));
87  addPort("STRATIXII_SRAM_BE_N3",
88  new HDLPort("STRATIXII_SRAM_BE_N3", "1", ProGe::BIT_VECTOR,
89  ProGe::OUT, false, 1));
90 }

References MemoryGenerator::addParameter(), MemoryGenerator::addPort(), ProGe::BIDIR, ProGe::BIT_VECTOR, and ProGe::OUT.

Here is the call graph for this function:

◆ ~Stratix2SramGenerator()

Stratix2SramGenerator::~Stratix2SramGenerator ( )
virtual

Definition at line 93 of file Stratix2SramGenerator.cc.

93  {
94 }

Member Function Documentation

◆ addMemory()

void Stratix2SramGenerator::addMemory ( const ProGe::NetlistBlock ttaCore,
ProGe::NetlistBlock integratorBlock,
int  memIndex,
int  coreId 
)
virtual

Reimplemented from MemoryGenerator.

Definition at line 98 of file Stratix2SramGenerator.cc.

102  {
103 
104  for (int i = 0; i < parameterCount(); i++) {
105  integratorBlock.setParameter(
106  parameter(i).name(),
107  parameter(i).type(),
108  parameter(i).value());
109  }
110 
111  for (int i = 0; i < portCount(); i++) {
112  const HDLPort* hdlPort = port(i);
113  NetlistPort* memPort = hdlPort->convertToNetlistPort(integratorBlock);
114 
116  const NetlistPort* corePort = ttaCore.port(corePortName);
117  assert(corePort != NULL);
118 
120  integratorBlock, *memPort, *corePort,
121  hdlPort->needsInversion(), coreId);
122  }
123 
124 }

References assert, MemoryGenerator::connectPorts(), HDLPort::convertToNetlistPort(), MemoryGenerator::corePortName(), ProGe::Parameter::name(), HDLPort::needsInversion(), MemoryGenerator::parameter(), MemoryGenerator::parameterCount(), ProGe::NetlistBlock::port(), MemoryGenerator::port(), MemoryGenerator::portCount(), MemoryGenerator::portKeyName(), ProGe::NetlistBlock::setParameter(), ProGe::Parameter::type(), and ProGe::Parameter::value().

Here is the call graph for this function:

◆ generateComponentFile()

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

Implements MemoryGenerator.

Definition at line 135 of file Stratix2SramGenerator.cc.

135  {
136 
137  vector<TCEString> noFileToGenerate;
138  return noFileToGenerate;
139 }

◆ generatesComponentHdlFile()

bool Stratix2SramGenerator::generatesComponentHdlFile ( ) const
virtual

Implements MemoryGenerator.

Definition at line 127 of file Stratix2SramGenerator.cc.

127  {
128 
129  // Sram controller is integrated into the lsu itself
130  // No need to generate separate file
131  return false;
132 }

◆ instanceName()

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

Implements MemoryGenerator.

Definition at line 150 of file Stratix2SramGenerator.cc.

150  {
151 
152  TCEString iname("stratixII_sram_");
153  return iname << memoryIndexString(coreId, memIndex);
154 }

References MemoryGenerator::memoryIndexString().

Here is the call graph for this function:

◆ moduleName()

TCEString Stratix2SramGenerator::moduleName ( ) const
protectedvirtual

Implements MemoryGenerator.

Definition at line 143 of file Stratix2SramGenerator.cc.

143  {
144 
145  return "stratixII_sram_comp";
146 }

The documentation for this class was generated from the following files:
MemoryGenerator::port
const HDLPort * port(int index) const
Definition: MemoryGenerator.cc:249
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
ProGe::Parameter::type
const TCEString & type() const
Definition: Parameter.cc:138
MemoryGenerator::MemoryGenerator
MemoryGenerator(int memMauWidth, int widthInMaus, int addrWidth, TCEString initFile, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream)
Definition: MemoryGenerator.cc:59
ProGe::NetlistBlock::setParameter
void setParameter(const std::string &name, const std::string &type, const std::string &value)
Definition: NetlistBlock.cc:89
ProGe::BIDIR
@ BIDIR
Bidirectional port.
Definition: ProGeTypes.hh:55
MemoryGenerator::memoryIndexString
TCEString memoryIndexString(int coreId, int memIndex) const
Definition: MemoryGenerator.cc:383
HDLPort::convertToNetlistPort
ProGe::NetlistPort * convertToNetlistPort(ProGe::NetlistBlock &block) const
Definition: HDLPort.cc:127
assert
#define assert(condition)
Definition: Application.hh:86
MemoryGenerator::parameter
const ProGe::Parameter & parameter(int index) const
Definition: MemoryGenerator.cc:308
ProGe::Parameter
Definition: Parameter.hh:62
ProGe::Parameter::name
const TCEString & name() const
Definition: Parameter.cc:133
ProGe::Parameter::value
const TCEString & value() const
Definition: Parameter.cc:143
MemoryGenerator::warningStream
std::ostream & warningStream()
Definition: MemoryGenerator.cc:231
ProGe::OUT
@ OUT
Output port.
Definition: ProGeTypes.hh:54
MemoryGenerator::corePortName
TCEString corePortName(const TCEString &portBaseName, int coreId) const
Definition: MemoryGenerator.cc:356
MemoryGenerator::connectPorts
virtual void connectPorts(ProGe::NetlistBlock &netlistBlock, const ProGe::NetlistPort &memPort, const ProGe::NetlistPort &corePort, bool inverted, int coreId)
Definition: MemoryGenerator.cc:392
MemoryGenerator::portCount
int portCount() const
Definition: MemoryGenerator.cc:243
TCEString
Definition: TCEString.hh:53
MemoryGenerator::addParameter
void addParameter(const ProGe::Parameter &add)
Definition: MemoryGenerator.cc:313
ProGe::NetlistPort
Definition: NetlistPort.hh:70
MemoryGenerator::portKeyName
TCEString portKeyName(const HDLPort *port) const
Definition: MemoryGenerator.cc:275
MemoryGenerator::errorStream
std::ostream & errorStream()
Definition: MemoryGenerator.cc:237
MemoryGenerator::parameterCount
int parameterCount() const
Definition: MemoryGenerator.cc:302
ProGe::NetlistBlock::port
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
Definition: NetlistBlock.cc:97
HDLPort::needsInversion
bool needsInversion() const
Definition: HDLPort.cc:122