Go to the documentation of this file.
71 integratorBlock_(NULL),
78 warningStream_(std::cout),
79 errorStream_(std::cerr),
87 unconnectedPorts_(NULL) {
95 std::ostream& warningStream, std::ostream& errorStream,
99 integratorBlock_(NULL),
101 progeOutputDir_(progeOutputDir),
102 sharedOutputDir_(
""),
103 coreEntityName_(coreEntityName),
104 outputDir_(outputDir),
105 programName_(programName),
106 targetFrequency_(targetClockFreq),
107 warningStream_(warningStream),
108 errorStream_(errorStream),
116 unconnectedPorts_(NULL) {
155 TCEString fileName,
bool absolute)
const {
190 if (original.find(tag) != TCEString::npos) {
191 signal = original.substr(original.find(tag));
199 std::vector<TCEString>& files)
const {
201 bool makeAbsolute =
false;
205 std::vector<std::string> gcuFiles =
208 for (
unsigned int i = 0; i < gcuFiles.size(); i++) {
209 files.push_back(gcuFiles.at(i));
217 bool foundImemMau =
false;
222 std::vector<std::string> vhdlFiles =
224 for (
unsigned int i = 0; i < vhdlFiles.size(); i++) {
225 if (vhdlFiles.at(i).find(imemMau) != TCEString::npos) {
228 files.push_back(vhdlFiles.at(i));
235 files.push_back(path);
244 std::string sharedVhdl =
246 std::vector<std::string> sharedFiles =
248 for (
unsigned int i = 0; i < sharedFiles.size(); i++) {
249 files.push_back(sharedFiles.at(i));
264 throw IOException(__FILE__, __LINE__,
"PlatformIntegrator",
265 "Couldn't create dir " + absolute);
337 for (
int i = 0; i < fuNav.
count(); i++) {
345 std::string prefix = operation.substr(0, 2);
346 if (prefix ==
"ld" || prefix ==
"st") {
366 std::vector<std::string>
368 if (
idf()->hasFUImplementation(fu.
name())) {
372 int id = location.
id();
378 " does not contain " +
"implementation!";
379 throw InvalidData(__FILE__, __LINE__,
"PlatformIntegrator", msg);
384 std::vector<std::string> ports;
389 }
else if (
idf()->hasFUGeneration(fu.
name())) {
391 std::vector<std::string> ports = {
392 "avalid_out",
"aready_in",
"aaddr_out",
"awren_out",
"astrb_out",
393 "rvalid_in",
"rready_out",
"rdata_in",
"adata_out"};
396 TCEString msg =
"Function Unit " + fu.
name() +
" does not have an " +
398 throw InvalidData(__FILE__, __LINE__,
"PlatformIntegrator", msg);
408 unsigned int internalAddrw =
410 unsigned int dataWidth = 0;
414 dataWidth = std::max((
unsigned)port->
width(), dataWidth);
418 ceil(
static_cast<double>(dataWidth)/dmem.
mauWidth));
419 int bytemaskWidth = 0;
421 unsigned int maus =
static_cast<unsigned int>(dmem.
widthInMaus) - 1;
424 dmem.
portAddrw = internalAddrw - bytemaskWidth;
455 for (
size_t i = 0; i < core.
portCount(); i++) {
473 if (width == 0 || width == 1) {
497 return signal.find(
pinTag()) != TCEString::npos;
547 vector<TCEString> imemFiles;
553 if (imemFiles.size() != 0) {
558 for (
unsigned int i = 0; i <
lsus_.size(); i++) {
567 vector<TCEString> dmemFiles;
571 if (dmemFiles.size() != 0) {
581 int memIndex,
int coreId) {
584 vector<TCEString> reasons;
586 errorStream() <<
"TTA core doesn't have compatible memory "
587 <<
"interface:" << std::endl;
588 for (
unsigned int i = 0; i < reasons.size(); i++) {
599 if (generatedFiles.size() == 0) {
600 errorStream() <<
"Failed to create mem component" << endl;
619 writer->
write(platformDir);
626 TCEString msg =
"NetlistWriter failed to create file " + toplevelFile;
627 throw FileNotFound(__FILE__, __LINE__,
"platformIntegrator", msg);
642 vector<TCEString> progeOutFiles;
644 for (
unsigned int i = 0; i < progeOutFiles.size(); i++) {
659 if (as == NULL ||
dmem_.find(as) ==
dmem_.end()) {
661 throw InvalidData(__FILE__, __LINE__,
"PlatformIntegrator", msg);
663 return dmem_.find(as)->second;
669 if (index >
static_cast<int>(
dmem_.size())) {
670 TCEString msg =
"Data memory index out of range";
671 throw OutOfRange(__FILE__, __LINE__,
"PlatformIntegrator", msg);
673 std::map<TTAMachine::AddressSpace*, MemInfo>::const_iterator iter =
696 msg <<
"PlatformIntegrator was not initialized properly";
708 msg <<
"PlatformIntegrator was not initialized properly";
virtual std::vector< TCEString > generateComponentFile(TCEString outputPath)=0
virtual const Netlist & netlist() const
static bool createDirectory(const std::string &path)
virtual TCEString name() const
virtual bool hasAddressSpace() const
TTAMachine::Machine * machine
the architecture definition of the estimated processor
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
@ BIT_VECTOR
Several bits.
virtual size_t parameterCount() const
std::string widthFormula() const
Direction direction() const
void setParameter(const std::string &name, const std::string &type, const std::string &value)
CachedHDBManager & hdb(const std::string fileName)
virtual AddressSpace * addressSpace() const
virtual size_t packageCount() const
virtual const std::string & package(size_t idx) const
virtual bool isTriggering() const
static std::string absolutePathOf(const std::string &pathName)
virtual size_t portCount() const
void addPackage(const std::string &packageName)
bool connect(const NetlistPort &port1, const NetlistPort &port2, int port1FirstBit, int port2FirstBit, int width=1)
void addHdlFiles(const std::vector< TCEString > &files)
virtual void addMemory(const ProGe::NetlistBlock &ttaCore, ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId)
#define assert(condition)
bool realWidthAvailable() const
const std::string & name() const
virtual bool generatesComponentHdlFile() const =0
virtual bool isCompatible(const ProGe::NetlistBlock &ttaCore, int coreId, std::vector< TCEString > &reasons) const
const TCEString & name() const
virtual FunctionUnitNavigator functionUnitNavigator() const
virtual int operationCount() const
virtual int operationPortCount() const
NetlistBlock * shallowCopy(const std::string &instanceName) const
void addHdlFile(const TCEString &file)
std::string errorMessage() const
static const std::string DIRECTORY_SEPARATOR
virtual void write(const std::string &dstDirectory)=0
DataType dataType() const
virtual int width() const
void addSubBlock(BaseNetlistBlock *subBlock, const std::string &instanceName="")
static bool fileExists(const std::string fileName)
Parameter parameter(size_t index) const
virtual bool isInput() const
HDL
HDLs supported by ProGe.
ComponentType * item(int index) const
void setParameter(const std::string &name, const std::string &type, const std::string &value)
virtual HWOperation * operation(const std::string &name) const
virtual std::string hdbFile() const
virtual FUPort * operationPort(const std::string &name) const
virtual bool hasImplementation() const
FUImplementationLocation & fuImplementation(const std::string &fu) const
FUImplementation & implementation() const
FUEntry * fuByEntryID(RowID id) const
virtual const Parameter & parameter(const std::string &name) const
virtual ULongWord end() const
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
virtual int width() const
static std::vector< std::string > directoryContents(const std::string &directory, const bool absolutePaths=true)
static HDBRegistry & instance()