Go to the documentation of this file.
48 int memMauWidth,
int widthInMaus,
int addrWidth,
int portBDataWidth,
50 std::ostream& warningStream, std::ostream& errorStream,
52 TCEString signalPrefix,
bool overrideAddrWidth,
bool singleMemoryBlock)
54 memMauWidth, widthInMaus, addrWidth,
"", integrator, warningStream,
56 connectToArbiter_(connectToArbiter),
57 almaifBlock_(almaifBlock),
58 signalPrefix_(signalPrefix),
59 overrideAddrWidth_(overrideAddrWidth),
60 singleMemoryBlock_(singleMemoryBlock) {
61 assert (!connectToArbiter || almaifBlock !=
nullptr);
74 if (overrideAddrWidth) {
76 second_addrw.
setValue(
"local_mem_addrw_g");
89 if (connectToArbiter) {
91 addPorts(
"b_", portBAddrWidth, portBDataWidth);
108 std::string datawGeneric =
"dataw_g";
109 std::string addrwGeneric =
"addrw_g";
111 datawGeneric =
"dataw_b_g";
112 addrwGeneric =
"addrw_b_g";
118 const bool noInvert =
false;
120 new HDLPort(pfx +
"avalid_in",
"1",
BIT,
IN, noInvert, 1));
122 new HDLPort(pfx +
"aready_out",
"1",
BIT,
OUT, noInvert, 1));
125 new HDLPort(pfx +
"aaddr_in", addrwGeneric, VEC,
IN, noInvert,
129 new HDLPort(pfx +
"aaddr_in", addrwGeneric, VEC,
IN, noInvert));
132 new HDLPort(pfx +
"awren_in",
"1",
BIT,
IN, noInvert, 1));
134 new HDLPort(pfx +
"astrb_in",
"(" + datawGeneric +
"+7)/8", VEC,
IN,
135 noInvert, (dataWidth+7)/8));
137 new HDLPort(pfx +
"adata_in", datawGeneric, VEC,
IN, noInvert,
142 new HDLPort(pfx +
"rready_in",
"1",
BIT,
IN, noInvert, 1));
144 new HDLPort(pfx +
"rdata_out", datawGeneric, VEC,
OUT, noInvert,
152 int memIndex,
int coreId) {
172 if (memPort == NULL) {
173 memPort = virt->
port(hdlPort->
name());
174 if (memPort == NULL) {
176 msg << hdlPort->
name() <<
" not found from netlist block";
177 throw InvalidData(__FILE__, __LINE__,
"MemoryGenerator", msg);
194 corePort = ttaCore.
port(portName);
197 if (corePort == NULL) {
199 msg << portName <<
" not found from";
205 msg <<
"netlist block";
206 throw InvalidData(__FILE__, __LINE__,
"MemoryGenerator", msg);
220 integratorBlock, *corePort, *memPort,
226 std::vector<TCEString>
236 std::vector<TCEString> files;
237 files.push_back(outputFile);
257 iname <<
"core" << coreId <<
"_";
275 int coreId, std::vector<TCEString>& reasons)
const {
const PlatformIntegrator * platformIntegrator() const
virtual const Netlist & netlist() const
const HDLPort * port(int index) const
virtual TCEString moduleName() const
virtual MemoryGenerator::BlockPair createMemoryNetlistBlock(ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId)
void setValue(const TCEString &value)
void addPort(const TCEString &name, HDLPort *port)
@ BIT_VECTOR
Several bits.
virtual TCEString instanceName(int coreId, int) const
virtual void addMemory(const ProGe::NetlistBlock &ttaCore, ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId)
const bool connectToArbiter_
TCEString almaifPortName(const TCEString &portBaseName)
virtual bool generatesComponentHdlFile() const
TCEString templatePath() const
XilinxBlockRamGenerator(int memMauWidth, int widthInMaus, int addrWidth, int portBDataWidth, int portBAddrWidth, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream, bool connectToArbiter=false, ProGe::NetlistBlock *almaifBlocks=nullptr, TCEString signalPrefix="", bool overrideAddrWidth=false, bool singleMemoryBlock=false)
static std::string toString(const T &source)
virtual size_t portCount() const
bool connect(const NetlistPort &port1, const NetlistPort &port2, int port1FirstBit, int port2FirstBit, int width=1)
#define assert(condition)
ProGe::NetlistBlock * almaifBlock_
void addPorts(std::string prefix, int addrWidth, int dataWidth)
static const TCEString SP_FILE
virtual bool isCompatible(const ProGe::NetlistBlock &ttaCore, int coreId, std::vector< TCEString > &reasons) const
static void copy(const std::string &source, const std::string &target)
virtual bool isCompatible(const ProGe::NetlistBlock &ttaCore, int coreId, std::vector< TCEString > &reasons) const
virtual std::vector< TCEString > generateComponentFile(TCEString outputPath)
const bool singleMemoryBlock_
std::pair< ProGe::NetlistBlock *, ProGe::VirtualNetlistBlock * > BlockPair
static const std::string DIRECTORY_SEPARATOR
const bool overrideAddrWidth_
static const TCEString DP_FILE
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)
virtual ~XilinxBlockRamGenerator()
void addSubBlock(BaseNetlistBlock *subBlock, const std::string &instanceName="")
DataType
Data types of hardware ports.
void addParameter(const ProGe::Parameter &add)
TCEString portKeyName(const HDLPort *port) const
int memoryTotalWidth() const
int memoryAddrWidth() const
Direction
Direction of the port.
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
bool needsInversion() const