Go to the documentation of this file.
56 using namespace ProGe;
68 int main(
int argc,
char* argv[]) {
110 std::string pluginParamQuery =
options.pluginParametersQuery();
111 if (pluginParamQuery !=
"") {
112 return listICDecPluginParameters(pluginParamQuery);
124 if (
options.listAvailableIntegrators()) {
134 if (!validIntegratorParameters(
options)) {
139 if (!
options.forceOutputDirectory() &&
142 <<
" already exists." << endl;
146 string processorDefinition =
options.processorToGenerate();
151 loadProcessorConfiguration(processorDefinition);
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();
164 if (machine_->isRISCVMachine()) {
169 loadBinaryEncoding(bem);
172 loadMachineImplementation(idf);
176 progeOptions, imemWidthInMAUs, std::cerr, std::cerr, std::cerr);
184 cerr <<
"Exception thrown at: " << e.
fileName() <<
":"
192 if (
options.generateTestbench()) {
197 progeOptions.
language, testBenchDir,
200 std::cerr <<
"Warning: Processor Generator failed to "
201 <<
"generate testbench." << std::endl;
212 std::cerr <<
"Warning: Processor Generator failed to "
213 <<
"generate simulation/compilation scripts."
219 string integrator =
options.integratorName();
220 if (!integrator.empty()) {
222 std::cerr <<
"Verilog is not yet supported by Platform Integrator"
229 if (!
options.useAbsolutePaths()) {
241 int fmax =
options.clockFrequency();
242 string devFamily =
options.deviceFamilyName();
243 string devName =
options.deviceName();
244 bool syncReset =
options.syncReset();
248 std::cout, std::cerr, progeOutDir, sharedOutDir, integrator,
250 dmem, progeOptions.
language, fmax, syncReset);
252 std::cerr <<
"Processor integration failed: "
271 std::string& outputDir) {
273 outputDir =
options.outputDirectory();
275 if (outputDir ==
"") {
291 const std::string& pluginFile)
const {
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;
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;
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"
426 if (string2MemType(imem) ==
UNKNOWN) {
428 <<
"Invalid instruction memory type " << imem << endl;
431 if (string2MemType(dmem) ==
UNKNOWN) {
432 std::cerr <<
"Invalid data memory type " << dmem << endl;
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") {
bool generateProcessor(int argc, char *argv[])
virtual void printHelp() const
std::string procedureName() const
static Machine * loadMachine(const std::string &adfFile)
bool validIntegratorParameters(const ProGeCmdLineOptions &options) const
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 architecture definition of the estimated processor
virtual int numberOfArguments() const
bool listICDecPluginParameters(const std::string &pluginFile) const
static void setVerboseLevel(const int level=VERBOSE_LEVEL_DEFAULT)
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
std::string outputDirectory
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)
void generateTestBench(const ProGe::HDL language, const std::string &dstDir, const std::string &progeOutDir)
static std::string fileExtension(const std::string &fileName)
void getOutputDir(const ProGeCmdLineOptions &options, std::string &outputDir)
void listIntegrators() const
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)
virtual bool isVerboseSwitchDefined() const
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
static bool fileExists(const std::string fileName)
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
std::string simulationRuntime
static std::string fileNameBody(const std::string &fileName)
virtual ~GenerateProcessor()
int main(int argc, char *argv[])
void generateProcessor(const ProGeOptions &options, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream)
std::string sharedOutputDirectory
virtual bool isVerboseSpamSwitchDefined() const