OpenASIP  2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ProGe::ProcessorGenerator Class Reference

#include <ProcessorGenerator.hh>

Collaboration diagram for ProGe::ProcessorGenerator:
Collaboration graph

Public Member Functions

 ProcessorGenerator ()
 
virtual ~ProcessorGenerator ()
 
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)
 
const NetlistBlockprocessorTopLevel () const
 
const ProGeContextgeneratorContext () const
 
TCEString entityName () const
 

Static Public Member Functions

static int iMemAddressWidth (const TTAMachine::Machine &mach)
 
static int iMemWidth (const TTAMachine::Machine &mach, int imemWidthInMAUs)
 
static void removeUnconnectedSockets (TTAMachine::Machine &machine, std::ostream &warningStream)
 

Private Member Functions

void validateMachine (const TTAMachine::Machine &machine, std::ostream &errorStream, std::ostream &warningStream)
 
void checkIULatencies (const TTAMachine::Machine &machine, const IDF::MachineImplementation &implementation, const ICDecoderGeneratorPlugin &plugin)
 
void generateGlobalsPackage (HDL language, const TTAMachine::Machine &machine, int imemWidthInMAUs, const std::string &dstDirectory, ICDecoderGeneratorPlugin &plugin)
 
void generateGCUOpcodesPackage (HDL language, const TTAMachine::Machine &machine, const std::string &dstDirectory)
 

Static Private Member Functions

static std::string coreIdString (int i)
 
static const NetlistPortGroupinstructionBus (NetlistBlock &block)
 

Private Attributes

NetlistBlockcoreTopBlock_
 
TCEString entityStr_
 
ProGeContextgeneratorContext_
 

Static Private Attributes

static const TCEString DEFAULT_ENTITY_STR = "tta0"
 

Detailed Description

Controller class of ProGe.

Acts as a middle-man between user interface, netlist generator, IC/decoder plugin and HDL writers.

Definition at line 74 of file ProcessorGenerator.hh.

Constructor & Destructor Documentation

◆ ProcessorGenerator()

ProGe::ProcessorGenerator::ProcessorGenerator ( )

The constructor.

Definition at line 114 of file ProcessorGenerator.cc.

114 : coreTopBlock_(NULL) {}

◆ ~ProcessorGenerator()

ProGe::ProcessorGenerator::~ProcessorGenerator ( )
virtual

The destructor.

Definition at line 119 of file ProcessorGenerator.cc.

119  {
120  delete coreTopBlock_;
121  coreTopBlock_ = NULL;
122 }

References coreTopBlock_.

Member Function Documentation

◆ checkIULatencies()

void ProGe::ProcessorGenerator::checkIULatencies ( const TTAMachine::Machine machine,
const IDF::MachineImplementation implementation,
const ICDecoderGeneratorPlugin plugin 
)
private

Checks that the latencies of the HW implementations of the immediate units are compatible with the given IC/GCU generator plugin.

Parameters
machineThe machine.
implementationThe machine implementation.
pluginThe plugin.
Exceptions
InvalidDataIf the latencies are incompatible.

Definition at line 390 of file ProcessorGenerator.cc.

393  {
395  for (int i = 0; i < iuNav.count(); i++) {
396  ImmediateUnit* iu = iuNav.item(i);
399 
400  RFEntry* entry = NULL;
401  try {
402  HDBManager& manager = HDBRegistry::instance().hdb(impl.hdbFile());
403  entry = manager.rfByEntryID(impl.id());
404  } catch (const KeyNotFound& e) {
405  throw InvalidData(__FILE__, __LINE__, __func__, e.errorMessage());
406  }
407 
408  if (!entry->hasArchitecture()) {
409  delete entry;
410  format text(
411  "RF entry %1% does not have architecture defined in HDB "
412  "%2%.");
413  text % impl.id() % impl.hdbFile();
414  throw InvalidData(__FILE__, __LINE__, __func__, text.str());
415  }
416 
417  RFArchitecture& architecture = entry->architecture();
418  int implLatency = architecture.latency();
419  std::set<int> requiredLatencies = plugin.requiredRFLatencies(*iu);
420  delete entry;
421 
422  if (requiredLatencies.count(implLatency) == 0) {
423  format errorMsg(
424  "Latency of the implementation of immediate "
425  "unit %1% is %2%,"
426  " acceptable latencies are %3%.");
427  errorMsg % iu->name() % implLatency %
428  TCEString::makeString(requiredLatencies);
429  throw InvalidData(__FILE__, __LINE__, __func__, errorMsg.str());
430  }
431  }
432 }

