68int main(
int argc,
char* argv[]) {
110 std::string pluginParamQuery =
options.pluginParametersQuery();
111 if (pluginParamQuery !=
"") {
124 if (
options.listAvailableIntegrators()) {
139 if (!
options.forceOutputDirectory() &&
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();
176 progeOptions, imemWidthInMAUs, std::cerr, std::cerr, std::cerr);
184 cerr <<
"Exception thrown at: " << e.
fileName() <<
":"
192 string integrator =
options.integratorName();
193 if (!integrator.empty()) {
195 std::cerr <<
"Verilog is not yet supported by Platform Integrator"
202 if (!
options.useAbsolutePaths()) {
214 int fmax =
options.clockFrequency();
215 string devFamily =
options.deviceFamilyName();
216 string devName =
options.deviceName();
217 bool syncReset =
options.syncReset();
221 std::cout, std::cerr, progeOutDir, sharedOutDir, integrator,
223 dmem, progeOptions.
language, fmax, syncReset,
226 std::cerr <<
"Processor integration failed: "
233 if (
options.generateTestbench()) {
238 progeOptions.
language, testBenchDir,
241 std::cerr <<
"Warning: Processor Generator failed to "
242 <<
"generate testbench." << std::endl;
253 std::cerr <<
"Warning: Processor Generator failed to "
254 <<
"generate simulation/compilation scripts."
272 std::string& outputDir) {
274 outputDir =
options.outputDirectory();
276 if (outputDir ==
"") {
292 const std::string& pluginFile)
const {
298 if (pluginName.length() < 6 ||
299 pluginName.substr(pluginName.length() - 6) !=
"Plugin") {
301 cerr <<
"Unable to determine plugin name. Plugin file must be named "
302 <<
"'<plugin name>Plugin.so'." << endl;;
306 pluginName = pluginName.substr(0, pluginName.length() - 6);
311 for (std::vector<string>::const_iterator iter = pluginPaths.begin();
312 iter != pluginPaths.end(); iter++) {
322 cerr <<
"Plugin file '" << pluginFile <<
"' not found." << endl;
325 cerr <<
"Error loading plugin file '" << pluginFile <<
"': "
342 "create_generator_plugin_" + pluginName, creator, pluginFile);
344 plugin = creator(
machine, bem);
346 cerr <<
"Error loading plugin '" << pluginName <<
"' from '"
347 << pluginFile <<
"':" << endl;
354 cout << pluginName <<
":" << endl;
355 cout << plugin->pluginDescription() << endl << endl;
356 cout <<
"Recognized parameters:" << endl
357 <<
"----------------------" << endl;
359 for (
int i = 0; i < plugin->recognizedParameterCount(); i++) {
360 std::string paramName = plugin->recognizedParameter(i);
361 cout << paramName << endl;
362 cout <<
" " << plugin->parameterDescription(paramName) << endl;
365 cout <<
"----------------------" << endl;
375 std::vector<PlatformIntegrator*> integrators;
383 for (
unsigned int i = 0; i < integrators.size(); i++) {
384 integrators.at(i)->printInfo(std::cout);
385 delete integrators.at(i);
387 std::cout <<
"Please refer to the user manual for more information on "
388 <<
"Platform Integrators." << std::endl;
396 if (
options.integratorName().empty()) {
399 string entity =
options.entityName();
400 if (entity.empty()) {
401 std::cerr <<
"Entity name must be given" << endl;
407 <<
"Tpef is required for platform integration" << endl;
411 std::cerr <<
"Program does not have '.tpef' ending" << endl;
415 string imem =
options.imemType();
417 std::cerr <<
"Instruction memory type is required for platform "
418 <<
"integration" << endl;
421 string dmem =
options.dmemType();
423 std::cerr <<
"Data memory type is required for platform integration"
429 <<
"Invalid instruction memory type " << imem << endl;
433 std::cerr <<
"Invalid data memory type " << dmem << endl;
444 if (memoryString ==
"none") {
446 }
else if (memoryString ==
"vhdl_array") {
448 }
else if (memoryString ==
"onchip") {
450 }
else if (memoryString ==
"sram") {
452 }
else if (memoryString ==
"dram") {
#define assert(condition)
TTAMachine::Machine * machine
the architecture definition of the estimated processor
const int DEFAULT_IMEMWIDTH_IN_MAUS
int main(int argc, char *argv[])
int const DEFAULT_IMEMWIDTH_IN_MAUS
find Finds info of the inner loops in the program
static MachInfoCmdLineOptions options
static const int VERBOSE_LEVEL_INCREASED
Increased verbose level - print information about modules etc.
static const int VERBOSE_LEVEL_SPAM
More Increased verbose level - spam about ddg heights of loops.
static void setVerboseLevel(const int level=VERBOSE_LEVEL_DEFAULT)
void parse(char *argv[], int argc)
virtual bool isVerboseSwitchDefined() const
virtual bool isVerboseSpamSwitchDefined() const
virtual int numberOfArguments() const
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
std::string fileName() const
std::string errorMessage() const
std::string procedureName() const
static std::string absolutePathOf(const std::string &pathName)
static const std::string DIRECTORY_SEPARATOR
static std::string fileNameBody(const std::string &fileName)
static std::string fileOfPath(const std::string pathName)
static std::string fileExtension(const std::string &fileName)
static std::string currentWorkingDir()
static bool relativeDir(const std::string &baseDir, std::string &toRelDir)
static bool fileExists(const std::string fileName)
static std::string expandTilde(const std::string &stringWithTilde)
bool generateProcessor(int argc, char *argv[])
bool validIntegratorParameters(const ProGeCmdLineOptions &options) const
void getOutputDir(const ProGeCmdLineOptions &options, std::string &outputDir)
void listIntegrators() const
virtual ~GenerateProcessor()
MemType string2MemType(const std::string &memoryString) const
bool listICDecPluginParameters(const std::string &pluginFile) const
virtual void printHelp() const
TTAMachine::Machine * machine_
The loaded machine.
void loadBinaryEncoding(const BinaryEncoding &bem)
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 loadMachineImplementation(const IDF::MachineImplementation &idf)
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 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, bool generateIntegratedTestbench)
void loadProcessorConfiguration(const std::string &configurationFile)
void loadMachine(const TTAMachine::Machine &adf)
bool isRISCVMachine() const
std::string sharedOutputDirectory
std::string simulationRuntime
std::string outputDirectory