#include <GenerateProcessor.hh>
|
| GenerateProcessor () |
|
virtual | ~GenerateProcessor () |
|
bool | generateProcessor (int argc, char *argv[]) |
|
virtual | ~ProGeUI () |
|
| ProGeUI () |
|
void | generateProcessor (const ProGeOptions &options, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream) |
|
void | generateTestBench (const ProGe::HDL language, const std::string &dstDir, const std::string &progeOutDir) |
|
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) |
|
void | loadMachine (const TTAMachine::Machine &adf) |
|
void | loadBinaryEncoding (const BinaryEncoding &bem) |
|
void | loadMachineImplementation (const IDF::MachineImplementation &idf) |
|
|
void | loadMachine (const std::string &adfFile) |
|
void | loadBinaryEncoding (const std::string &bemFile) |
|
void | loadMachineImplementation (const std::string &idfFile) |
|
void | loadProcessorConfiguration (const std::string &configurationFile) |
|
void | loadICDecoderGeneratorPlugin (const std::string &pluginFile, const std::string &pluginName) |
|
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) |
|
TTAMachine::Machine * | machine_ |
| The loaded machine. More...
|
|
Implements the command line user interface 'generateprocessor'.
Definition at line 46 of file GenerateProcessor.hh.
◆ GenerateProcessor()
GenerateProcessor::GenerateProcessor |
( |
| ) |
|
◆ ~GenerateProcessor()
GenerateProcessor::~GenerateProcessor |
( |
| ) |
|
|
virtual |
◆ generateProcessor()
bool GenerateProcessor::generateProcessor |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Parses the command line arguments and generates the processor.
- Returns
- True if the generation of the processor was succesful, otherwise false.
Definition at line 100 of file GenerateProcessor.cc.
110 std::string pluginParamQuery =
options.pluginParametersQuery();
111 if (pluginParamQuery !=
"") {
124 if (
options.listAvailableIntegrators()) {
139 if (!
options.forceOutputDirectory() &&
141 cerr <<
"Error: Output directory " << progeOptions.outputDirectory
142 <<
" already exists." << endl;
146 string processorDefinition =
options.processorToGenerate();
153 cerr <<
"Unknown file: " << processorDefinition
154 <<
". The given file must be either an ADF or PCF file."
159 string bem =
options.bemFile();
160 string idf =
options.idfFile();
175 ProGeUI::generateProcessor(
176 progeOptions, imemWidthInMAUs, std::cerr, std::cerr, std::cerr);
184 cerr <<
"Exception thrown at: " << e.
fileName() <<
":"
192 if (
options.generateTestbench()) {
193 string testBenchDir = progeOptions.outputDirectory +
196 ProGeUI::generateTestBench(
197 progeOptions.language, testBenchDir,
198 progeOptions.outputDirectory);
200 std::cerr <<
"Warning: Processor Generator failed to "
201 <<
"generate testbench." << std::endl;
206 ProGeUI::generateScripts(
207 progeOptions.language, progeOptions.outputDirectory,
208 progeOptions.outputDirectory,
209 progeOptions.sharedOutputDirectory, testBenchDir,
210 progeOptions.simulationRuntime);
212 std::cerr <<
"Warning: Processor Generator failed to "
213 <<
"generate simulation/compilation scripts."
219 string integrator =
options.integratorName();
220 if (!integrator.empty()) {
221 if (progeOptions.language ==
Verilog) {
222 std::cerr <<
"Verilog is not yet supported by Platform Integrator"
227 string progeOutDir = progeOptions.outputDirectory;
228 string sharedOutDir = progeOptions.sharedOutputDirectory;
229 if (!
options.useAbsolutePaths()) {
241 int fmax =
options.clockFrequency();
242 string devFamily =
options.deviceFamilyName();
243 string devName =
options.deviceName();
244 bool syncReset =
options.syncReset();
247 ProGeUI::integrateProcessor(
248 std::cout, std::cerr, progeOutDir, sharedOutDir, integrator,
249 progeOptions.entityName,
program, devFamily, devName, imem,
250 dmem, progeOptions.language, fmax, syncReset);
252 std::cerr <<
"Processor integration failed: "
References __func__, StringTools::chopString(), FileSystem::currentWorkingDir(), DEFAULT_IMEMWIDTH_IN_MAUS, FileSystem::DIRECTORY_SEPARATOR, ProGeOptions::entityName, Exception::errorMessage(), FileSystem::fileExists(), FileSystem::fileExtension(), Exception::fileName(), ProGe::ProGeUI::generateProcessor(), ProGe::ProGeUI::generateScripts(), ProGe::ProGeUI::generateTestBench(), ProGe::ProGeUI::integrateProcessor(), CmdLineOptions::isVerboseSpamSwitchDefined(), CmdLineOptions::isVerboseSwitchDefined(), ProGeOptions::language, Exception::lineNum(), loadMachine(), CmdLineParser::numberOfArguments(), options, ProGeOptions::outputDirectory, CmdLineOptions::parse(), MachInfoCmdLineOptions::printHelp(), Exception::procedureName(), program, FileSystem::relativeDir(), Application::setVerboseLevel(), ProGeOptions::sharedOutputDirectory, ProGeOptions::simulationRuntime, Application::VERBOSE_LEVEL_INCREASED, Application::VERBOSE_LEVEL_SPAM, and ProGe::Verilog.
Referenced by main().
◆ getOutputDir()
void GenerateProcessor::getOutputDir |
( |
const ProGeCmdLineOptions & |
options, |
|
|
std::string & |
outputDir |
|
) |
| |
|
private |
◆ listICDecPluginParameters()
bool GenerateProcessor::listICDecPluginParameters |
( |
const std::string & |
pluginFile | ) |
const |
|
private |
Prints listing of IC/Decoder generator plugin parameters to stdout.
- Parameters
-
pluginFile | Full path to the plugin file. |
Definition at line 290 of file GenerateProcessor.cc.
297 if (pluginName.length() < 6 ||
298 pluginName.substr(pluginName.length() - 6) !=
"Plugin") {
300 cerr <<
"Unable to determine plugin name. Plugin file must be named "
301 <<
"'<plugin name>Plugin.so'." << endl;;
305 pluginName = pluginName.substr(0, pluginName.length() - 6);
310 for (std::vector<string>::const_iterator iter = pluginPaths.begin();
311 iter != pluginPaths.end(); iter++) {
321 cerr <<
"Plugin file '" << pluginFile <<
"' not found." << endl;
324 cerr <<
"Error loading plugin file '" << pluginFile <<
"': "
341 "create_generator_plugin_" + pluginName, creator, pluginFile);
343 plugin = creator(
machine, bem);
345 cerr <<
"Error loading plugin '" << pluginName <<
"' from '"
346 << pluginFile <<
"':" << endl;
353 cout << pluginName <<
":" << endl;
354 cout << plugin->pluginDescription() << endl << endl;
355 cout <<
"Recognized parameters:" << endl
356 <<
"----------------------" << endl;
358 for (
int i = 0; i < plugin->recognizedParameterCount(); i++) {
359 std::string paramName = plugin->recognizedParameter(i);
360 cout << paramName << endl;
361 cout <<
" " << plugin->parameterDescription(paramName) << endl;
364 cout <<
"----------------------" << endl;
References PluginTools::addSearchPath(), assert, Exception::errorMessage(), FileSystem::fileNameBody(), FileSystem::fileOfPath(), Environment::icDecoderPluginPaths(), PluginTools::importSymbol(), machine, and PluginTools::registerModule().
◆ listIntegrators()
void GenerateProcessor::listIntegrators |
( |
| ) |
const |
|
private |
Definition at line 372 of file GenerateProcessor.cc.
374 std::vector<PlatformIntegrator*> integrators;
382 for (
unsigned int i = 0; i < integrators.size(); i++) {
383 integrators.at(i)->printInfo(std::cout);
384 delete integrators.at(i);
386 std::cout <<
"Please refer to the user manual for more information on "
387 <<
"Platform Integrators." << std::endl;
◆ string2MemType()
MemType GenerateProcessor::string2MemType |
( |
const std::string & |
memoryString | ) |
const |
|
private |
Definition at line 440 of file GenerateProcessor.cc.
443 if (memoryString ==
"none") {
445 }
else if (memoryString ==
"vhdl_array") {
447 }
else if (memoryString ==
"onchip") {
449 }
else if (memoryString ==
"sram") {
451 }
else if (memoryString ==
"dram") {
References DRAM, NONE, ONCHIP, SRAM, UNKNOWN, and VHDL_ARRAY.
◆ validIntegratorParameters()
Definition at line 392 of file GenerateProcessor.cc.
395 if (
options.integratorName().empty()) {
398 string entity =
options.entityName();
399 if (entity.empty()) {
400 std::cerr <<
"Entity name must be given" << endl;
406 <<
"Tpef is required for platform integration" << endl;
410 std::cerr <<
"Program does not have '.tpef' ending" << endl;
414 string imem =
options.imemType();
416 std::cerr <<
"Instruction memory type is required for platform "
417 <<
"integration" << endl;
420 string dmem =
options.dmemType();
422 std::cerr <<
"Data memory type is required for platform integration"
428 <<
"Invalid instruction memory type " << imem << endl;
432 std::cerr <<
"Invalid data memory type " << dmem << endl;
References StringTools::endsWith(), options, program, and UNKNOWN.
The documentation for this class was generated from the following files:
virtual void printHelp() const
std::string procedureName() const
bool validIntegratorParameters(const ProGeCmdLineOptions &options) const
bool isRISCVMachine() const
TTAMachine::Machine * machine
the architecture definition of the estimated processor
virtual int numberOfArguments() const
bool listICDecPluginParameters(const std::string &pluginFile) const
void loadProcessorConfiguration(const std::string &configurationFile)
static void setVerboseLevel(const int level=VERBOSE_LEVEL_DEFAULT)
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
static std::string absolutePathOf(const std::string &pathName)
static bool relativeDir(const std::string &baseDir, std::string &toRelDir)
static std::string fileOfPath(const std::string pathName)
const int DEFAULT_IMEMWIDTH_IN_MAUS
std::string fileName() const
#define assert(condition)
static std::string fileExtension(const std::string &fileName)
void listIntegrators() const
virtual bool isVerboseSwitchDefined() const
TTAMachine::Machine * machine_
The loaded machine.
static std::string expandTilde(const std::string &stringWithTilde)
static const int VERBOSE_LEVEL_INCREASED
Increased verbose level - print information about modules etc.
MemType string2MemType(const std::string &memoryString) const
std::string errorMessage() const
void parse(char *argv[], int argc)
static const std::string DIRECTORY_SEPARATOR
static MachInfoCmdLineOptions options
void loadBinaryEncoding(const BinaryEncoding &bem)
void loadMachineImplementation(const IDF::MachineImplementation &idf)
static bool fileExists(const std::string fileName)
void loadMachine(const TTAMachine::Machine &adf)
static const int VERBOSE_LEVEL_SPAM
More Increased verbose level - spam about ddg heights of loops.
static std::string currentWorkingDir()
find Finds info of the inner loops in the program
static std::string fileNameBody(const std::string &fileName)
virtual bool isVerboseSpamSwitchDefined() const