References __func__, HDB::RFEntry::architecture(), TTAMachine::Machine::Navigator< ComponentType >::count(), Exception::errorMessage(), HDB::RFEntry::hasArchitecture(), IDF::UnitImplementationLocation::hdbFile(), IDF::UnitImplementationLocation::id(), TTAMachine::Machine::immediateUnitNavigator(), implementation, TTAMachine::Machine::Navigator< ComponentType >::item(), IDF::MachineImplementation::iuImplementation(), HDB::RFArchitecture::latency(), machine, TCEString::makeString(), TTAMachine::Component::name(), ProGe::ICDecoderGeneratorPlugin::requiredRFLatencies(), and HDB::HDBManager::rfByEntryID().

Referenced by generateProcessor().

Here is the call graph for this function:

◆ coreIdString()

static std::string ProGe::ProcessorGenerator::coreIdString ( int  i)
staticprivate

◆ entityName()

TCEString ProGe::ProcessorGenerator::entityName ( ) const

Definition at line 524 of file ProcessorGenerator.cc.

524  {
525  return entityStr_;
526 }

References entityStr_.

Referenced by generateGlobalsPackage().

◆ generateGCUOpcodesPackage()

void ProGe::ProcessorGenerator::generateGCUOpcodesPackage ( HDL  language,
const TTAMachine::Machine machine,
const std::string &  dstDirectory 
)
private

Generates the package that defines opcodes of Global Control Unit.

Parameters
languageThe language of the hardware code, VHDL/Verilog
machineThe machine.
dstDirectoryThe destination directory.

Definition at line 306 of file ProcessorGenerator.cc.

308  {
309  string dstFile = dstDirectory + FileSystem::DIRECTORY_SEPARATOR +
310  "gcu_opcodes_pkg." +
311  ((language == ProGe::VHDL) ? "vhdl" : "vh");
312  std::ofstream stream(dstFile.c_str(), std::ofstream::out);
313  CUOpcodeGenerator gcuOpcodeGen(machine, entityStr_);
314  gcuOpcodeGen.generateOpcodePackage(language, stream);
315  stream.close();
316 }

References FileSystem::DIRECTORY_SEPARATOR, entityStr_, ProGe::CUOpcodeGenerator::generateOpcodePackage(), machine, and ProGe::VHDL.

Referenced by generateProcessor().

Here is the call graph for this function:

◆ generateGlobalsPackage()

void ProGe::ProcessorGenerator::generateGlobalsPackage ( HDL  language,
const TTAMachine::Machine machine,
int  imemWidthInMAUs,
const std::string &  dstDirectory,
ICDecoderGeneratorPlugin plugin 
)
private

Generates the package that defines global constants used in processor definition files.

Parameters
languageThe language of the hardware code, VHDL/Verilog
machineThe machine.
imemWidthInMAUsWidth of the instruction memory in MAUs.
dstDirectoryThe destination directory.
pluginThe ICDecoderGeneratorPlugin, which gives us bem and bit info
Exceptions
IOExceptionIf an IO error occurs.

Definition at line 230 of file ProcessorGenerator.cc.

