OpenASIP  2.0
PlatformIntegrator.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2010 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file PlatformIntegerator.cc
26  *
27  * Implementation of PlatformIntegrator class.
28  *
29  * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #include <iostream>
34 #include <vector>
35 #include <string>
36 #include "PlatformIntegrator.hh"
37 #include "MemoryGenerator.hh"
38 #include "FileSystem.hh"
39 #include "StringTools.hh"
40 #include "Exception.hh"
41 #include "Netlist.hh"
42 #include "NetlistBlock.hh"
43 #include "NetlistPort.hh"
44 #include "VHDLNetlistWriter.hh"
45 #include "ProjectFileGenerator.hh"
46 #include "Machine.hh"
47 #include "HWOperation.hh"
48 #include "MachineImplementation.hh"
49 #include "FUPort.hh"
50 #include "FUEntry.hh"
51 #include "FUArchitecture.hh"
52 #include "MathTools.hh"
53 #include "HDBManager.hh"
54 #include "HDBRegistry.hh"
55 #include "FUImplementation.hh"
56 #include "FUExternalPort.hh"
57 using std::vector;
58 using std::endl;
59 using std::multimap;
61 using ProGe::NetlistPort;
62 using ProGe::Netlist;
64 
67 
69  : machine_(NULL),
70  idf_(NULL),
71  integratorBlock_(NULL),
72  hdl_(ProGe::VHDL),
73  progeOutputDir_(""),
74  coreEntityName_(""),
75  outputDir_(""),
76  programName_(""),
77  targetFrequency_(0),
78  warningStream_(std::cout),
79  errorStream_(std::cerr),
80  ttaCores_(NULL),
81  imem_(),
82  dmemType_(UNKNOWN),
83  dmem_(),
84  lsus_(),
85  clkPort_(NULL),
86  resetPort_(NULL),
87  unconnectedPorts_(NULL) {
88  imem_.type = UNKNOWN;
89 }
90 
93  ProGe::HDL hdl, TCEString progeOutputDir, TCEString coreEntityName,
94  TCEString outputDir, TCEString programName, int targetClockFreq,
95  std::ostream& warningStream, std::ostream& errorStream,
96  const MemInfo& imem, MemType dmemType)
97  : machine_(machine),
98  idf_(idf),
99  integratorBlock_(NULL),
100  hdl_(hdl),
101  progeOutputDir_(progeOutputDir),
102  sharedOutputDir_(""),
103  coreEntityName_(coreEntityName),
104  outputDir_(outputDir),
105  programName_(programName),
106  targetFrequency_(targetClockFreq),
107  warningStream_(warningStream),
108  errorStream_(errorStream),
109  ttaCores_(NULL),
110  imem_(imem),
111  dmemType_(dmemType),
112  dmem_(),
113  lsus_(),
114  clkPort_(NULL),
115  resetPort_(NULL),
116  unconnectedPorts_(NULL) {
119 
120  createOutputDir();
121 }
122 
124 
125 TCEString
127 
128  return coreEntityName_;
129 }
130 
131 
132 TCEString
134 
135  return programName_;
136 }
137 
138 
139 TCEString
140 PlatformIntegrator::progeFilePath(TCEString fileName, bool absolute) const {
141 
142  TCEString pathToFile =
144 
145  if (absolute) {
146  pathToFile = FileSystem::absolutePathOf(pathToFile);
147  }
148 
149  return pathToFile;
150 }
151 
152 
153 TCEString
155  TCEString fileName, bool absolute) const {
156 
157  TCEString pathToFile =
159 
160  if (absolute) {
161  pathToFile = FileSystem::absolutePathOf(pathToFile);
162  }
163 
164  return pathToFile;
165 }
166 
167 
168 void
170 
171  if (FileSystem::absolutePathOf(sharedDir) !=
173  sharedOutputDir_ = sharedDir;
174  }
175 }
176 
177 
178 TCEString
180  return outputDir_;
181 }
182 
183 
184 TCEString
186  const TCEString& original,
187  const TCEString& tag) const {
188 
189  TCEString signal = original;
190  if (original.find(tag) != TCEString::npos) {
191  signal = original.substr(original.find(tag));
192  }
193  return StringTools::trim(signal);
194 }
195 
196 
197 void
199  std::vector<TCEString>& files) const {
200 
201  bool makeAbsolute = false;
202  try {
203  TCEString gcuPath =
205  std::vector<std::string> gcuFiles =
206  FileSystem::directoryContents(gcuPath, makeAbsolute);
207 
208  for (unsigned int i = 0; i < gcuFiles.size(); i++) {
209  files.push_back(gcuFiles.at(i));
210  }
211  } catch (FileNotFound& e) {
212  errorStream() << "Error: " << e.errorMessage() << std::endl;
213  throw e;
214  }
215 
216  try {
217  bool foundImemMau = false;
218  TCEString imemMau = coreEntityName() + "_imem_mau_pkg.vhdl";
219 
220  TCEString vhdlPath =
222  std::vector<std::string> vhdlFiles =
223  FileSystem::directoryContents(vhdlPath, makeAbsolute);
224  for (unsigned int i = 0; i < vhdlFiles.size(); i++) {
225  if (vhdlFiles.at(i).find(imemMau) != TCEString::npos) {
226  foundImemMau = true;
227  }
228  files.push_back(vhdlFiles.at(i));
229  }
230 
231  // imem_mau_pkg was not yet present, but add it to file list
232  if (!foundImemMau) {
233  TCEString path =
234  vhdlPath + FileSystem::DIRECTORY_SEPARATOR + imemMau;
235  files.push_back(path);
236  }
237  } catch (FileNotFound& e) {
238  errorStream() << "Error: " << e.errorMessage() << std::endl;
239  throw e;
240  }
241 
242  if (!sharedOutputDir_.empty()) {
243  try {
244  std::string sharedVhdl =
246  std::vector<std::string> sharedFiles =
247  FileSystem::directoryContents(sharedVhdl, makeAbsolute);
248  for (unsigned int i = 0; i < sharedFiles.size(); i++) {
249  files.push_back(sharedFiles.at(i));
250  }
251  } catch (FileNotFound& e) {
252  errorStream() << "Error: " << e.errorMessage() << std::endl;
253  throw e;
254  }
255  }
256 }
257 
258 
259 void
261 
263  if (!FileSystem::createDirectory(absolute)) {
264  throw IOException(__FILE__, __LINE__, "PlatformIntegrator",
265  "Couldn't create dir " + absolute);
266  }
267 }
268 
269 
270 std::ostream&
272 
273  return warningStream_;
274 }
275 
276 
277 std::ostream&
279 
280  return errorStream_;
281 }
282 
283 
284 int
286 
287  return targetFrequency_;
288 }
289 
292  assert(integratorBlock_ != NULL);
293  return integratorBlock_;
294 }
295 
296 const TTAMachine::Machine*
298 
299  return machine_;
300 }
301 
302 
305 
306  return idf_;
307 }
308 
309 
310 TCEString
312 
313  return coreEntityName() + "_toplevel";
314 }
315 
316 void
318  const ProGe::NetlistBlock* progeBlock) {
319  NetlistBlock* highestBlock = integratorBlock_;
320  // Must add ports to highest block *before* copying tta toplevel
321  clkPort_ = new NetlistPort(
322  TTA_CORE_CLK, "0", 1, ProGe::BIT, ProGe::IN, *highestBlock);
323  resetPort_ = new NetlistPort(
324  TTA_CORE_RSTX, "0", 1, ProGe::BIT, ProGe::IN, *highestBlock);
326 
327  if (dmemType_ != NONE) {
329  }
330 }
331 
332 
333 void
337  for (int i = 0; i < fuNav.count(); i++) {
338  TTAMachine::FunctionUnit* fu = fuNav.item(i);
339  if (fu->hasAddressSpace()) {
341 
342  bool isLSU = false;
343  for (int i = 0; i < fu->operationCount(); ++i) {
344  std::string operation = fu->operation(i)->name();
345  std::string prefix = operation.substr(0, 2);
346  if (prefix == "ld" || prefix == "st") {
347  isLSU = true;
348  break;
349  }
350  }
351 
352  if (isLSU) {
353  dmem_[as] = readLsuParameters(*fu);
354  lsus_.push_back(fu);
355  }
356  }
357  }
358 }
359 
360 void
362  dmem_.clear();
363  lsus_.clear();
364 }
365 
366 std::vector<std::string>
368  if (idf()->hasFUImplementation(fu.name())) {
370  idf()->fuImplementation(fu.name());
371  TCEString hdb = location.hdbFile();
372  int id = location.id();
374  HDB::FUEntry* entry = manager.fuByEntryID(id);
375 
376  if (!entry->hasImplementation()) {
377  TCEString msg = "HDB entry for " + fu.name() +
378  " does not contain " + "implementation!";
379  throw InvalidData(__FILE__, __LINE__, "PlatformIntegrator", msg);
380  }
381 
382  auto implementation = entry->implementation();
383 
384  std::vector<std::string> ports;
385  for (int i = 0; i > implementation.externalPortCount(); ++i) {
386  ports.push_back(implementation.externalPort(i).name());
387  }
388  return ports;
389  } else if (idf()->hasFUGeneration(fu.name())) {
390  // quick fix: assume AlmaIF ports
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"};
394  return ports;
395  } else {
396  TCEString msg = "Function Unit " + fu.name() + " does not have an " +
397  "implementation!";
398  throw InvalidData(__FILE__, __LINE__, "PlatformIntegrator", msg);
399  }
400 }
401 
402 MemInfo
404 
405  MemInfo dmem;
406  dmem.type = dmemType_;
407  dmem.mauWidth = lsu.addressSpace()->width();
408  unsigned int internalAddrw =
410  unsigned int dataWidth = 0;
411  for (int i = 0; i < lsu.operationPortCount(); i++) {
412  TTAMachine::FUPort* port = lsu.operationPort(i);
413  if (port->isInput() && !port->isTriggering()) {
414  dataWidth = std::max((unsigned)port->width(), dataWidth);
415  }
416  }
417  dmem.widthInMaus = static_cast<int>(
418  ceil(static_cast<double>(dataWidth)/dmem.mauWidth));
419  int bytemaskWidth = 0;
420  if (dmem.widthInMaus > 1) {
421  unsigned int maus = static_cast<unsigned int>(dmem.widthInMaus) - 1;
422  bytemaskWidth = MathTools::requiredBits(maus);
423  }
424  dmem.portAddrw = internalAddrw - bytemaskWidth;
425  unsigned long int lastAddr = lsu.addressSpace()->end();
426  dmem.asAddrw = MathTools::requiredBits(lastAddr);
427  dmem.asName = lsu.addressSpace()->name();
428  dmem.lsuName = lsu.name();
429  dmem.isShared = false;
430  return dmem;
431 }
432 
433 bool
435  const ProGe::NetlistBlock& cores, int coreId) {
438  const NetlistPort* coreClk = cores.port(clkPortName);
439  const NetlistPort* coreRstx = cores.port(resetPortName);
440  integratorBlock()->netlist().connect(*clockPort(), *coreClk);
441  integratorBlock()->netlist().connect(*resetPort(), *coreRstx);
442 
443  if (!createMemories(coreId)) {
444  return false;
445  }
446 
447  exportUnconnectedPorts(coreId);
448 
449  return true;
450 }
451 
452 void
454  const NetlistBlock& core = progeBlock();
455  for (size_t i = 0; i < core.portCount(); i++) {
456  const NetlistPort& port = core.port(i);
457  if (!integratorBlock()->netlist().isPortConnected(port)) {
458  connectToplevelPort(port);
459  }
460  }
461 }
462 
463 void
465  const ProGe::NetlistPort& corePort, const TCEString signalPrefix) {
466  TCEString toplevelName = corePort.name();
467  if (chopTaggedSignals() && hasPinTag(toplevelName)) {
468  toplevelName = signalPrefix + chopSignalToTag(toplevelName, pinTag());
469  }
470  NetlistPort* topPort = NULL;
471  if (corePort.realWidthAvailable()) {
472  int width = corePort.realWidth();
473  if (width == 0 || width == 1) {
474  topPort = new NetlistPort(
475  toplevelName, corePort.widthFormula(), corePort.realWidth(),
476  ProGe::BIT, corePort.direction(), *integratorBlock());
477  } else {
478  topPort = new NetlistPort(
479  toplevelName, corePort.widthFormula(), corePort.realWidth(),
481  }
482  } else {
483  topPort = new NetlistPort(
484  toplevelName, corePort.widthFormula(), corePort.dataType(),
485  corePort.direction(), *integratorBlock());
486  }
487  if (topPort->dataType() == corePort.dataType()) {
488  integratorBlock()->netlist().connect(*topPort, corePort);
489  } else {
490  integratorBlock()->netlist().connect(*topPort, corePort, 0, 0, 1);
491  }
492 }
493 
494 bool
496 
497  return signal.find(pinTag()) != TCEString::npos;
498 }
499 
500 
501 void
503  const ProGe::NetlistBlock* progeBlock) {
504  ttaCores_ = progeBlock->shallowCopy("core");
506  top.addSubBlock(ttaCores_);
507 
508  // copy parameters to the current toplevel
509  for (size_t i = 0; i < ttaCores_->parameterCount(); i++) {
510  // Filter out some parameters not usable in the integrator block.
511  if (ttaCores_->parameter(i).name() == "core_id") {
512  continue;
513  }
514 
516  }
517 
518  // copy package references to the current toplevel
519  for (size_t i = 0; i < ttaCores_->packageCount(); i++) {
520  top.addPackage(ttaCores_->package(i));
521  }
522 
523  for (size_t i = 0; i < ttaCores_->netlist().parameterCount(); i++) {
525  }
526 }
527 
528 
529 const ProGe::NetlistBlock&
531  assert(ttaCores_ != NULL);
532  return *ttaCores_;
533 }
534 
535 
536 const ProGe::NetlistBlock&
538  return *integratorBlock_;
539 }
540 
541 bool
543  assert(imem_.type != UNKNOWN);
544 
545  int imemIndex = 0;
546  MemoryGenerator& imemGen = imemInstance(imem_, coreId);
547  vector<TCEString> imemFiles;
548 
549  if (imem_.type != NONE) {
550  if (!generateMemory(imemGen, imemFiles, imemIndex, coreId)) {
551  return false;
552  }
553  if (imemFiles.size() != 0) {
554  projectFileGenerator()->addHdlFiles(imemFiles);
555  }
556  }
557 
558  for (unsigned int i = 0; i < lsus_.size(); i++) {
559  TTAMachine::FunctionUnit* lsuArch = lsus_.at(i);
560  std::vector<std::string> ports = loadFUExternalPorts(*lsuArch);
561 
562  TTAMachine::AddressSpace* as = lsuArch->addressSpace();
563  assert(dmem_.find(as) != dmem_.end() && "Address space not found!");
564 
565  MemoryGenerator& dmemGen =
566  dmemInstance(dmem_.find(as)->second, *lsuArch, ports);
567  vector<TCEString> dmemFiles;
568  if (!generateMemory(dmemGen, dmemFiles, i, coreId)) {
569  return false;
570  }
571  if (dmemFiles.size() != 0) {
572  projectFileGenerator()->addHdlFiles(dmemFiles);
573  }
574  }
575  return true;
576 }
577 
578 bool
580  MemoryGenerator& memGen, std::vector<TCEString>& generatedFiles,
581  int memIndex, int coreId) {
582  const NetlistBlock& ttaCores = progeBlock();
583 
584  vector<TCEString> reasons;
585  if (!memGen.isCompatible(ttaCores, coreId, reasons)) {
586  errorStream() << "TTA core doesn't have compatible memory "
587  <<"interface:" << std::endl;
588  for (unsigned int i = 0; i < reasons.size(); i++) {
589  errorStream() << reasons.at(i) << std::endl;
590  }
591  return false;
592  }
593 
594  memGen.addMemory(ttaCores, *integratorBlock(), memIndex, coreId);
595 
596  if (memGen.generatesComponentHdlFile()) {
597  generatedFiles =
599  if (generatedFiles.size() == 0) {
600  errorStream() << "Failed to create mem component" << endl;
601  return false;
602  }
603  }
604 
605  return true;
606 }
607 
608 void
610 
611  ProGe::NetlistWriter* writer;
612  if (hdl_ == ProGe::VHDL) {
614  } else {
615  assert(false);
616  }
617 
618  TCEString platformDir = outputPath();
619  writer->write(platformDir);
620  delete writer;
621 
622 
623  TCEString toplevelFile =
624  outputFilePath(coreEntityName() + "_toplevel.vhdl");
625  if (!FileSystem::fileExists(toplevelFile)) {
626  TCEString msg = "NetlistWriter failed to create file " + toplevelFile;
627  throw FileNotFound(__FILE__, __LINE__, "platformIntegrator", msg);
628  }
629  projectFileGenerator()->addHdlFile(toplevelFile);
630 
631  TCEString paramFile =
632  outputFilePath(platformEntityName() + "_params_pkg.vhdl");
633  if (FileSystem::fileExists(paramFile)) {
634  projectFileGenerator()->addHdlFile(paramFile);
635  }
636 }
637 
638 
639 void
641 
642  vector<TCEString> progeOutFiles;
643  progeOutputHdlFiles(progeOutFiles);
644  for (unsigned int i = 0; i < progeOutFiles.size(); i++) {
645  projectFileGenerator()->addHdlFile(progeOutFiles.at(i));
646  }
647 }
648 
649 
650 const MemInfo&
652 
653  return imem_;
654 }
655 
656 const MemInfo&
658 
659  if (as == NULL || dmem_.find(as) == dmem_.end()) {
660  TCEString msg = "Invalid address space";
661  throw InvalidData(__FILE__, __LINE__, "PlatformIntegrator", msg);
662  }
663  return dmem_.find(as)->second;
664 }
665 
666 const MemInfo&
668 
669  if (index > static_cast<int>(dmem_.size())) {
670  TCEString msg = "Data memory index out of range";
671  throw OutOfRange(__FILE__, __LINE__, "PlatformIntegrator", msg);
672  }
673  std::map<TTAMachine::AddressSpace*, MemInfo>::const_iterator iter =
674  dmem_.begin();
675  int i = 0;
676  while (i < index) {
677  iter++;
678  i++;
679  }
680  assert(iter != dmem_.end());
681  return iter->second;
682 }
683 
684 int
686 
687  return dmem_.size();
688 }
689 
690 
693 
694  if (clkPort_ == NULL) {
695  TCEString msg;
696  msg << "PlatformIntegrator was not initialized properly";
697  throw ObjectNotInitialized(__FILE__, __LINE__, __func__, msg);
698  }
699  return clkPort_;
700 }
701 
702 
705 
706  if (resetPort_ == NULL) {
707  TCEString msg;
708  msg << "PlatformIntegrator was not initialized properly";
709  throw ObjectNotInitialized(__FILE__, __LINE__, __func__, msg);
710  }
711  return resetPort_;
712 }
PlatformIntegrator::programName_
TCEString programName_
Definition: PlatformIntegrator.hh:325
IDF::UnitImplementationLocation
Definition: UnitImplementationLocation.hh:48
MemoryGenerator::generateComponentFile
virtual std::vector< TCEString > generateComponentFile(TCEString outputPath)=0
PlatformIntegrator::TTA_CORE_RSTX
static const TCEString TTA_CORE_RSTX
Definition: PlatformIntegrator.hh:304
HDB::FUEntry
Definition: FUEntry.hh:49
Netlist.hh
PlatformIntegrator::initPlatformNetlist
virtual void initPlatformNetlist(const ProGe::NetlistBlock *progeBlock)
Definition: PlatformIntegrator.cc:317
ProGe::NetlistBlock::netlist
virtual const Netlist & netlist() const
Definition: BaseNetlistBlock.cc:348
PlatformIntegrator::warningStream_
std::ostream & warningStream_
Definition: PlatformIntegrator.hh:329
PlatformIntegrator::clockPort
ProGe::NetlistPort * clockPort() const
Definition: PlatformIntegrator.cc:692
PlatformIntegrator::lsus_
std::vector< TTAMachine::FunctionUnit * > lsus_
Definition: PlatformIntegrator.hh:338
PlatformIntegrator::coreEntityName_
TCEString coreEntityName_
Definition: PlatformIntegrator.hh:323
PlatformIntegrator::coreEntityName
TCEString coreEntityName() const
Definition: PlatformIntegrator.cc:126
PlatformIntegrator::platformEntityName
TCEString platformEntityName() const
Definition: PlatformIntegrator.cc:311
FileSystem.hh
PlatformIntegrator::chopSignalToTag
TCEString chopSignalToTag(const TCEString &original, const TCEString &tag) const
Definition: PlatformIntegrator.cc:185
FileNotFound
Definition: Exception.hh:224
FileSystem::createDirectory
static bool createDirectory(const std::string &path)
Definition: FileSystem.cc:400
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
ProGe::NetlistBlock
Definition: NetlistBlock.hh:61
PlatformIntegrator::setSharedOutputDir
void setSharedOutputDir(const TCEString &sharedDir)
Definition: PlatformIntegrator.cc:169
TTAMachine::FunctionUnit::hasAddressSpace
virtual bool hasAddressSpace() const
Definition: FunctionUnit.cc:608
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
Exception.hh
PlatformIntegrator::targetFrequency_
int targetFrequency_
Definition: PlatformIntegrator.hh:327
implementation
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:61
ProGe::BIT_VECTOR
@ BIT_VECTOR
Several bits.
Definition: ProGeTypes.hh:48
FUArchitecture.hh
MemInfo
Definition: MemoryGenerator.hh:67
ProGe::BaseNetlistBlock::parameterCount
virtual size_t parameterCount() const
Definition: BaseNetlistBlock.cc:231
OutOfRange
Definition: Exception.hh:320
PlatformIntegrator::pinTag
virtual TCEString pinTag() const =0
ProGe::VHDLNetlistWriter
Definition: VHDLNetlistWriter.hh:52
ProGe::NetlistPort::widthFormula
std::string widthFormula() const
Definition: NetlistPort.cc:316
PlatformIntegrator::parseDataMemories
void parseDataMemories()
Definition: PlatformIntegrator.cc:334
MemoryGenerator.hh
ProGe::NetlistPort::direction
Direction direction() const
Definition: NetlistPort.cc:373
PlatformIntegrator::clearDataMemories
void clearDataMemories()
Definition: PlatformIntegrator.cc:361
ProGe::NetlistBlock::setParameter
void setParameter(const std::string &name, const std::string &type, const std::string &value)
Definition: NetlistBlock.cc:89
ProGe::NetlistWriter
Definition: NetlistWriter.hh:47
PlatformIntegrator::TTA_CORE_CLK
static const TCEString TTA_CORE_CLK
Definition: PlatformIntegrator.hh:303
HDB::HDBRegistry::hdb
CachedHDBManager & hdb(const std::string fileName)
Definition: HDBRegistry.cc:80
TTAMachine::FunctionUnit::addressSpace
virtual AddressSpace * addressSpace() const
Definition: FunctionUnit.cc:580
PlatformIntegrator::writeNewToplevel
virtual void writeNewToplevel()
Definition: PlatformIntegrator.cc:609
ProGe::NetlistBlock::packageCount
virtual size_t packageCount() const
Definition: BaseNetlistBlock.cc:694
ProGe::NetlistBlock::package
virtual const std::string & package(size_t idx) const
Definition: BaseNetlistBlock.cc:699
TTAMachine::Machine::Navigator::count
int count() const
PlatformIntegrator::createOutputDir
void createOutputDir()
Definition: PlatformIntegrator.cc:260
ProGe::Netlist
Definition: Netlist.hh:63
TTAMachine::FUPort::isTriggering
virtual bool isTriggering() const
Definition: FUPort.cc:182
PlatformIntegrator::errorStream_
std::ostream & errorStream_
Definition: PlatformIntegrator.hh:330
FileSystem::absolutePathOf
static std::string absolutePathOf(const std::string &pathName)
Definition: FileSystem.cc:303
PlatformIntegrator::createMemories
virtual bool createMemories(int coreId)
Definition: PlatformIntegrator.cc:542
ProGe::NetlistBlock::portCount
virtual size_t portCount() const
Definition: BaseNetlistBlock.cc:248
ProGe::NetlistBlock::addPackage
void addPackage(const std::string &packageName)
Definition: BaseNetlistBlock.cc:687
ProGe::Netlist::connect
bool connect(const NetlistPort &port1, const NetlistPort &port2, int port1FirstBit, int port2FirstBit, int width=1)
Definition: Netlist.cc:83
PlatformIntegrator::projectFileGenerator
virtual ProjectFileGenerator * projectFileGenerator() const =0
PlatformIntegrator::outputPath
TCEString outputPath() const
Definition: PlatformIntegrator.cc:179
PlatformIntegrator::~PlatformIntegrator
virtual ~PlatformIntegrator()
Definition: PlatformIntegrator.cc:123
PlatformIntegrator::connectToplevelPort
virtual void connectToplevelPort(const ProGe::NetlistPort &corePort, const TCEString signalPrefix="")
Definition: PlatformIntegrator.cc:464
ProjectFileGenerator::addHdlFiles
void addHdlFiles(const std::vector< TCEString > &files)
Definition: ProjectFileGenerator.cc:63
PlatformIntegrator::dmemCount
int dmemCount() const
Definition: PlatformIntegrator.cc:685
StringTools.hh
MemoryGenerator::addMemory
virtual void addMemory(const ProGe::NetlistBlock &ttaCore, ProGe::NetlistBlock &integratorBlock, int memIndex, int coreId)
Definition: MemoryGenerator.cc:119
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
ProGe::NetlistPort::realWidthAvailable
bool realWidthAvailable() const
Definition: NetlistPort.cc:334
TTAMachine::FUPort
Definition: FUPort.hh:46
PlatformIntegrator::ttaCores_
ProGe::NetlistBlock * ttaCores_
Definition: PlatformIntegrator.hh:332
ObjectNotInitialized
Definition: Exception.hh:640
ProGe::VHDL
@ VHDL
VHDL.
Definition: ProGeTypes.hh:41
HWOperation.hh
PlatformIntegrator::sharedOutputDir_
TCEString sharedOutputDir_
Definition: PlatformIntegrator.hh:322
TTAMachine::HWOperation::name
const std::string & name() const
Definition: HWOperation.cc:141
MemInfo::type
MemType type
Definition: MemoryGenerator.hh:68
InvalidData
Definition: Exception.hh:149
MemoryGenerator::generatesComponentHdlFile
virtual bool generatesComponentHdlFile() const =0
PlatformIntegrator::resetPort
ProGe::NetlistPort * resetPort() const
Definition: PlatformIntegrator.cc:704
MemoryGenerator::isCompatible
virtual bool isCompatible(const ProGe::NetlistBlock &ttaCore, int coreId, std::vector< TCEString > &reasons) const
Definition: MemoryGenerator.cc:82
MemInfo::asAddrw
int asAddrw
Definition: MemoryGenerator.hh:72
PlatformIntegrator::hdl_
ProGe::HDL hdl_
Definition: PlatformIntegrator.hh:319
MemInfo::asName
TCEString asName
Definition: MemoryGenerator.hh:74
PlatformIntegrator::loadFUExternalPorts
std::vector< std::string > loadFUExternalPorts(TTAMachine::FunctionUnit &fu) const
Definition: PlatformIntegrator.cc:367
NetlistPort.hh
FUEntry.hh
ProGe::Parameter::name
const TCEString & name() const
Definition: Parameter.cc:133
PlatformIntegrator::progeBlock
const ProGe::NetlistBlock & progeBlock() const
Definition: PlatformIntegrator.cc:530
__func__
#define __func__
Definition: Application.hh:67
TTAMachine::Machine::functionUnitNavigator
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition: Machine.cc:380
PlatformIntegrator::PlatformIntegrator
PlatformIntegrator()
Definition: PlatformIntegrator.cc:68
PlatformIntegrator::idf
const IDF::MachineImplementation * idf() const
Definition: PlatformIntegrator.cc:304
NetlistBlock.hh
PlatformIntegrator::dmem_
std::map< TTAMachine::AddressSpace *, MemInfo > dmem_
Definition: PlatformIntegrator.hh:336
TTAMachine::FunctionUnit::operationCount
virtual int operationCount() const
Definition: FunctionUnit.cc:419
HDB::HDBManager
Definition: HDBManager.hh:82
MathTools::requiredBits
static int requiredBits(unsigned long int number)
PlatformIntegrator::targetClockFrequency
virtual int targetClockFrequency() const
Definition: PlatformIntegrator.cc:285
ProGe::BIT
@ BIT
One bit.
Definition: ProGeTypes.hh:47
VHDLNetlistWriter.hh
Machine.hh
PlatformIntegrator::toplevelBlock
const ProGe::NetlistBlock & toplevelBlock() const
Definition: PlatformIntegrator.cc:537
PlatformIntegrator::machine
const TTAMachine::Machine * machine() const
Definition: PlatformIntegrator.cc:297
MemInfo::widthInMaus
int widthInMaus
Definition: MemoryGenerator.hh:70
PlatformIntegrator::generateMemory
virtual bool generateMemory(MemoryGenerator &memGen, std::vector< TCEString > &generatedFiles, int memIndex, int coreId)
Definition: PlatformIntegrator.cc:579
PlatformIntegrator::imemInfo
const MemInfo & imemInfo() const
Definition: PlatformIntegrator.cc:651
TTAMachine::FunctionUnit::operationPortCount
virtual int operationPortCount() const
Definition: FunctionUnit.cc:182
ProGe::NetlistBlock::shallowCopy
NetlistBlock * shallowCopy(const std::string &instanceName) const
Definition: NetlistBlock.cc:161
ProGe::NetlistPort::name
std::string name() const
Definition: NetlistPort.cc:283
PlatformIntegrator::hasPinTag
virtual bool hasPinTag(const TCEString &signal) const
Definition: PlatformIntegrator.cc:495
MemInfo::mauWidth
int mauWidth
Definition: MemoryGenerator.hh:69
FUImplementation.hh
ProjectFileGenerator::addHdlFile
void addHdlFile(const TCEString &file)
Definition: ProjectFileGenerator.cc:56
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
ProjectFileGenerator.hh
FileSystem::DIRECTORY_SEPARATOR
static const std::string DIRECTORY_SEPARATOR
Definition: FileSystem.hh:189
NONE
@ NONE
Definition: MemoryGenerator.hh:59
ProGe::NetlistWriter::write
virtual void write(const std::string &dstDirectory)=0
PlatformIntegrator::idf_
const IDF::MachineImplementation * idf_
Definition: PlatformIntegrator.hh:315
PlatformIntegrator::dmemType_
MemType dmemType_
Definition: PlatformIntegrator.hh:335
PlatformIntegrator::outputDir_
TCEString outputDir_
Definition: PlatformIntegrator.hh:324
ProGe::NetlistPort::dataType
DataType dataType() const
Definition: NetlistPort.cc:362
PlatformIntegrator::dmemInstance
virtual MemoryGenerator & dmemInstance(MemInfo dmem, TTAMachine::FunctionUnit &lsuArch, std::vector< std::string > lsuPorts)=0
StringTools::trim
static std::string trim(const std::string &source)
Definition: StringTools.cc:55
TTAMachine::AddressSpace::width
virtual int width() const
Definition: AddressSpace.cc:155
MemInfo::isShared
bool isShared
Definition: MemoryGenerator.hh:73
PlatformIntegrator::integratorBlock
ProGe::NetlistBlock * integratorBlock()
Definition: PlatformIntegrator.cc:291
PlatformIntegrator::progeOutputHdlFiles
void progeOutputHdlFiles(std::vector< TCEString > &files) const
Definition: PlatformIntegrator.cc:198
PlatformIntegrator::programName
TCEString programName() const
Definition: PlatformIntegrator.cc:133
MemType
MemType
Definition: MemoryGenerator.hh:57
ProGe::NetlistPort::realWidth
int realWidth() const
Definition: NetlistPort.cc:348
FUExternalPort.hh
PlatformIntegrator::exportUnconnectedPorts
virtual void exportUnconnectedPorts(int coreId)
Definition: PlatformIntegrator.cc:453
PlatformIntegrator::progeFilePath
TCEString progeFilePath(TCEString fileName, bool absolute=false) const
Definition: PlatformIntegrator.cc:140
PlatformIntegrator::readLsuParameters
MemInfo readLsuParameters(const TTAMachine::FunctionUnit &lsu)
Definition: PlatformIntegrator.cc:403
ProGe::NetlistBlock::addSubBlock
void addSubBlock(BaseNetlistBlock *subBlock, const std::string &instanceName="")
Definition: BaseNetlistBlock.cc:405
IDF::UnitImplementationLocation::id
virtual int id() const
Definition: UnitImplementationLocation.cc:127
ProGe
Definition: FUGen.hh:54
FileSystem::fileExists
static bool fileExists(const std::string fileName)
TCEString
Definition: TCEString.hh:53
PlatformIntegrator::dmemInfo
const MemInfo & dmemInfo(TTAMachine::AddressSpace *as) const
Definition: PlatformIntegrator.cc:657
FUPort.hh
PlatformIntegrator::warningStream
std::ostream & warningStream() const
Definition: PlatformIntegrator.cc:271
PlatformIntegrator::integrateCore
virtual bool integrateCore(const ProGe::NetlistBlock &cores, int coreId)
Definition: PlatformIntegrator.cc:434
UNKNOWN
@ UNKNOWN
Definition: MemoryGenerator.hh:58
PlatformIntegrator.hh
ProGe::Netlist::parameter
Parameter parameter(size_t index) const
Definition: Netlist.cc:434
PlatformIntegrator::integratorBlock_
ProGe::NetlistBlock * integratorBlock_
Definition: PlatformIntegrator.hh:317
PlatformIntegrator::imem_
MemInfo imem_
Definition: PlatformIntegrator.hh:334
TTAMachine::Port::isInput
virtual bool isInput() const
Definition: Port.cc:298
ProGe::HDL
HDL
HDLs supported by ProGe.
Definition: ProGeTypes.hh:40
ProGe::NetlistPort
Definition: NetlistPort.hh:70
PlatformIntegrator::copyProgeBlockToNetlist
void copyProgeBlockToNetlist(const ProGe::NetlistBlock *progeBlock)
Definition: PlatformIntegrator.cc:502
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
ProGe::Netlist::setParameter
void setParameter(const std::string &name, const std::string &type, const std::string &value)
Definition: Netlist.cc:362
TTAMachine::FunctionUnit::operation
virtual HWOperation * operation(const std::string &name) const
Definition: FunctionUnit.cc:363
IDF::UnitImplementationLocation::hdbFile
virtual std::string hdbFile() const
Definition: UnitImplementationLocation.cc:99
IOException
Definition: Exception.hh:130
PlatformIntegrator::outputFilePath
TCEString outputFilePath(TCEString fileName, bool absolute=false) const
Definition: PlatformIntegrator.cc:154
MathTools.hh
TTAMachine::FunctionUnit::operationPort
virtual FUPort * operationPort(const std::string &name) const
Definition: FunctionUnit.cc:224
PlatformIntegrator::resetPort_
ProGe::NetlistPort * resetPort_
Definition: PlatformIntegrator.hh:341
HDB::FUEntry::hasImplementation
virtual bool hasImplementation() const
Definition: FUEntry.cc:74
IDF::MachineImplementation::fuImplementation
FUImplementationLocation & fuImplementation(const std::string &fu) const
Definition: MachineImplementation.cc:355
HDB::FUEntry::implementation
FUImplementation & implementation() const
Definition: FUEntry.cc:86
HDBManager.hh
PlatformIntegrator::clkPort_
ProGe::NetlistPort * clkPort_
Definition: PlatformIntegrator.hh:340
MemInfo::portAddrw
int portAddrw
Definition: MemoryGenerator.hh:71
PlatformIntegrator::errorStream
std::ostream & errorStream() const
Definition: PlatformIntegrator.cc:278
PlatformIntegrator::addProGeFiles
void addProGeFiles() const
Definition: PlatformIntegrator.cc:640
HDBRegistry.hh
HDB::HDBManager::fuByEntryID
FUEntry * fuByEntryID(RowID id) const
Definition: HDBManager.cc:2828
ProGe::NetlistBlock::parameter
virtual const Parameter & parameter(const std::string &name) const
Definition: BaseNetlistBlock.cc:198
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TTAMachine::AddressSpace::end
virtual ULongWord end() const
Definition: AddressSpace.cc:177
PlatformIntegrator::progeOutputDir_
TCEString progeOutputDir_
Definition: PlatformIntegrator.hh:321
ProGe::NetlistBlock::port
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
Definition: NetlistBlock.cc:97
PlatformIntegrator::machine_
const TTAMachine::Machine * machine_
Definition: PlatformIntegrator.hh:313
PlatformIntegrator::imemInstance
virtual MemoryGenerator & imemInstance(MemInfo imem, int coreId)=0
ProGe::IN
@ IN
Input port.
Definition: ProGeTypes.hh:53
PlatformIntegrator::chopTaggedSignals
virtual bool chopTaggedSignals() const =0
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
MachineImplementation.hh
TTAMachine::BaseFUPort::width
virtual int width() const
Definition: BaseFUPort.cc:109
MemInfo::lsuName
TCEString lsuName
Definition: MemoryGenerator.hh:75
FileSystem::directoryContents
static std::vector< std::string > directoryContents(const std::string &directory, const bool absolutePaths=true)
Definition: FileSystem.cc:600
TTAMachine::Machine
Definition: Machine.hh:73
HDB::HDBRegistry::instance
static HDBRegistry & instance()
Definition: HDBRegistry.cc:62
MemoryGenerator
Definition: MemoryGenerator.hh:85