Go to the documentation of this file.
60 int mauWidth,
int widthInMaus,
int addrWidth,
TCEString initFile,
62 std::ostream& errorStream)
63 : mauWidth_(mauWidth),
64 widthInMaus_(widthInMaus),
65 addrWidth_(addrWidth),
67 integrator_(integrator),
68 warningStream_(warningStream),
69 errorStream_(errorStream),
76 if (i->second != NULL)
84 std::vector<TCEString>& reasons)
const {
91 PortMap::const_iterator iter =
memPorts_.begin();
94 if (ttaCore.
port(corePort) == NULL) {
95 TCEString message =
"Couldn't find port " + corePort +
97 reasons.push_back(message);
107 const std::string fuPort, std::vector<TCEString>& reasons)
const {
108 PortMap::const_iterator iter =
memPorts_.find(fuPort);
111 msg <<
"MemoryGenerator does not have port " << fuPort;
112 reasons.push_back(msg);
121 int memIndex,
int coreId) {
135 if (memPort == NULL) {
136 memPort = virt->
port(hdlPort->
name());
137 if (memPort == NULL) {
139 msg << hdlPort->
name() <<
" not found from netlist block";
140 throw InvalidData(__FILE__, __LINE__,
"MemoryGenerator", msg);
152 corePort = ttaCore.
port(portName);
188 blocks.second = staticConnectionsBlock;
251 if (index >
static_cast<int>(
memPorts_.size())) {
252 TCEString message =
"Index out of range";
253 throw OutOfRange(__FILE__, __LINE__,
"MemoryGenerator", message);
255 PortMap::const_iterator iter =
memPorts_.begin();
256 for (
int i = 0; i < index; i++) {
267 TCEString message =
"Port " + name +
" not found";
268 throw KeyNotFound(__FILE__, __LINE__,
"MemoryGenerator", message);
278 PortMap::const_iterator iter =
memPorts_.begin();
280 if (iter->second ==
port) {
288 throw KeyNotFound(__FILE__, __LINE__,
"MemoryGenerator", message);
297 memPorts_.insert(std::pair<TCEString, HDLPort*>(name,
port));
357 const TCEString& portBaseName,
int coreId)
const {
366 portName <<
"core" << coreId <<
"_";
371 portName << portBaseName;
386 index << coreId <<
"_";
388 return index << memIndex;
401 corePort, InvertedBlock->
inputPort(), 0, 0, 1);
403 InvertedBlock->
outputPort(), memPort, 0, 0, 1);
const PlatformIntegrator * platformIntegrator() const
virtual const Netlist & netlist() const
const HDLPort * port(int index) const
virtual TCEString instanceName(int coreId, int memIndex) const =0
virtual MemoryGenerator::BlockPair createMemoryNetlistBlock(ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId)
virtual TCEString name() const
TCEString initializationFile() const
void addPort(const TCEString &name, HDLPort *port)
const TCEString & type() const
TCEString ttaCoreName() const
MemoryGenerator(int memMauWidth, int widthInMaus, int addrWidth, TCEString initFile, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream)
void setParameter(const std::string &name, const std::string &type, const std::string &value)
void instantiateTemplate(const TCEString &inFile, const TCEString &outFile, const TCEString &entity) const
const TTAMachine::FunctionUnit & lsuArchitecture() const
TCEString templatePath() const
virtual ~MemoryGenerator()
TCEString memoryIndexString(int coreId, int memIndex) const
ProGe::NetlistPort * convertToNetlistPort(ProGe::NetlistBlock &block) const
virtual size_t portCount() const
bool connect(const NetlistPort &port1, const NetlistPort &port2, int port1FirstBit, int port2FirstBit, int width=1)
virtual void addMemory(const ProGe::NetlistBlock &ttaCore, ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId)
#define assert(condition)
std::vector< std::string > lsuPorts_
bool hasStaticValue() const
static const TCEString CLOCK_PORT
const ProGe::Parameter & parameter(int index) const
virtual bool isCompatible(const ProGe::NetlistBlock &ttaCore, int coreId, std::vector< TCEString > &reasons) const
const HDLPort * portByKeyName(TCEString name) const
virtual bool checkFuPort(const std::string fuPort, std::vector< TCEString > &reasons) const
const TCEString & name() const
static const TCEString RESET_PORT
const TCEString & value() const
const NetlistPort & outputPort() const
int memoryMauSize() const
void addLsu(TTAMachine::FunctionUnit &lsuArch, std::vector< std::string > lsuPorts)
std::pair< ProGe::NetlistBlock *, ProGe::VirtualNetlistBlock * > BlockPair
virtual TCEString moduleName() const =0
std::ostream & warningStream()
TTAMachine::FunctionUnit * lsuArch_
static const std::string DIRECTORY_SEPARATOR
DataType dataType() const
TCEString corePortName(const TCEString &portBaseName, int coreId) const
virtual void connectPorts(ProGe::NetlistBlock &netlistBlock, const ProGe::NetlistPort &memPort, const ProGe::NetlistPort &corePort, bool inverted, int coreId)
void addSubBlock(BaseNetlistBlock *subBlock, const std::string &instanceName="")
int memoryWidthInMaus() const
void setEntityString(const TCEString &entityStr)
bool hasLSUArchitecture() const
void addParameter(const ProGe::Parameter &add)
std::ostream & warningStream_
std::ostream & errorStream_
TCEString portKeyName(const HDLPort *port) const
const NetlistPort & inputPort() const
std::ostream & errorStream()
int memoryTotalWidth() const
void instantiateTemplateFile(const std::string &templateFile, const std::string &dstFile)
int memoryAddrWidth() const
const PlatformIntegrator * integrator_
int parameterCount() const
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
static std::string dataDirPath(const std::string &prog)
bool needsInversion() const