232  {
233  string dstFile = dstDirectory + FileSystem::DIRECTORY_SEPARATOR +
234  entityName() + "_globals_pkg." +
235  ((language == ProGe::VHDL) ? "vhdl" : "vh");
236 
237  bool created = FileSystem::createFile(dstFile);
238  if (!created) {
239  string errorMsg = "Unable to create file " + dstFile;
240  throw IOException(__FILE__, __LINE__, __func__, errorMsg);
241  }
242  std::ofstream stream(dstFile.c_str(), std::ofstream::out);
243 
244  if (language == ProGe::VHDL) {
245  int bustrace_width = 0;
246  for (int i = 0; i < machine.busNavigator().count(); ++i) {
247  int bus_width = machine.busNavigator().item(i)->width();
248  // Busess are padded to a multiple of 32 bits
249  bus_width = (bus_width + 31) / 32 * 32;
250  bustrace_width += bus_width;
251  }
252 
253  stream << "library work;" << endl
254  << "use work." << entityStr_ << "_imem_mau.all;" << endl
255  << endl;
256 
257  stream << "package " << entityStr_ << "_globals is" << endl
258  << " -- address width of the instruction memory" << endl
259  << " constant IMEMADDRWIDTH : positive := "
260  << iMemAddressWidth(machine) << ";" << endl
261  << " -- width of the instruction memory in MAUs" << endl
262  << " constant IMEMWIDTHINMAUS : positive := "
263  << imemWidthInMAUs << ";" << endl
264  << " -- width of instruction fetch block." << endl
265  << " constant IMEMDATAWIDTH : positive := "
266  << "IMEMWIDTHINMAUS*IMEMMAUWIDTH;" << endl
267  << " -- clock period" << endl
268  << " constant PERIOD : time := 10 ns;" << endl
269  << " -- number of busses." << endl
270  << " constant BUSTRACE_WIDTH : positive := " << bustrace_width
271  << ";" << endl;
272 
273  // Insert plugin specific global package constants
274  plugin.writeGlobalDefinitions(ProGe::VHDL, stream);
275 
276  stream << "end " << entityStr_ << "_globals;" << endl;
277 
278  } else if (language == ProGe::Verilog) {
279  // todo add IMEMDATAWIDTH constant here too.
280 
281  stream << "// address width of the instruction memory" << endl
282  << "parameter IMEMADDRWIDTH = " << iMemAddressWidth(machine)
283  << "," << endl
284  << "// width of the instruction memory in MAUs" << endl
285  << "parameter IMEMWIDTHINMAUS = " << imemWidthInMAUs << ","
286  << endl
287  << "// clock period" << endl
288  << "parameter PERIOD = 10," << endl; // 10 will equal 10ns
289 
290  plugin.writeGlobalDefinitions(ProGe::Verilog, stream);
291 
292  } else {
293  abortWithError("Unsupported HDL.");
294  }
295  stream.close();
296 }

References __func__, abortWithError, TTAMachine::Machine::busNavigator(), FileSystem::createFile(), FileSystem::DIRECTORY_SEPARATOR, entityName(), entityStr_, iMemAddressWidth(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProGe::Verilog, ProGe::VHDL, and ProGe::ICDecoderGeneratorPlugin::writeGlobalDefinitions().

Referenced by generateProcessor().

Here is the call graph for this function:

◆ generateProcessor()

void ProGe::ProcessorGenerator::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 
)

Generates the processor.

See also
ProGeUI::generateProcessor()

Definition at line 130 of file ProcessorGenerator.cc.

135  {
136  entityStr_ = options.entityName;
137  generatorContext_ = new ProGeContext(
138  machine, implementation, options.outputDirectory,
139  options.sharedOutputDirectory, options.entityName, options.language,
140  imemWidthInMAUs);
141 
142  // validate the machine
143  validateMachine(machine, errorStream, warningStream);
144  // check the compatibility of the plugin
145  plugin.verifyCompatibility();
146  // check that IU implementation latencies are compatible with the
147  // IC/GCU plugin
149 
150  NetlistGenerator netlistGenerator(*generatorContext_, plugin);
151  coreTopBlock_ = netlistGenerator.generate(
152  options, imemWidthInMAUs, options.entityName, warningStream);
153 
154  bool created = FileSystem::createDirectory(options.outputDirectory);
155  if (!created) {
156  string errorMsg =
157  "Unable to create directory " + options.outputDirectory;
158  throw IOException(__FILE__, __LINE__, __func__, errorMsg);
159  }
160 
161  string pluginDstDir =
162  options.outputDirectory + FileSystem::DIRECTORY_SEPARATOR + "gcu_ic";
163  created = FileSystem::createDirectory(pluginDstDir);
164  if (!created) {
165  string errorMsg = "Unable to create directory " + pluginDstDir;
166  throw IOException(__FILE__, __LINE__, __func__, errorMsg);
167  }
168 
169  plugin.generate(
170  options.language, pluginDstDir, netlistGenerator, implementation,
171  options.entityName);
172 
173  // Generate generatable FU implementations.
174  std::vector<std::string> globalOptions;
175  globalOptions.emplace_back("active low reset");
176  globalOptions.emplace_back("asynchronous reset");
177  globalOptions.emplace_back("reset everything");
179  options, globalOptions, generatorContext_->idf().FUGenerations(),
181 
182  coreTopBlock_->write(Path(options.outputDirectory), options.language);
183 
184  string topLevelDir = options.outputDirectory +
186  (options.language == VHDL ? "vhdl" : "verilog");
187 
190  *coreTopBlock_, verboseStream);
191 
192  if (!FileSystem::fileExists(options.sharedOutputDirectory)) {
193  if (!FileSystem::createDirectory(options.sharedOutputDirectory)) {
194  string errorMsg = "Unable to create directory " +
195  options.sharedOutputDirectory + ".";
196  throw IOException(__FILE__, __LINE__, __func__, errorMsg);
197  }
198  }
199  BlockSourceCopier copier(
200  implementation, options.entityName, options.language);
201 
202  if (machine.isRISCVMachine()) {
203  copier.getTemplateInstatiator().replacePlaceholder(
204  "decomp-fetchblock-width", "INSTRUCTIONWIDTH");
205  }
206 
207  copier.copyShared(options.sharedOutputDirectory);
208  copier.copyProcessorSpecific(options.outputDirectory);
210  options.language, machine,
211  options.outputDirectory + FileSystem::DIRECTORY_SEPARATOR + "gcu_ic");
212 
214  options.language, machine, imemWidthInMAUs, topLevelDir, plugin);
215 }

