OpenASIP  2.0
ProGeUI.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2011 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 ProGeUI.cc
26  *
27  * Implementation of ProGeUI class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @author Esa Määttä 2007 (esa.maatta-no.spam-tut.fi)
31  * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
32  * @author Pekka Jääskeläinen 2011
33  * @author Vinogradov Viacheslav(added Verilog generating) 2012
34  * @note rating: red
35  */
36 
37 #include <fstream>
38 #include <string>
39 #include <vector>
40 #include <cmath>
41 
42 #include "ProGeUI.hh"
43 #include "ProGeTypes.hh"
44 #include "ProcessorGenerator.hh"
45 #include "TestBenchBlock.hh"
46 
47 #include "Machine.hh"
48 #include "ADFSerializer.hh"
49 #include "ControlUnit.hh"
50 #include "SpecialRegisterPort.hh"
51 #include "FUPort.hh"
52 
53 #include "BinaryEncoding.hh"
54 #include "BEMSerializer.hh"
55 #include "BEMGenerator.hh"
56 #include "BEMValidator.hh"
57 
58 #include "MachineImplementation.hh"
59 #include "IDFSerializer.hh"
60 #include "IDFValidator.hh"
61 
63 #include "Environment.hh"
64 #include "FileSystem.hh"
65 
66 #include "ProGeScriptGenerator.hh"
68 
69 #include "MathTools.hh"
70 #include "Netlist.hh"
71 #include "NetlistBlock.hh"
72 #include "PlatformIntegrator.hh"
75 #include "KoskiIntegrator.hh"
76 #include "AvalonIntegrator.hh"
77 #include "AlmaIFIntegrator.hh"
78 
79 #include "ProGeTools.hh"
80 
81 using namespace IDF;
82 using std::string;
83 using std::vector;
84 
85 
86 
87 namespace ProGe {
88 
89 const std::string ProGeUI::DEFAULT_ENTITY_STR = "tta0";
90 
91 /**
92  * The constructor.
93  */
94 ProGeUI::ProGeUI() :
95  machine_(NULL), bem_(NULL), idf_(NULL), plugin_(NULL), pluginFile_(""),
96  entityName_(DEFAULT_ENTITY_STR) {
97 }
98 
99 
100 /**
101  * The destructor.
102  */
104  if (machine_ != NULL) {
105  delete machine_;
106  }
107  if (bem_ != NULL) {
108  delete bem_;
109  }
110  if (idf_ != NULL) {
111  delete idf_;
112  }
113  if (plugin_ != NULL) {
114  delete plugin_;
115  }
116 }
117 
118 
119 /**
120  * Loads machine from the given ADF file.
121  *
122  * @param adfFile The ADF file.
123  * @exception SerializerException If the file cannot be read or is erroneous.
124  * @exception ObjectStateLoadingException If the machine cannot be
125  * constructed.
126  */
127 void
128 ProGeUI::loadMachine(const std::string& adfFile) {
129  ADFSerializer serializer;
130  serializer.setSourceFile(adfFile);
131  machine_ = serializer.readMachine();
132 }
133 
134 /**
135  * Loads the binary encoding from the given BEM file.
136  *
137  * @param bemFile The BEM file.
138  * @exception SerializerException If the file cannot be read or is erroneous.
139  * @exception ObjectStateLoadingException If the object model cannot be
140  * constructed.
141  */
142 void
143 ProGeUI::loadBinaryEncoding(const std::string& bemFile) {
144  BEMSerializer serializer;
145  serializer.setSourceFile(bemFile);
146  bem_ = serializer.readBinaryEncoding();
147 }
148 
149 /**
150  * Loads the machine implementation from the given IDF file.
151  *
152  * @param idfFile The IDF file.
153  * @exception SerializerException If the file cannot be read or is erroneous.
154  * @exception ObjectStateLoadingException If the object model cannot be
155  * constructed.
156  */
157 void
158 ProGeUI::loadMachineImplementation(const std::string& idfFile) {
159  IDFSerializer serializer;
160  serializer.setSourceFile(idfFile);
161  idf_ = serializer.readMachineImplementation();
162 }
163 
164 void
166  machine_ = new TTAMachine::Machine(adf);
167 }
168 
169 void
171  bem_ = new BinaryEncoding(bem.saveState());
172 }
173 
174 void
177 }
178 
179 /**
180  * Loads the given processor configuration.
181  *
182  * @param configurationFile The PCF file.
183  * @exception UnreachableStream If the PCF file cannot be read.
184  * @exception SerializerException If some files defined in PCF cannot be
185  * read or is erroneous.
186  * @exception ObjectStateLoadingException If some of the object models cannot
187  * be constructed.
188  */
189 void
190 ProGeUI::loadProcessorConfiguration(const std::string& configurationFile) {
191  std::ifstream fileStream(configurationFile.c_str());
192  if (!fileStream.good()) {
193  string errorMsg = "Unable to read the PCF from '" +
194  configurationFile + "'.";
195  throw UnreachableStream(__FILE__, __LINE__, __func__, errorMsg);
196  }
197 
198  ProcessorConfigurationFile pcf(fileStream);
199  pcf.setPCFDirectory(FileSystem::directoryOfPath(configurationFile));
200 
201  // load machine
202  try {
203  string adfFile = pcf.architectureName();
204  ADFSerializer serializer;
205  serializer.setSourceFile(adfFile);
206  machine_ = serializer.readMachine();
207  } catch (const KeyNotFound&) {
208  }
209 
210  // load BEM
211  try {
212  string bemFile = pcf.encodingMapName();
213  BEMSerializer serializer;
214  serializer.setSourceFile(bemFile);
215  bem_ = serializer.readBinaryEncoding();
216  } catch (const KeyNotFound&) {
217  }
218 
219  // load IDF
220  try {
221  string idfFile = pcf.implementationName();
222  IDFSerializer serializer;
223  serializer.setSourceFile(idfFile);
224  idf_ = serializer.readMachineImplementation();
225  } catch (const KeyNotFound&) {
226  }
227 }
228 
229 /**
230  * Loads the given IC/decoder generator plugin.
231  *
232  * @param pluginFile The file that implements the plugin.
233  * @param pluginName Name of the plugin.
234  * @exception FileNotFound If the module is not found.
235  * @exception DynamicLibraryException If the module cannot be opened.
236  * @exception InvalidData If the machine or BEM is not loaded yet.
237  */
238 void
240  const std::string& pluginFile, const std::string& pluginName) {
241  pluginFile_ = pluginFile;
242 
243  checkIfNull(machine_, "ADF not loaded");
244  if (bem_ == NULL) {
245  string errorMsg = "BEM not loaded";
246  throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
247  }
248 
249  // initialize the plugin tool
250  vector<string> pluginPaths = Environment::icDecoderPluginPaths();
251  for (vector<string>::const_iterator iter = pluginPaths.begin();
252  iter != pluginPaths.end(); iter++) {
253  try {
254  pluginTool_.addSearchPath(*iter);
255  } catch (const FileNotFound&) {
256  }
257  }
258 
259  try {
260  pluginTool_.registerModule(pluginFile);
261  } catch (const FileNotFound&) {
262  string errorMsg = "Plugin file '" + pluginFile + "' doesn't exist";
263  throw FileNotFound(__FILE__, __LINE__, __func__, errorMsg);
264  }
265 
266  ICDecoderGeneratorPlugin* (*creator)(
269  "create_generator_plugin_" + pluginName, creator, pluginFile);
270  plugin_ = creator(*machine_, *bem_);
271  assert(plugin_ != NULL);
272 }
273 
274 /**
275  * Generates the processor with the loaded data.
276  *
277  * @param imemWidthInMAUs Width of the instruction memory in MAUs.
278  * @param language The language to generate.
279  * @param dstDirectory The destination directory.
280  * @param sharedDstDirectory The destination directory for VHDL files.
281  * @param entityString The string that is used as the top level entity name
282  * and to differentiate the entity and package names in
283  * processor-specific HDL files.
284  * @param errorStream Stream where error messages are written.
285  * @param warningStream Stream where warning messages are written.
286  * @exception InvalidData If ADF or IDF is not loaded.
287  * @exception IOException If an IO exception occurs.
288  * @exception DynamicLibraryException If the default plugin cannot be opened.
289  * @exception InvalidData If HDB or IDF is erroneous or if BEM is not
290  * compatible with the machine.
291  * @exception IllegalMachine If the machine is illegal.
292  * @exception OutOfRange If the given instruction memory width is not
293  * positive.
294  * @exception InstanceNotFound Something missing from HDB.
295  * @exception IllegalParameters IC/Decoder plugin parameter not recognized
296  */
297 void
299  const ProGeOptions& options, int imemWidthInMAUs,
300  std::ostream& errorStream = std::cerr,
301  std::ostream& warningStream = std::cerr,
302  std::ostream& verboseStream = std::cerr) {
303  entityName_ = options.entityName;
304 
305  checkIfNull(machine_, "ADF not loaded");
306 
307  generateIDF(options, verboseStream);
308 
309  if (bem_ == NULL) {
310  BEMGenerator generator(*machine_);
311  bem_ = generator.generate();
312  }
313 
314  // validate IDF against machine
315  IDFValidator idfValidator(*idf_, *machine_);
316  if (!idfValidator.validate()) {
317  string errorMsg = idfValidator.errorMessage(0);
318  throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
319  }
320 
321  // validate BEM against machine
322  BEMValidator bemValidator(*bem_, *machine_);
323  if (!bemValidator.validate()) {
324  string errorMsg("");
325  if (bemValidator.errorCount() > 0) {
326  errorMsg = bemValidator.errorMessage(0);
327  }
328  throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
329  } else if (bemValidator.warningCount() > 0) {
330  for (int i = 0; i < bemValidator.warningCount(); i++) {
331  warningStream << bemValidator.warningMessage(i) << std::endl;
332  }
333  }
334 
335  if (plugin_ == NULL) {
336  if (!idf_->hasICDecoderPluginFile() ||
338  string errorMsg = "IC/decoder generator plugin not defined";
339  throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
340  } else {
343 
344  // set plugin parameters
345  for (unsigned i = 0; i < idf_->icDecoderParameterCount(); i++) {
349  }
351  }
352  }
353  // remove unconnected sockets (if any) before generation
355  *machine_, warningStream);
356 
357  try {
359  options, *machine_, *idf_, *plugin_, imemWidthInMAUs, errorStream,
360  warningStream, verboseStream);
361  } catch (Exception& e) {
362  std::cerr << e.errorMessage() << std::endl;
363  }
364 }
365 
366 /**
367  * Generates a test bench for simulating.
368  *
369  * @param dstDir Destination directory for the test bench.
370  * @param progeOutDir ProGe output directory.
371  *
372  * @exception InvalidData If Machine or implementation not loaded.
373  */
374 void
376  const ProGe::HDL language,
377  const std::string& dstDir,
378  const std::string& progeOutDir) {
379 
380  checkIfNull(machine_, "ADF not loaded");
381  checkIfNull(idf_, "IDF not loaded");
382 
383  if (language == Verilog) {
384  // Note: deprecated legacy test bench. Still used since the new test
385  // bench does not yet support generation for verilog.
387  tbGen.generate(
388  language, *machine_, *idf_, dstDir, progeOutDir, entityName_);
389  } else {
390  // New test bench generation to be replacing the old one. WIP and
391  // first used to generate test benches for TTA processors.
392  try {
393  TestBenchBlock coreTestbench(
396  coreTestbench.write(Path(progeOutDir), language);
397  } catch (Exception& e) {
398  // There is one case the new test bench can not handle: same data
399  // address spaces shared by two LSUs.
401  tbGen.generate(
402  language, *machine_, *idf_, dstDir, progeOutDir, entityName_);
403  }
404  }
405 }
406 
407 /**
408  * Generates vhdl compilation and simulation scripts.
409  *
410  * @param dstDir Destination directory for the scripts.
411  * @param progeOutDir ProGe output directory.
412  * @param progeOutDir Shared HDL output directory.
413  * @param testBenchDir Directory where a test bench is stored.
414  */
415 void
417  const ProGe::HDL language, const std::string& dstDir,
418  const std::string& progeOutDir, const std::string& sharedOutDir,
419  const std::string& testBenchDir, const std::string& simulationRuntime) {
421  language, *idf_, dstDir, progeOutDir, sharedOutDir, testBenchDir,
422  entityName_, simulationRuntime);
423  sGen.generateAll();
424 }
425 
426 /**
427  * Checks if given pointer is NULL.
428  *
429  * Throws a InvalidData exception if given pointer is NULL and sets given
430  * error message as exceptions error message.
431  *
432  * @param nullPointer Some pointer.
433  * @param errorMsg Error message for the InvalidData exception.
434  */
435 void
436 ProGeUI::checkIfNull(void* nullPointer, const std::string& errorMsg) {
437  if (nullPointer == NULL) {
438  throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
439  }
440 }
441 
442 void
444  std::ostream& warningStream, std::ostream& errorStream,
445  std::string progeOutDir, std::string sharedOutputDir,
446  const std::string& platformIntegrator, const std::string& coreEntityName,
447  const std::string& programName, const std::string& deviceFamily,
448  const std::string& deviceName, MemType imem, MemType dmem, HDL language,
449  int fmax, bool syncReset) {
450  string platformDir = progeOutDir + FileSystem::DIRECTORY_SEPARATOR +
451  "platform";
452 
453  MemInfo imemInfo;
454  imemInfo.type = imem;
455  readImemParameters(imemInfo);
456 
457  PlatformIntegrator* integrator = NULL;
458  // TODO: append new integrators here
459  if (platformIntegrator == "Stratix2DSP") {
460  integrator = new Stratix2DSPBoardIntegrator(
461  machine_, idf_, language, progeOutDir, coreEntityName,
462  platformDir, programName, fmax, warningStream, errorStream,
463  imemInfo, dmem);
464  } else if (platformIntegrator == "KoskiIntegrator") {
465  integrator = new KoskiIntegrator(
466  machine_, idf_, language, progeOutDir, coreEntityName,
467  platformDir, programName, fmax, warningStream, errorStream,
468  imemInfo, dmem);
469  } else if (platformIntegrator == "AvalonIntegrator") {
470  integrator = new AvalonIntegrator(
471  machine_, idf_, language, progeOutDir, coreEntityName,
472  platformDir, programName, fmax, warningStream, errorStream,
473  imemInfo, dmem);
474  } else if (platformIntegrator == "Stratix3DevKit") {
475  integrator = new Stratix3DevKitIntegrator(
476  machine_, idf_, language, progeOutDir, coreEntityName,
477  platformDir, programName, fmax, warningStream, errorStream,
478  imemInfo, dmem);
479  } else if (platformIntegrator == "AlmaIFIntegrator") {
480  integrator = new AlmaIFIntegrator(
481  machine_, idf_, language, progeOutDir, coreEntityName,
482  platformDir, programName, fmax, warningStream, errorStream,
483  imemInfo, dmem, syncReset);
484  } else {
485  string errorMsg = "Unknown platform integrator: "
486  + platformIntegrator;
487  InvalidData exc(__FILE__, __LINE__, __func__, errorMsg);
488  throw exc;
489  }
490  if (!deviceFamily.empty()) {
491  integrator->setDeviceFamily(deviceFamily);
492  }
493  if (!deviceName.empty()) {
494  integrator->setDeviceName(deviceName);
495  }
496 
497  if (FileSystem::absolutePathOf(sharedOutputDir) !=
498  FileSystem::absolutePathOf(progeOutDir)) {
499  integrator->setSharedOutputDir(sharedOutputDir);
500  }
501 
502  const NetlistBlock& ttaToplevel = generator_.processorTopLevel();
503 
504  try {
505  integrator->integrateProcessor(&ttaToplevel);
506  } catch (Exception& e) {
507  delete integrator;
508  throw e;
509  }
510  delete integrator;
511 }
512 
513 void
515  imem.mauWidth = bem_->width();
516  // imem width in MAUs is fixed to 1 in ProGe
517  imem.widthInMaus = 1;
518  imem.asName = machine_->controlUnit()->addressSpace()->name();
520 
521  int lastAddr = machine_->controlUnit()->addressSpace()->end();
522  imem.asAddrw = MathTools::requiredBits(lastAddr);
524 }
525 
526 void
528  const ProGeOptions& options, std::ostream& verboseStream) {
529  std::ostream nullstream(0);
530  std::ostream& verbose =
531  Application::increasedVerbose() ? verboseStream : nullstream;
532 
533  if (!idf_) {
534  verbose << "IDF not set, trying automated generation.\n";
536  }
537 
538  std::vector<std::string> handledFUs;
539 
540  // Prefill the handledFUs with values from the .idf-file
541  for (auto&& fu : machine_->functionUnitNavigator()) {
542  if (idf_->hasFUImplementation(fu->name()) ||
543  idf_->hasFUGeneration(fu->name())) {
544  handledFUs.emplace_back(fu->name());
545  }
546  }
547 
548  std::vector<IDF::FUGenerated::Info> infos =
550  //! Checking only operations that ADF has instead of them all
551  // would be faster.
552  std::vector<IDF::FUGenerated::DAGOperation> dagops =
554 
555  auto already_handled = [&](const std::string& name) {
556  return std::find(handledFUs.begin(), handledFUs.end(), name) !=
557  handledFUs.end();
558  };
559 
560  auto select_hdb_implementations = [&]() {
561  for (auto&& fu : machine_->functionUnitNavigator()) {
562  if (already_handled(fu->name())) {
563  continue;
564  }
565  verbose << " select implementation for " << fu->name() << "... ";
567  new IUImplementationLocation("", -1, fu->name());
569  options, *fu, *loc, verbose)) {
570  verbose << "OK (selected " << loc->id() << " from "
571  << loc->hdbFile() << ")\n";
573  handledFUs.emplace_back(fu->name());
574  } else {
575  verbose << "FAIL\n";
576  }
577  }
578  };
579 
580  auto generate_implementations = [&]() {
581  for (auto&& fu : machine_->functionUnitNavigator()) {
582  if (already_handled(fu->name())) {
583  continue;
584  }
585  verbose << " generate implementation for " << fu->name()
586  << "... ";
587  IDF::FUGenerated fug(fu->name());
589  options, *fu, fug, infos, dagops)) {
590  verbose << "OK\n";
591  idf_->addFuGeneration(fug);
592  handledFUs.emplace_back(fug.name());
593  } else {
594  verbose << "FAIL\n";
595  }
596  }
597  };
598 
599  // Create or select FUs.
600  if (options.preferHDLGeneration) {
601  generate_implementations();
602  select_hdb_implementations();
603  } else {
604  select_hdb_implementations();
605  generate_implementations();
606  }
607 
608  // IUs.
609  for (auto&& iu : machine_->immediateUnitNavigator()) {
610  if (idf_->hasIUImplementation(iu->name())) {
611  continue;
612  }
613  verbose << " select implementation for " << iu->name() << "... ";
615  new IUImplementationLocation("", -1, iu->name());
616  if (ProGeTools::checkForSelectableIU(options, *iu, *loc, verbose)) {
617  verbose << "OK (selected " << loc->id() << " from "
618  << loc->hdbFile() << ")\n";
620  } else {
621  verbose << "FAIL\n";
622  }
623  }
624 
625  // RFs.
626  for (auto&& rf : machine_->registerFileNavigator()) {
627  if (idf_->hasRFImplementation(rf->name())) {
628  continue;
629  }
630  verbose << " select implementation for " << rf->name() << "... ";
632  new RFImplementationLocation("", -1, rf->name());
633  if (ProGeTools::checkForSelectableRF(options, *rf, *loc, verbose)) {
634  verbose << "OK (selected " << loc->id() << " from "
635  << loc->hdbFile() << ")\n";
637  } else {
638  verbose << "FAIL\n";
639  }
640  }
641 
642  // IC/Decoder plugin.
643  if (!idf_->hasICDecoderPluginFile()) {
644  idf_->setICDecoderPluginName("DefaultICDecoder");
645  idf_->setICDecoderPluginFile("DefaultICDecoderPlugin.so");
646  }
647  // Set parameters based on argList given in command line.
648  // Overrides the matching .idf-file params with the command line params.
649  for (auto&& kvp : options.icdArgList) {
650  idf_->setICDecoderParameter(kvp.first, kvp.second);
651  }
652 
653  // If ICDecoder parameters are not given, give some defaults based
654  // on the GCU's latency.
655  if (idf_->icDecoderParameterCount() == 0) {
656  int delaySlots = machine_->controlUnit()->delaySlots();
657  if (delaySlots == 3) {
658  // Happy old slow default machine.
659  } else if (delaySlots == 2) {
660  idf_->setICDecoderParameter("bypassinstructionregister", "yes");
661  } else {
662  throw std::runtime_error(
663  "Cannot decide ICDecoder parameters for " +
664  std::to_string(delaySlots) + "-stage GCU.");
665  }
666  }
667 }
668 
669 } // end of namespace ProGe
670 
IDF::UnitImplementationLocation
Definition: UnitImplementationLocation.hh:48
Netlist.hh
Path
Definition: FileSystem.hh:197
ProGeTools::createFUGeneratableOperationInfos
std::vector< IDF::FUGenerated::Info > createFUGeneratableOperationInfos(const ProGeOptions &options, std::ostream &verbose)
Definition: ProGeTools.cc:306
IDF::RFImplementationLocation
UnitImplementationLocation RFImplementationLocation
Definition: ComponentImplementationSelector.hh:57
BinaryEncoding
Definition: BinaryEncoding.hh:61
IDF::MachineImplementation::hasRFImplementation
bool hasRFImplementation(const std::string &unitName) const
Definition: MachineImplementation.cc:245
BEMGenerator.hh
AvalonIntegrator
Definition: AvalonIntegrator.hh:39
FileSystem.hh
IDF::MachineImplementation::hasICDecoderPluginFile
bool hasICDecoderPluginFile() const
Definition: MachineImplementation.cc:168
FileNotFound
Definition: Exception.hh:224
ProGeTestBenchGenerator
Definition: ProGeTestBenchGenerator.hh:54
ProGe::ProGeUI::integrateProcessor
void integrateProcessor(std::ostream &warningStream, std::ostream &errorStream, std::string progeOutDir, std::string sharedOutputDir, const std::string &platformIntegrator, const std::string &coreEntityName, const std::string &programName, const std::string &deviceFamily, const std::string &deviceName, MemType imem, MemType dmem, HDL language, int fmax, bool syncReset)
Definition: ProGeUI.cc:443
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
ProGe::Verilog
@ Verilog
Verilog.
Definition: ProGeTypes.hh:42
XMLSerializer::setSourceFile
void setSourceFile(const std::string &fileName)
Definition: XMLSerializer.cc:115
UnreachableStream
Definition: Exception.hh:171
PlatformIntegrator::setDeviceFamily
virtual void setDeviceFamily(TCEString devFamily)=0
PlatformIntegrator::integrateProcessor
virtual void integrateProcessor(const ProGe::NetlistBlock *progeBlock)=0
ProcessorConfigurationFile
Definition: ProcessorConfigurationFile.hh:46
ProGe::TestBenchBlock::write
virtual void write(const Path &targetBaseDir, HDL targetLang=VHDL) const override
Definition: TestBenchBlock.cc:103
BEMValidator::validate
bool validate()
Definition: BEMValidator.cc:95
MemInfo
Definition: MemoryGenerator.hh:67
IDF::IDFSerializer::readMachineImplementation
MachineImplementation * readMachineImplementation()
Definition: IDFSerializer.cc:148
ProGe::ProGeUI::entityName_
std::string entityName_
Name of the toplevel entity.
Definition: ProGeUI.hh:137
BEMValidator.hh
ProGe::ICDecoderGeneratorPlugin
Definition: ICDecoderGeneratorPlugin.hh:68
ProGeOptions
Definition: ProGeOptions.hh:41
ProGe::ProcessorGenerator::processorTopLevel
const NetlistBlock & processorTopLevel() const
Definition: ProcessorGenerator.cc:510
ProGe::ProGeUI::loadProcessorConfiguration
void loadProcessorConfiguration(const std::string &configurationFile)
Definition: ProGeUI.cc:190
ProcessorConfigurationFile::architectureName
std::string architectureName()
Definition: ProcessorConfigurationFile.cc:107
ProGe::ProGeUI::generator_
ProcessorGenerator generator_
Definition: ProGeUI.hh:139
KoskiIntegrator
Definition: KoskiIntegrator.hh:40
ProGe::ProGeUI::~ProGeUI
virtual ~ProGeUI()
Definition: ProGeUI.cc:103
ProGe::ProGeUI::pluginFile_
std::string pluginFile_
The plugin file.
Definition: ProGeUI.hh:135
Environment::icDecoderPluginPaths
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
Definition: Environment.cc:635
Stratix3DevKitIntegrator
Definition: Stratix3DevKitIntegrator.hh:44
TTAMachine::FunctionUnit::addressSpace
virtual AddressSpace * addressSpace() const
Definition: FunctionUnit.cc:580
PlatformIntegrator::setDeviceName
void setDeviceName(TCEString devName)
Definition: PlatformIntegrator.hh:113
BEMValidator::warningCount
int warningCount() const
Definition: BEMValidator.cc:173
BEMSerializer
Definition: BEMSerializer.hh:43
FileSystem::absolutePathOf
static std::string absolutePathOf(const std::string &pathName)
Definition: FileSystem.cc:303
ProGeTools::checkForGeneratableFU
bool checkForGeneratableFU(const ProGeOptions &options, TTAMachine::FunctionUnit &fu, IDF::FUGenerated &fug, const std::vector< IDF::FUGenerated::Info > &infos, const std::vector< IDF::FUGenerated::DAGOperation > dagops)
Definition: ProGeTools.cc:59
IDF::MachineImplementation::hasFUImplementation
bool hasFUImplementation(const std::string &unitName) const
Definition: MachineImplementation.cc:231
ProGeTools::checkForSelectableFU
bool checkForSelectableFU(const ProGeOptions &options, TTAMachine::FunctionUnit &fu, IDF::FUImplementationLocation &loc, std::ostream &verbose)
Definition: ProGeTools.cc:352
IDFValidator::errorMessage
std::string errorMessage(int index) const
Definition: IDFValidator.cc:94
IDFValidator.hh
IDF::MachineImplementation::hasIUImplementation
bool hasIUImplementation(const std::string &unitName) const
Definition: MachineImplementation.cc:259
BEMGenerator
Definition: BEMGenerator.hh:61
TTAMachine::AddressSpace::isShared
virtual bool isShared() const
Definition: AddressSpace.hh:72
Stratix2DSPBoardIntegrator.hh
TestBenchBlock.hh
IDF::MachineImplementation::hasFUGeneration
bool hasFUGeneration(const std::string &name) const
Definition: MachineImplementation.cc:1590
assert
#define assert(condition)
Definition: Application.hh:86
IDF::MachineImplementation::icDecoderParameterValue
std::string icDecoderParameterValue(const std::string &name) const
Definition: MachineImplementation.cc:1415
AlmaIFIntegrator.hh
IDF::MachineImplementation::saveState
virtual ObjectState * saveState() const
Definition: MachineImplementation.cc:862
Application::increasedVerbose
static bool increasedVerbose()
Definition: Application.hh:179
IDF::MachineImplementation::icDecoderParameterCount
unsigned icDecoderParameterCount() const
Definition: MachineImplementation.cc:1371
ProGe::ProGeUI::plugin_
ICDecoderGeneratorPlugin * plugin_
The loaded IC/decoder generator plugin.
Definition: ProGeUI.hh:133
ProGe::ProGeUI::generateTestBench
void generateTestBench(const ProGe::HDL language, const std::string &dstDir, const std::string &progeOutDir)
Definition: ProGeUI.cc:375
ProGeTestBenchGenerator::generate
void generate(const ProGe::HDL language, const TTAMachine::Machine &mach, const IDF::MachineImplementation &implementation, const std::string &dstDirectory, const std::string &progeOutDir, const std::string &entityStr="tta0")
Definition: ProGeTestBenchGenerator.cc:119
TTAMachine::Machine::controlUnit
virtual ControlUnit * controlUnit() const
Definition: Machine.cc:345
IDF::MachineImplementation::icDecoderParameterName
std::string icDecoderParameterName(unsigned param) const
Definition: MachineImplementation.cc:1382
ProcessorConfigurationFile::setPCFDirectory
void setPCFDirectory(const std::string &path)
Definition: ProcessorConfigurationFile.cc:95
MemInfo::type
MemType type
Definition: MemoryGenerator.hh:68
BinaryEncoding::saveState
virtual ObjectState * saveState() const
Definition: BinaryEncoding.cc:858
InvalidData
Definition: Exception.hh:149
ProGe::ProGeUI::loadICDecoderGeneratorPlugin
void loadICDecoderGeneratorPlugin(const std::string &pluginFile, const std::string &pluginName)
Definition: ProGeUI.cc:239
PluginTools::importSymbol
void importSymbol(const std::string &symbolName, T *&target, const std::string &module)
ProcessorConfigurationFile::implementationName
std::string implementationName()
Definition: ProcessorConfigurationFile.cc:140
IDF::FUGenerated
Definition: FUGenerated.hh:41
TTAMachine::Machine::immediateUnitNavigator
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition: Machine.cc:416
KoskiIntegrator.hh
MemInfo::asAddrw
int asAddrw
Definition: MemoryGenerator.hh:72
IDF::MachineImplementation::setICDecoderPluginName
void setICDecoderPluginName(const std::string &name)
Definition: MachineImplementation.cc:1462
ProGeScriptGenerator
Definition: ProGeScriptGenerator.hh:52
MemInfo::asName
TCEString asName
Definition: MemoryGenerator.hh:74
ProGeTools.hh
BinaryEncoding.hh
ProGeTools::checkForSelectableRF
bool checkForSelectableRF(const ProGeOptions &options, TTAMachine::RegisterFile &rf, IDF::RFImplementationLocation &loc, std::ostream &verbose)
Definition: ProGeTools.cc:422
IDF::MachineImplementation::addFuGeneration
void addFuGeneration(const FUGenerated &fug)
Definition: MachineImplementation.cc:1619
ADFSerializer
Definition: ADFSerializer.hh:49
BinaryEncoding::width
virtual int width(const TCEString &templateName) const
Definition: BinaryEncoding.cc:768
Stratix2DSPBoardIntegrator
Definition: Stratix2DSPBoardIntegrator.hh:52
IDFValidator
Definition: IDFValidator.hh:52
__func__
#define __func__
Definition: Application.hh:67
FileSystem::directoryOfPath
static std::string directoryOfPath(const std::string fileName)
Definition: FileSystem.cc:79
PluginTools::registerModule
void registerModule(const std::string &module)
Definition: PluginTools.cc:138
ProGe::ICDecoderGeneratorPlugin::setParameter
void setParameter(const std::string &name, const std::string &value)
Definition: ICDecoderGeneratorPlugin.cc:140
TTAMachine::Machine::functionUnitNavigator
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition: Machine.cc:380
NetlistBlock.hh
Environment.hh
ProGe::ProGeUI::generateScripts
void generateScripts(const ProGe::HDL language, const std::string &dstDir, const std::string &progeOutDir, const std::string &sharedOutDir, const std::string &testBenchDir, const std::string &simulationRuntime)
Definition: ProGeUI.cc:416
MathTools::requiredBits
static int requiredBits(unsigned long int number)
ProcessorGenerator.hh
ProGeTools::generateableDAGOperations
std::vector< IDF::FUGenerated::DAGOperation > generateableDAGOperations(const std::vector< IDF::FUGenerated::Info > infos, std::ostream &verbose)
Definition: ProGeTools.cc:142
AlmaIFIntegrator
Definition: AlmaIFIntegrator.hh:40
ProGe::ICDecoderGeneratorPlugin::readParameters
virtual void readParameters()=0
IDF::MachineImplementation::addRFImplementation
void addRFImplementation(RFImplementationLocation *implementation)
Definition: MachineImplementation.cc:554
IDFValidator::validate
bool validate()
Definition: IDFValidator.cc:66
TTAMachine::ControlUnit::delaySlots
int delaySlots() const
Machine.hh
Exception
Definition: Exception.hh:54
ProGe::ProGeUI::machine_
TTAMachine::Machine * machine_
The loaded machine.
Definition: ProGeUI.hh:114
ProGeTypes.hh
MemInfo::widthInMaus
int widthInMaus
Definition: MemoryGenerator.hh:70
ProGe::ProGeUI::readImemParameters
void readImemParameters(MemInfo &imem) const
Definition: ProGeUI.cc:514
MemInfo::mauWidth
int mauWidth
Definition: MemoryGenerator.hh:69
ProGeScriptGenerator::generateAll
void generateAll()
Definition: ProGeScriptGenerator.cc:136
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
ProGeTools::checkForSelectableIU
bool checkForSelectableIU(const ProGeOptions &options, TTAMachine::ImmediateUnit &iu, IDF::IUImplementationLocation &loc, std::ostream &verbose)
Definition: ProGeTools.cc:500
FileSystem::DIRECTORY_SEPARATOR
static const std::string DIRECTORY_SEPARATOR
Definition: FileSystem.hh:189
ProGe::ProcessorGenerator::removeUnconnectedSockets
static void removeUnconnectedSockets(TTAMachine::Machine &machine, std::ostream &warningStream)
Definition: ProcessorGenerator.cc:529
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
MemInfo::isShared
bool isShared
Definition: MemoryGenerator.hh:73
MemType
MemType
Definition: MemoryGenerator.hh:57
ProGe::ProGeUI::idf_
IDF::MachineImplementation * idf_
The loaded machine implementation.
Definition: ProGeUI.hh:129
IDF::MachineImplementation::setICDecoderParameter
void setICDecoderParameter(const std::string &name, const std::string &value)
Definition: MachineImplementation.cc:1437
TTAMachine::Machine::registerFileNavigator
virtual RegisterFileNavigator registerFileNavigator() const
Definition: Machine.cc:450
ProGe::ProGeUI::loadBinaryEncoding
void loadBinaryEncoding(const BinaryEncoding &bem)
Definition: ProGeUI.cc:170
IDF::MachineImplementation::icDecoderPluginFile
std::string icDecoderPluginFile() const
Definition: MachineImplementation.cc:153
ADFSerializer.hh
ProGe::ProGeUI::loadMachineImplementation
void loadMachineImplementation(const IDF::MachineImplementation &idf)
Definition: ProGeUI.cc:175
ProGe::ProcessorGenerator::generatorContext
const ProGeContext & generatorContext() const
Definition: ProcessorGenerator.cc:519
BEMValidator::errorCount
int errorCount() const
Definition: BEMValidator.cc:145
AvalonIntegrator.hh
IDF::UnitImplementationLocation::id
virtual int id() const
Definition: UnitImplementationLocation.cc:127
IDF::MachineImplementation::addFUImplementation
void addFUImplementation(FUImplementationLocation *implementation)
Definition: MachineImplementation.cc:533
ProGe
Definition: FUGen.hh:54
PluginTools::addSearchPath
void addSearchPath(const std::string &searchPath)
Definition: PluginTools.cc:95
IDF::IUImplementationLocation
UnitImplementationLocation IUImplementationLocation
Definition: ComponentImplementationSelector.hh:58
ProGe::ProGeUI::bem_
BinaryEncoding * bem_
The loaded binary encoding map.
Definition: ProGeUI.hh:127
BEMValidator::errorMessage
std::string errorMessage(int index) const
Definition: BEMValidator.cc:159
ProGeScriptGenerator.hh
FUPort.hh
ControlUnit.hh
ProGe::ProGeUI::loadMachine
void loadMachine(const TTAMachine::Machine &adf)
Definition: ProGeUI.cc:165
PlatformIntegrator.hh
SpecialRegisterPort.hh
Stratix3DevKitIntegrator.hh
ProGe::HDL
HDL
HDLs supported by ProGe.
Definition: ProGeTypes.hh:40
ADFSerializer::readMachine
TTAMachine::Machine * readMachine()
Definition: ADFSerializer.cc:275
ProGeUI.hh
PlatformIntegrator
Definition: PlatformIntegrator.hh:65
ProcessorConfigurationFile.hh
KeyNotFound
Definition: Exception.hh:285
IDF::UnitImplementationLocation::hdbFile
virtual std::string hdbFile() const
Definition: UnitImplementationLocation.cc:99
BEMValidator
Definition: BEMValidator.hh:57
IDF::MachineImplementation::hasICDecoderPluginName
bool hasICDecoderPluginName() const
Definition: MachineImplementation.cc:142
MathTools.hh
BEMSerializer.hh
ProGe::TestBenchBlock
Definition: TestBenchBlock.hh:50
ProGe::ProcessorGenerator::generateProcessor
void generateProcessor(const ProGeOptions &options, const TTAMachine::Machine &machine, const IDF::MachineImplementation &implementation, ICDecoderGeneratorPlugin &plugin, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream)
Definition: ProcessorGenerator.cc:130
IDF::MachineImplementation::setICDecoderPluginFile
void setICDecoderPluginFile(const std::string &file)
Definition: MachineImplementation.cc:1474
ProGeTestBenchGenerator.hh
TTAMachine::ControlUnit::returnAddressPort
SpecialRegisterPort * returnAddressPort() const
Definition: ControlUnit.cc:307
IDF::FUGenerated::name
std::string name() const
Definition: FUGenerated.cc:103
IDF::IDFSerializer
Definition: IDFSerializer.hh:45
MemInfo::portAddrw
int portAddrw
Definition: MemoryGenerator.hh:71
IDF::MachineImplementation::icDecoderPluginName
std::string icDecoderPluginName() const
Definition: MachineImplementation.cc:132
TTAMachine::AddressSpace::end
virtual ULongWord end() const
Definition: AddressSpace.cc:177
ProGe::ProGeUI::pluginTool_
PluginTools pluginTool_
Tool for loading plugin.
Definition: ProGeUI.hh:131
BEMGenerator::generate
BinaryEncoding * generate()
Definition: BEMGenerator.cc:104
ProGe::ProGeUI::generateProcessor
void generateProcessor(const ProGeOptions &options, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream)
Definition: ProGeUI.cc:298
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
IDF
Definition: DSDBManager.hh:54
MachineImplementation.hh
IDF::MachineImplementation::addIUImplementation
void addIUImplementation(RFImplementationLocation *implementation)
Definition: MachineImplementation.cc:575
TTAMachine::BaseFUPort::width
virtual int width() const
Definition: BaseFUPort.cc:109
BEMValidator::warningMessage
std::string warningMessage(int index) const
Definition: BEMValidator.cc:186
ProGe::ProGeUI::generateIDF
void generateIDF(const ProGeOptions &options, std::ostream &verboseStream)
Definition: ProGeUI.cc:527
TTAMachine::Machine
Definition: Machine.hh:73
ProGe::ProGeUI::checkIfNull
void checkIfNull(void *nullPointer, const std::string &errorMsg)
Definition: ProGeUI.cc:436
BEMSerializer::readBinaryEncoding
BinaryEncoding * readBinaryEncoding()
Definition: BEMSerializer.cc:258
ProcessorConfigurationFile::encodingMapName
std::string encodingMapName()
Definition: ProcessorConfigurationFile.cc:173
IDFSerializer.hh