OpenASIP
2.0
|
#include <BlockSourceCopier.hh>
Public Member Functions | |
BlockSourceCopier (const IDF::MachineImplementation &implementation, TCEString entityStr, const ProGe::HDL language) | |
virtual | ~BlockSourceCopier () |
void | copyShared (const std::string &dstDirectory) |
void | copyProcessorSpecific (const std::string &dstDirectory) |
void | instantiateHDLTemplate (const std::string &srcFile, const std::string &dstDirectory, std::string newName="0") |
HDLTemplateInstantiator & | getTemplateInstatiator () |
Private Member Functions | |
void | copyBaseRFFiles (const IDF::RFImplementationLocation &implementation, const std::string &dstDirectory) |
void | copyFiles (const HDB::HWBlockImplementation &implementation, const std::string &hdbFile, const std::string &dstDirectory) |
void | copyFromTemplate (const std::string &templateFile, const std::string &dstDirectory) |
void | setCopied (const std::string &file) |
bool | isCopied (const std::string &file) const |
Private Attributes | |
const IDF::MachineImplementation & | implementation_ |
The IDF object model. More... | |
TCEString | entityStr_ |
const HDL | language_ |
std::set< std::string > | copiedFiles_ |
Copied files. More... | |
HDLTemplateInstantiator | instantiator_ |
Object that instantiates templates. More... | |
Copies the block definition files used in the processor implementation to the output directory of ProGe.
Definition at line 63 of file BlockSourceCopier.hh.
ProGe::BlockSourceCopier::BlockSourceCopier | ( | const IDF::MachineImplementation & | implementation, |
TCEString | entityStr, | ||
const ProGe::HDL | language | ||
) |
The constructor.
Definition at line 67 of file BlockSourceCopier.cc.
References entityStr_, instantiator_, and HDLTemplateInstantiator::setEntityString().
|
virtual |
|
private |
Copies the block definition files of the given RF implementation to the proper subdirectories of the given directory.
implementation | The location of the RF implementation. |
dstDirectory | The destination "root" directory. |
IOException | If some file cannot be copied or HDB cannot be opened. |
Definition at line 251 of file BlockSourceCopier.cc.
References assert, copyFiles(), HDB::RFEntry::hasImplementation(), HDB::RFEntry::implementation(), implementation, and HDB::HDBManager::rfByEntryID().
Referenced by copyShared().
|
private |
Copies the block definition files of the given HW block implementation to the proper subdirectories of the given directory.
implementation | The block implementation. |
hdbFile | The HDB file that contains the block. |
dstDirectory | The destination "root" directory. |
UnreachableStream | If some file cannot be copied to the destination directory. |
FileNotFound | If the file referred to in HDB is not found. |
Definition at line 276 of file BlockSourceCopier.cc.
References __func__, FileSystem::copy(), FileSystem::createDirectory(), FileSystem::DIRECTORY_SEPARATOR, DS, Exception::errorMessage(), FileSystem::fileExists(), FileSystem::fileOfPath(), FileSystem::findFileInSearchPaths(), HDB::BlockImplementationFile::format(), implementation, isCopied(), language_, HDB::BlockImplementationFile::pathToFile(), setCopied(), ProGe::Verilog, ProGe::VHDL, and Environment::vhdlPaths().
Referenced by copyBaseRFFiles(), and copyShared().
|
private |
void ProGe::BlockSourceCopier::copyProcessorSpecific | ( | const std::string & | dstDirectory | ) |
Copies the block definition files of the blocks given in IDF to proper subdirectories of the given directory.
This method copies the processor-specific files that are not reused between multiple TTAs.
dstDirectory | The destination "root" directory. |
IOException | If some file cannot be copied or HDB cannot be opened. |
Definition at line 145 of file BlockSourceCopier.cc.
References __func__, assert, FileSystem::copy(), FileSystem::createDirectory(), Environment::dataDirPath(), IDF::MachineImplementation::decompressorFile(), FileSystem::DIRECTORY_SEPARATOR, DS, FileSystem::fileExists(), FileSystem::fileOfPath(), IDF::MachineImplementation::hasDecompressorFile(), implementation_, HDLTemplateInstantiator::instantiateTemplateFile(), instantiator_, language_, and ProGe::Verilog.
Referenced by ProGe::ProcessorGenerator::generateProcessor().
void ProGe::BlockSourceCopier::copyShared | ( | const std::string & | dstDirectory | ) |
Copies the block definition files of the blocks given in IDF to proper subdirectories of the given directory.
This method copies the files that can and are potentially shared by multiple TTAs in the same system design. That is, the FU, RF and IU implementations.
dstDirectory | The destination "root" directory. |
IOException | If some file cannot be copied or HDB cannot be opened. |
Definition at line 96 of file BlockSourceCopier.cc.
References assert, FileSystem::copy(), copyBaseRFFiles(), copyFiles(), Environment::dataDirPath(), FileSystem::DIRECTORY_SEPARATOR, DS, HDB::HDBManager::fuByEntryID(), IDF::MachineImplementation::fuImplementation(), IDF::MachineImplementation::fuImplementationCount(), HDB::FUEntry::hasImplementation(), IDF::UnitImplementationLocation::hdbFile(), IDF::UnitImplementationLocation::id(), HDB::FUEntry::implementation(), implementation_, IDF::MachineImplementation::iuImplementation(), IDF::MachineImplementation::iuImplementationCount(), language_, IDF::MachineImplementation::rfImplementation(), IDF::MachineImplementation::rfImplementationCount(), UTILITY_VERILOG_FILE, UTILITY_VHDL_FILE, and ProGe::VHDL.
Referenced by ProGe::ProcessorGenerator::generateProcessor().
HDLTemplateInstantiator & ProGe::BlockSourceCopier::getTemplateInstatiator | ( | ) |
Returns reference to template instantiator instance used by this.
Definition at line 237 of file BlockSourceCopier.cc.
References instantiator_.
Referenced by DefaultICDecoderGenerator::generate(), and ProGe::ProcessorGenerator::generateProcessor().
void ProGe::BlockSourceCopier::instantiateHDLTemplate | ( | const std::string & | srcFile, |
const std::string & | dstDirectory, | ||
std::string | newName = "0" |
||
) |
Copies given template file to given directory and instantiates it, ie. removes the .tmpl from the filename and converts it to .vhdl while replacing occurances of "ENTITY_STR" with entityStr_.
srcFile | The location and name of the .tmpl file to copy |
dstDirectory | The directory to copy to and instantiate in. |
newName | New name for the file. If "0", only ".tmpl" is removed. |
Definition at line 202 of file BlockSourceCopier.cc.
References __func__, FileSystem::createDirectory(), FileSystem::DIRECTORY_SEPARATOR, DS, FileSystem::fileExists(), FileSystem::fileOfPath(), HDLTemplateInstantiator::instantiateTemplateFile(), and instantiator_.
Referenced by DefaultICDecoderGenerator::generate().
|
private |
Tells whether the given file is copied already.
file | The file. |
Definition at line 357 of file BlockSourceCopier.cc.
References AssocTools::containsKey(), and copiedFiles_.
Referenced by copyFiles().
|
private |
Marks the file as copied.
file | The file. |
Definition at line 344 of file BlockSourceCopier.cc.
References copiedFiles_.
Referenced by copyFiles().
|
private |
Copied files.
Definition at line 99 of file BlockSourceCopier.hh.
Referenced by isCopied(), and setCopied().
|
private |
Definition at line 96 of file BlockSourceCopier.hh.
Referenced by BlockSourceCopier().
|
private |
The IDF object model.
Definition at line 95 of file BlockSourceCopier.hh.
Referenced by copyProcessorSpecific(), and copyShared().
|
private |
Object that instantiates templates.
Definition at line 101 of file BlockSourceCopier.hh.
Referenced by BlockSourceCopier(), copyProcessorSpecific(), getTemplateInstatiator(), and instantiateHDLTemplate().
|
private |
Definition at line 97 of file BlockSourceCopier.hh.
Referenced by copyFiles(), copyProcessorSpecific(), and copyShared().