References __func__, ProGe::ProGeContext::adf(), checkIULatencies(), ProGe::BlockSourceCopier::copyProcessorSpecific(), ProGe::BlockSourceCopier::copyShared(), coreTopBlock_, FileSystem::createDirectory(), FileSystem::DIRECTORY_SEPARATOR, entityStr_, FileSystem::fileExists(), IDF::MachineImplementation::FUGenerations(), ProGe::NetlistGenerator::generate(), ProGe::ICDecoderGeneratorPlugin::generate(), generateGCUOpcodesPackage(), generateGlobalsPackage(), generatorContext_, ProGe::BlockSourceCopier::getTemplateInstatiator(), ProGe::ProGeContext::idf(), FUGen::implement(), implementation, TTAMachine::Machine::isRISCVMachine(), machine, options, HDLTemplateInstantiator::replacePlaceholder(), Application::spamVerbose(), validateMachine(), ProGe::ICDecoderGeneratorPlugin::verifyCompatibility(), ProGe::VHDL, ProGe::NetlistVisualization::visualizeBlockTree(), and ProGe::NetlistBlock::write().

Referenced by ProGe::ProGeUI::generateProcessor().

Here is the call graph for this function:

◆ generatorContext()

const ProGeContext & ProGe::ProcessorGenerator::generatorContext ( ) const

Returns the context (adf, idf, entity name, etc.) that is used in the processor generation.

Definition at line 519 of file ProcessorGenerator.cc.

519  {
520  return *generatorContext_;
521 }

References generatorContext_.

Referenced by ProGe::ProGeUI::generateTestBench().

◆ iMemAddressWidth()

int ProGe::ProcessorGenerator::iMemAddressWidth ( const TTAMachine::Machine mach)
static

Returns the width of the memory address of instruction memory of the given machine.

If the memory address width set in machine instruction memory address space differ from gcu port widths, the value set in the address space is used. In this case, GCU port widths are changed accordingly.

Parameters
machThe machine.
Returns
The bit width.
Exceptions
InvalidDataIf the GCU of the machine does not have an address space.

Definition at line 449 of file ProcessorGenerator.cc.

