Go to the documentation of this file.
89 const std::string ProGeUI::DEFAULT_ENTITY_STR =
"tta0";
95 machine_(NULL), bem_(NULL), idf_(NULL), plugin_(NULL), pluginFile_(
""),
96 entityName_(DEFAULT_ENTITY_STR) {
191 std::ifstream fileStream(configurationFile.c_str());
192 if (!fileStream.good()) {
193 string errorMsg =
"Unable to read the PCF from '" +
194 configurationFile +
"'.";
240 const std::string& pluginFile,
const std::string& pluginName) {
245 string errorMsg =
"BEM not loaded";
251 for (vector<string>::const_iterator iter = pluginPaths.begin();
252 iter != pluginPaths.end(); iter++) {
262 string errorMsg =
"Plugin file '" + pluginFile +
"' doesn't exist";
269 "create_generator_plugin_" + pluginName, creator, pluginFile);
300 std::ostream& errorStream = std::cerr,
301 std::ostream& warningStream = std::cerr,
302 std::ostream& verboseStream = std::cerr) {
338 string errorMsg =
"IC/decoder generator plugin not defined";
360 warningStream, verboseStream);
377 const std::string& dstDir,
378 const std::string& progeOutDir) {
396 coreTestbench.
write(
Path(progeOutDir), language);
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,
437 if (nullPointer == NULL) {
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,
449 int fmax,
bool syncReset) {
454 imemInfo.
type = imem;
459 if (platformIntegrator ==
"Stratix2DSP") {
462 platformDir, programName, fmax, warningStream, errorStream,
464 }
else if (platformIntegrator ==
"KoskiIntegrator") {
467 platformDir, programName, fmax, warningStream, errorStream,
469 }
else if (platformIntegrator ==
"AvalonIntegrator") {
472 platformDir, programName, fmax, warningStream, errorStream,
474 }
else if (platformIntegrator ==
"Stratix3DevKit") {
477 platformDir, programName, fmax, warningStream, errorStream,
479 }
else if (platformIntegrator ==
"AlmaIFIntegrator") {
482 platformDir, programName, fmax, warningStream, errorStream,
483 imemInfo, dmem, syncReset);
485 string errorMsg =
"Unknown platform integrator: "
486 + platformIntegrator;
490 if (!deviceFamily.empty()) {
493 if (!deviceName.empty()) {
529 std::ostream nullstream(0);
530 std::ostream& verbose =
534 verbose <<
"IDF not set, trying automated generation.\n";
538 std::vector<std::string> handledFUs;
544 handledFUs.emplace_back(fu->name());
548 std::vector<IDF::FUGenerated::Info> infos =
552 std::vector<IDF::FUGenerated::DAGOperation> dagops =
555 auto already_handled = [&](
const std::string& name) {
556 return std::find(handledFUs.begin(), handledFUs.end(), name) !=
560 auto select_hdb_implementations = [&]() {
562 if (already_handled(fu->name())) {
565 verbose <<
" select implementation for " << fu->name() <<
"... ";
569 options, *fu, *loc, verbose)) {
570 verbose <<
"OK (selected " << loc->
id() <<
" from "
573 handledFUs.emplace_back(fu->name());
580 auto generate_implementations = [&]() {
582 if (already_handled(fu->name())) {
585 verbose <<
" generate implementation for " << fu->name()
589 options, *fu, fug, infos, dagops)) {
592 handledFUs.emplace_back(fug.
name());
600 if (
options.preferHDLGeneration) {
601 generate_implementations();
602 select_hdb_implementations();
604 select_hdb_implementations();
605 generate_implementations();
613 verbose <<
" select implementation for " << iu->name() <<
"... ";
617 verbose <<
"OK (selected " << loc->
id() <<
" from "
630 verbose <<
" select implementation for " << rf->name() <<
"... ";
634 verbose <<
"OK (selected " << loc->
id() <<
" from "
649 for (
auto&& kvp :
options.icdArgList) {
657 if (delaySlots == 3) {
659 }
else if (delaySlots == 2) {
662 throw std::runtime_error(
663 "Cannot decide ICDecoder parameters for " +
664 std::to_string(delaySlots) +
"-stage GCU.");
UnitImplementationLocation RFImplementationLocation
bool hasRFImplementation(const std::string &unitName) const
bool hasICDecoderPluginFile() 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)
virtual TCEString name() const
void setSourceFile(const std::string &fileName)
virtual void write(const Path &targetBaseDir, HDL targetLang=VHDL) const override
MachineImplementation * readMachineImplementation()
std::string entityName_
Name of the toplevel entity.
const NetlistBlock & processorTopLevel() const
void loadProcessorConfiguration(const std::string &configurationFile)
std::string architectureName()
ProcessorGenerator generator_
std::string pluginFile_
The plugin file.
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
virtual AddressSpace * addressSpace() const
static std::string absolutePathOf(const std::string &pathName)
bool hasFUImplementation(const std::string &unitName) const
std::string errorMessage(int index) const
bool hasIUImplementation(const std::string &unitName) const
virtual bool isShared() const
bool hasFUGeneration(const std::string &name) const
#define assert(condition)
std::string icDecoderParameterValue(const std::string &name) const
virtual ObjectState * saveState() const
static bool increasedVerbose()
unsigned icDecoderParameterCount() const
ICDecoderGeneratorPlugin * plugin_
The loaded IC/decoder generator plugin.
void generateTestBench(const ProGe::HDL language, const std::string &dstDir, const std::string &progeOutDir)
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")
virtual ControlUnit * controlUnit() const
std::string icDecoderParameterName(unsigned param) const
void setPCFDirectory(const std::string &path)
virtual ObjectState * saveState() const
void loadICDecoderGeneratorPlugin(const std::string &pluginFile, const std::string &pluginName)
std::string implementationName()
virtual ImmediateUnitNavigator immediateUnitNavigator() const
void setICDecoderPluginName(const std::string &name)
void addFuGeneration(const FUGenerated &fug)
virtual int width(const TCEString &templateName) const
static std::string directoryOfPath(const std::string fileName)
void setParameter(const std::string &name, const std::string &value)
virtual FunctionUnitNavigator functionUnitNavigator() 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 void readParameters()=0
void addRFImplementation(RFImplementationLocation *implementation)
TTAMachine::Machine * machine_
The loaded machine.
void readImemParameters(MemInfo &imem) const
std::string errorMessage() const
static const std::string DIRECTORY_SEPARATOR
static void removeUnconnectedSockets(TTAMachine::Machine &machine, std::ostream &warningStream)
static MachInfoCmdLineOptions options
IDF::MachineImplementation * idf_
The loaded machine implementation.
void setICDecoderParameter(const std::string &name, const std::string &value)
virtual RegisterFileNavigator registerFileNavigator() const
void loadBinaryEncoding(const BinaryEncoding &bem)
std::string icDecoderPluginFile() const
void loadMachineImplementation(const IDF::MachineImplementation &idf)
const ProGeContext & generatorContext() const
void addFUImplementation(FUImplementationLocation *implementation)
UnitImplementationLocation IUImplementationLocation
BinaryEncoding * bem_
The loaded binary encoding map.
std::string errorMessage(int index) const
void loadMachine(const TTAMachine::Machine &adf)
HDL
HDLs supported by ProGe.
TTAMachine::Machine * readMachine()
virtual std::string hdbFile() const
bool hasICDecoderPluginName() const
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)
void setICDecoderPluginFile(const std::string &file)
SpecialRegisterPort * returnAddressPort() const
std::string icDecoderPluginName() const
virtual ULongWord end() const
PluginTools pluginTool_
Tool for loading plugin.
BinaryEncoding * generate()
void generateProcessor(const ProGeOptions &options, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream)
void addIUImplementation(RFImplementationLocation *implementation)
virtual int width() const
std::string warningMessage(int index) const
void generateIDF(const ProGeOptions &options, std::ostream &verboseStream)
void checkIfNull(void *nullPointer, const std::string &errorMsg)
BinaryEncoding * readBinaryEncoding()
std::string encodingMapName()