449  {
450  ControlUnit* gcu = mach.controlUnit();
451  // must have been already caught in main method: generateProcessor
452  assert(gcu != NULL);
453 
454  AddressSpace* iMem = gcu->addressSpace();
455  // must have been already caught in main method: generateProcessor
456  assert(iMem != NULL);
457 
458  int imemASWidth = MathTools::requiredBits(iMem->end());
459  // if gcu port have different width than imemASWidth, change port
460  // widths
461  if (gcu->hasReturnAddressPort()) {
462  int gcuRAPortWidth = gcu->returnAddressPort()->width();
463  if (gcuRAPortWidth != imemASWidth) {
464  gcu->returnAddressPort()->setWidth(imemASWidth);
465  }
466  }
467  if (gcu->hasOperation(CALL)) {
468  FUPort* pcPort = gcu->operation(CALL)->port(1);
469  if (pcPort != NULL) {
470  if (pcPort->width() != imemASWidth) {
471  pcPort->setWidth(imemASWidth);
472  }
473  }
474  } else if (gcu->hasOperation(JUMP)) {
475  FUPort* pcPort = gcu->operation(JUMP)->port(1);
476  if (pcPort != NULL) {
477  if (pcPort->width() != imemASWidth) {
478  pcPort->setWidth(imemASWidth);
479  }
480  }
481  }
482 
483  return imemASWidth;
484 }

References TTAMachine::FunctionUnit::addressSpace(), assert, CALL, TTAMachine::Machine::controlUnit(), TTAMachine::AddressSpace::end(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::ControlUnit::hasReturnAddressPort(), JUMP, TTAMachine::FunctionUnit::operation(), TTAMachine::HWOperation::port(), MathTools::requiredBits(), TTAMachine::ControlUnit::returnAddressPort(), TTAMachine::BaseFUPort::setWidth(), and TTAMachine::BaseFUPort::width().

Referenced by generateGlobalsPackage().

Here is the call graph for this function:

◆ iMemWidth()

int ProGe::ProcessorGenerator::iMemWidth ( const TTAMachine::Machine mach,
int  imemWidthInMAUs 
)
static

Returns the width of the instruction memory of the given machine.

Parameters
machThe machine.
Returns
The bit width.

Definition at line 493 of file ProcessorGenerator.cc.

494  {
495  ControlUnit* gcu = mach.controlUnit();
496  // must have been already caught in main method: generateProcessor
497  assert(gcu != NULL);
498 
499  AddressSpace* iMem = gcu->addressSpace();
500  // must have been already caught in main method: generateProcessor
501  assert(iMem != NULL);
502 
503  return iMem->width() * imemWidthInMAUs;
504 }

References TTAMachine::FunctionUnit::addressSpace(), assert, TTAMachine::Machine::controlUnit(), and TTAMachine::AddressSpace::width().

Here is the call graph for this function:

◆ instructionBus()

const NetlistPortGroup * ProGe::ProcessorGenerator::instructionBus ( NetlistBlock block)
staticprivate

Definition at line 319 of file ProcessorGenerator.cc.

319  {
320  assert(!block.portGroupsBy(SignalGroupType::INSTRUCTION_LINE).empty());
321  return block.portGroupsBy(SignalGroupType::INSTRUCTION_LINE).at(0);
322 }

References assert, ProGe::INSTRUCTION_LINE, and ProGe::BaseNetlistBlock::portGroupsBy().

Here is the call graph for this function:

◆ processorTopLevel()

const NetlistBlock & ProGe::ProcessorGenerator::processorTopLevel ( ) const

Returns Toplevel block of the core.

Definition at line 510 of file ProcessorGenerator.cc.

510  {
511  return *coreTopBlock_;
512 }

References coreTopBlock_.

Referenced by ProGe::ProGeUI::generateTestBench(), and ProGe::ProGeUI::integrateProcessor().

◆ removeUnconnectedSockets()

void ProGe::ProcessorGenerator::removeUnconnectedSockets ( TTAMachine::Machine machine,
std::ostream &  warningStream 
)
static

Definition at line 529 of file ProcessorGenerator.cc.

530  {
531  MachineResourceModifier modifier;
532  std::list<string> removedSockets;
533  modifier.removeNotConnectedSockets(machine, removedSockets);
534 
535  for (std::list<string>::iterator i = removedSockets.begin();
536  i != removedSockets.end(); i++) {
537  warningStream << "Warning: Removed unconnected socket " << *i
538  << std::endl;
539  }
540 }

References machine, and MachineResourceModifier::removeNotConnectedSockets().

Referenced by ProGe::ProGeUI::generateProcessor().

Here is the call graph for this function:

◆ validateMachine()

void ProGe::ProcessorGenerator::validateMachine ( const TTAMachine::Machine machine,
std::ostream &  errorStream,
std::ostream &  warningStream 
)
private

Validates the machine for compatibility with the given block implementations.

If the target architecture contains errors (incomplete definition) or if its structure is not compatible with this HDL generator, this method throws IllegalMachine exception. For less serious errors (such as non-critical bit width discrepancies), warning messages are written to the given stream.

Parameters
machineThe machine to validate.
errorStreamOutput stream where errors are printed
warningStreamOutput stream where warnings are printed
Exceptions
IllegalMachineIf there is a fundamental error in the machine.

Definition at line 341 of file ProcessorGenerator.cc.

343  {
344  MachineValidator validator(machine);
345  set<MachineValidator::ErrorCode> errorsToCheck;
346  errorsToCheck.insert(MachineValidator::GCU_MISSING);
347  errorsToCheck.insert(MachineValidator::GCU_AS_MISSING);
348  errorsToCheck.insert(MachineValidator::USED_IO_NOT_BOUND);
350  errorsToCheck.insert(MachineValidator::PC_PORT_MISSING);
351  errorsToCheck.insert(MachineValidator::RA_PORT_MISSING);
352  errorsToCheck.insert(
354  // we should not check for this as the designer is not supposed to
355  // know the width of these ports before the design has been finalized,
356  // thus we generate them automatically in ProGe
357  // errorsToCheck.insert(
358  // MachineValidator::IMEM_ADDR_WIDTH_DIFFERS_FROM_RA_AND_PC);
359 
360  MachineValidatorResults* results = validator.validate(errorsToCheck);
361 
362  for (int i = 0; i < results->errorCount(); i++) {
363  MachineValidator::ErrorCode code = results->error(i).first;
364  string errorMsg = results->error(i).second;
365  if (code ==
367  warningStream << "Warning: " << errorMsg
368  << " ProGe uses the value set in the address space."
369  << endl;
370  } else {
371  string msg = "Error: " + errorMsg;
372  errorStream << msg << std::endl;
373  delete results;
374  throw IllegalMachine(__FILE__, __LINE__, __func__, msg);
375  }
376  }
377  delete results;
378 }

References __func__, MachineValidator::DIFFERENT_PORT_FOR_JUMP_AND_CALL, MachineValidatorResults::error(), MachineValidatorResults::errorCount(), MachineValidator::GCU_AS_MISSING, MachineValidator::GCU_MISSING, MachineValidator::IMEM_ADDR_WIDTH_DIFFERS_FROM_RA_AND_PC, machine, MachineValidator::PC_AND_RA_PORTS_HAVE_UNEQUAL_WIDTH, MachineValidator::PC_PORT_MISSING, MachineValidator::RA_PORT_MISSING, MachineValidator::USED_IO_NOT_BOUND, and MachineValidator::validate().

Referenced by generateProcessor().

Here is the call graph for this function:

Member Data Documentation

◆ coreTopBlock_

NetlistBlock* ProGe::ProcessorGenerator::coreTopBlock_
private

◆ DEFAULT_ENTITY_STR

const TCEString ProGe::ProcessorGenerator::DEFAULT_ENTITY_STR = "tta0"
staticprivate

Definition at line 120 of file ProcessorGenerator.hh.

◆ entityStr_

TCEString ProGe::ProcessorGenerator::entityStr_
private

◆ generatorContext_

ProGeContext* ProGe::ProcessorGenerator::generatorContext_
private

Definition at line 118 of file ProcessorGenerator.hh.

Referenced by generateProcessor(), and generatorContext().


The documentation for this class was generated from the following files:
IDF::UnitImplementationLocation
Definition: UnitImplementationLocation.hh:48
ProGe::NetlistBlock::write
virtual void write(const Path &targetBaseDir, HDL targetLang=VHDL) const override
Definition: NetlistBlock.cc:201
Path
Definition: FileSystem.hh:197
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::Verilog
@ Verilog
Verilog.
Definition: ProGeTypes.hh:42
MachineValidator::IMEM_ADDR_WIDTH_DIFFERS_FROM_RA_AND_PC
@ IMEM_ADDR_WIDTH_DIFFERS_FROM_RA_AND_PC
Instruction memory address width differs from PC/RA port width.
Definition: MachineValidator.hh:71
TTAMachine::Machine::isRISCVMachine
bool isRISCVMachine() const
Definition: Machine.cc:1063
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
MachineValidator::GCU_MISSING
@ GCU_MISSING
GCU missing in machine.
Definition: MachineValidator.hh:57
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
implementation
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:61
ProGe::ProGeContext::adf
const TTAMachine::Machine & adf() const
Definition: ProGeContext.cc:57
HDB::RFArchitecture::latency
int latency() const
Definition: RFArchitecture.cc:497
ProGe::ProcessorGenerator::entityName
TCEString entityName() const
Definition: ProcessorGenerator.cc:524
HDB::RFEntry
Definition: RFEntry.hh:47
IDF::MachineImplementation::iuImplementation
RFImplementationLocation & iuImplementation(const std::string &iu) const
Definition: MachineImplementation.cc:399
MachineValidator::USED_IO_NOT_BOUND
@ USED_IO_NOT_BOUND
Pipeline uses an IO which is not bound.
Definition: MachineValidator.hh:61
MachineResourceModifier
Definition: MachineResourceModifier.hh:49
TTAMachine::FunctionUnit::addressSpace
virtual AddressSpace * addressSpace() const
Definition: FunctionUnit.cc:580
ProGe::ProcessorGenerator::iMemAddressWidth
static int iMemAddressWidth(const TTAMachine::Machine &mach)
Definition: ProcessorGenerator.cc:449
ProGe::ProcessorGenerator::coreTopBlock_
NetlistBlock * coreTopBlock_
Definition: ProcessorGenerator.hh:116
TTAMachine::Machine::Navigator::count
int count() const
ProGe::ProcessorGenerator::generatorContext_
ProGeContext * generatorContext_
Definition: ProcessorGenerator.hh:118
MachineValidator::PC_PORT_MISSING
@ PC_PORT_MISSING
PC port missing in GCU.
Definition: MachineValidator.hh:65
MachineValidatorResults
Definition: MachineValidatorResults.hh:45
FUGen::implement
static void implement(const ProGeOptions &options, std::vector< std::string > globalOptions, const std::vector< IDF::FUGenerated > &generatetFUs, const TTAMachine::Machine &machine, ProGe::NetlistBlock *core)
Definition: FUGen.cc:1515
MachineValidator
Definition: MachineValidator.hh:52
HDB::RFEntry::architecture
RFArchitecture & architecture() const
Definition: RFEntry.cc:145
ProGe::SignalGroupType::INSTRUCTION_LINE
@ INSTRUCTION_LINE
Signal group type for serial TTA instruction bus.
ProGe::ProcessorGenerator::checkIULatencies
void checkIULatencies(const TTAMachine::Machine &machine, const IDF::MachineImplementation &implementation, const ICDecoderGeneratorPlugin &plugin)
Definition: ProcessorGenerator.cc:390
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::HWOperation::port
virtual FUPort * port(int operand) const
Definition: HWOperation.cc:320
TTAMachine::FUPort
Definition: FUPort.hh:46
TTAMachine::Machine::controlUnit
virtual ControlUnit * controlUnit() const
Definition: Machine.cc:345
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
Application::spamVerbose
static bool spamVerbose()
Definition: Application.hh:182
MachineValidator::GCU_AS_MISSING
@ GCU_AS_MISSING
Address space missing in GCU.
Definition: MachineValidator.hh:59
ProGe::VHDL
@ VHDL
VHDL.
Definition: ProGeTypes.hh:41
InvalidData
Definition: Exception.hh:149
MachineValidator::PC_AND_RA_PORTS_HAVE_UNEQUAL_WIDTH
@ PC_AND_RA_PORTS_HAVE_UNEQUAL_WIDTH
RA and PC ports have unequal width.
Definition: MachineValidator.hh:69
TTAMachine::Machine::immediateUnitNavigator
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition: Machine.cc:416
TTAMachine::ControlUnit
Definition: ControlUnit.hh:50
ProGe::NetlistVisualization::visualizeBlockTree
static void visualizeBlockTree(const BaseNetlistBlock &root, std::ostream &streamOut)
Definition: NetlistVisualization.cc:58
MachineValidator::DIFFERENT_PORT_FOR_JUMP_AND_CALL
@ DIFFERENT_PORT_FOR_JUMP_AND_CALL
JUMP and CALL uses different port in GCU.
Definition: MachineValidator.hh:63
JUMP
const string JUMP
Definition: ProcessorGenerator.cc:105
__func__
#define __func__
Definition: Application.hh:67
MachineValidator::ErrorCode
ErrorCode
Error codes for different errors.
Definition: MachineValidator.hh:55
HDB::HDBManager
Definition: HDBManager.hh:82
TTAMachine::BaseFUPort::setWidth
void setWidth(int width)
Definition: BaseFUPort.cc:121
ProGe::ProGeContext::idf
const IDF::MachineImplementation & idf() const
Definition: ProGeContext.cc:62
MathTools::requiredBits
static int requiredBits(unsigned long int number)
MachineValidatorResults::errorCount
int errorCount() const
Definition: MachineValidatorResults.cc:56
TTAMachine::FunctionUnit::hasOperation
virtual bool hasOperation(const std::string &name) const
Definition: FunctionUnit.cc:330
ProGe::ProcessorGenerator::generateGCUOpcodesPackage
void generateGCUOpcodesPackage(HDL language, const TTAMachine::Machine &machine, const std::string &dstDirectory)
Definition: ProcessorGenerator.cc:306
FileSystem::createFile
static bool createFile(const std::string &file)
Definition: FileSystem.cc:468
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
ProGe::ProcessorGenerator::validateMachine
void validateMachine(const TTAMachine::Machine &machine, std::ostream &errorStream, std::ostream &warningStream)
Definition: ProcessorGenerator.cc:341
FileSystem::DIRECTORY_SEPARATOR
static const std::string DIRECTORY_SEPARATOR
Definition: FileSystem.hh:189
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
ProGe::ProcessorGenerator::generateGlobalsPackage
void generateGlobalsPackage(HDL language, const TTAMachine::Machine &machine, int imemWidthInMAUs, const std::string &dstDirectory, ICDecoderGeneratorPlugin &plugin)
Definition: ProcessorGenerator.cc:230
MachineValidator::RA_PORT_MISSING
@ RA_PORT_MISSING
RA port missing in GCU.
Definition: MachineValidator.hh:67
TTAMachine::AddressSpace::width
virtual int width() const
Definition: AddressSpace.cc:155
HDB::RFArchitecture
Definition: RFArchitecture.hh:50
IllegalMachine
Definition: Exception.hh:878
IDF::UnitImplementationLocation::id
virtual int id() const
Definition: UnitImplementationLocation.cc:127
FileSystem::fileExists
static bool fileExists(const std::string fileName)
TTAMachine::Machine::busNavigator
virtual BusNavigator busNavigator() const
Definition: Machine.cc:356
CALL
const string CALL
Definition: ProcessorGenerator.cc:104
TCEString::makeString
static std::string makeString(const IterableContainer &container, const std::string &separator=", ")
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
KeyNotFound
Definition: Exception.hh:285
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
TTAMachine::ControlUnit::returnAddressPort
SpecialRegisterPort * returnAddressPort() const
Definition: ControlUnit.cc:307
IDF::MachineImplementation::FUGenerations
const std::vector< FUGenerated > & FUGenerations() const
Definition: MachineImplementation.cc:1572
ProGe::ProcessorGenerator::entityStr_
TCEString entityStr_
Definition: ProcessorGenerator.hh:117
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TTAMachine::AddressSpace::end
virtual ULongWord end() const
Definition: AddressSpace.cc:177
HDB::RFEntry::hasArchitecture
virtual bool hasArchitecture() const
Definition: RFEntry.cc:117
TTAMachine::ControlUnit::hasReturnAddressPort
bool hasReturnAddressPort() const
Definition: ControlUnit.cc:295
TTAMachine::BaseFUPort::width
virtual int width() const
Definition: BaseFUPort.cc:109
MachineResourceModifier::removeNotConnectedSockets
void removeNotConnectedSockets(TTAMachine::Machine &mach, std::list< std::string > &removedSocketNames)
Definition: MachineResourceModifier.cc:244
HDB::HDBManager::rfByEntryID
RFEntry * rfByEntryID(RowID id) const
Definition: HDBManager.cc:2885
MachineValidatorResults::error
Error error(int index) const
Definition: MachineValidatorResults.cc:70
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50