OpenASIP
2.0
|
#include <ImplementationTester.hh>
Public Member Functions | |
ImplementationTester () | |
ImplementationTester (std::string hdbFile, VhdlSim simulator) | |
ImplementationTester (std::string hdbFile, VhdlSim simulator, bool verbose, bool leaveDirty) | |
virtual | ~ImplementationTester () |
void | setVhdlSimulator (VhdlSim simulator) |
void | openHdb (std::string hdbFile) |
bool | canTestFU (const int entryID, std::string &reason) |
bool | canTestRF (const int entryID, std::string &reason) |
bool | validateFU (const int entryID, std::vector< std::string > &errors) |
bool | validateRF (const int entryID, std::vector< std::string > &errors) |
std::set< int > | fuEntryIDs () const |
std::set< int > | rfEntryIDs () const |
Private Member Functions | |
bool | fuHasMemoryAccess (HDB::FUEntry *fuEntry) const |
bool | fuFullyPipelined (HDB::FUEntry *fuEntry) const |
bool | fuHasExternalPorts (HDB::FUEntry *fuEntry) const |
bool | fuHasOnePort (HDB::FUEntry *fuEntry) const |
HDB::FUEntry * | fuEntryFromHdb (int entryID) const |
HDB::RFEntry * | rfEntryFromHdb (int entryID) const |
bool | createTempDir () |
std::string | fuTbName (int id) const |
std::string | rfTbName (int id) const |
void | openTbFile (std::ofstream &fileStream, std::string fileName) const |
void | createListOfSimulationFiles (const HDB::HWBlockImplementation *impl, std::vector< std::string > &files) const |
void | createTestbench (TestbenchGenerator *tbGen, std::string tbName) const |
bool | simulateTestbench (std::string testbench, const HDB::HWBlockImplementation *implementation, std::vector< std::string > &errors) const |
Private Attributes | |
std::string | hdbFile_ |
HDB::HDBManager * | hdb_ |
VhdlSim | simulator_ |
bool | verbose_ |
bool | leaveDirty_ |
std::string | tempDir_ |
Definition at line 52 of file ImplementationTester.hh.
ImplementationTester::ImplementationTester | ( | ) |
ImplementationTester::ImplementationTester | ( | std::string | hdbFile, |
VhdlSim | simulator | ||
) |
Constructor
hdbFile | Name of the hdb file |
simulator | Name of the HDL simulator to be used |
Definition at line 86 of file ImplementationTester.cc.
References FileSystem::absolutePathOf(), hdbFile_, and openHdb().
ImplementationTester::ImplementationTester | ( | std::string | hdbFile, |
VhdlSim | simulator, | ||
bool | verbose, | ||
bool | leaveDirty | ||
) |
Constructor
hdbFile | Name of the hdb file |
simulator | Name of the HDL simulator to be used |
verbose | Enable verbose messages |
leaveDirty | Don't delete created testbench files |
Definition at line 106 of file ImplementationTester.cc.
References FileSystem::absolutePathOf(), hdbFile_, and openHdb().
|
virtual |
Destructor
Definition at line 120 of file ImplementationTester.cc.
References leaveDirty_, FileSystem::removeFileOrDirectory(), and tempDir_.
bool ImplementationTester::canTestFU | ( | const int | entryID, |
std::string & | reason | ||
) |
Tests whether a FU can be tested
entryID | Entry ID of the FU |
reason | If FU can't be tested this string holds the reason why |
Definition at line 175 of file ImplementationTester.cc.
References fuEntryFromHdb(), fuFullyPipelined(), fuHasExternalPorts(), fuHasMemoryAccess(), fuHasOnePort(), HDB::FUEntry::hasArchitecture(), HDB::FUEntry::hasImplementation(), and hdbFile_.
Referenced by HDBTester::testFU(), and validateFU().
bool ImplementationTester::canTestRF | ( | const int | entryID, |
std::string & | reason | ||
) |
Tests whether a RF can be tested
entryID | Entry ID of the RF |
reason | If RF can't be tested this string holds the reason why |
Definition at line 219 of file ImplementationTester.cc.
References HDB::RFEntry::architecture(), HDB::RFArchitecture::bidirPortCount(), HDB::RFEntry::hasArchitecture(), HDB::RFEntry::hasImplementation(), hdbFile_, HDB::RFArchitecture::latency(), HDB::RFArchitecture::readPortCount(), rfEntryFromHdb(), and HDB::RFArchitecture::writePortCount().
Referenced by HDBTester::testRF(), and validateRF().
|
private |
Creates a list of HDL files of a FU/RF implementation
impl | FU/RF implementation |
files | Vector containing the HDL files |
Definition at line 510 of file ImplementationTester.cc.
References FileSystem::DIRECTORY_SEPARATOR, FileSystem::directoryOfPath(), HDB::HWBlockImplementation::file(), hdbFile_, HDB::HWBlockImplementation::implementationFileCount(), FileSystem::isAbsolutePath(), and HDB::BlockImplementationFile::pathToFile().
Referenced by simulateTestbench().
|
private |
Definition at line 453 of file ImplementationTester.cc.
References FileSystem::createTempDirectory(), and tempDir_.
Referenced by validateFU(), and validateRF().
|
private |
Definition at line 566 of file ImplementationTester.cc.
References TestbenchGenerator::generateTestbench(), and openTbFile().
Referenced by validateFU(), and validateRF().
|
private |
Definition at line 427 of file ImplementationTester.cc.
References HDB::HDBManager::fuByEntryID(), and hdb_.
Referenced by canTestFU(), and validateFU().
std::set< int > ImplementationTester::fuEntryIDs | ( | ) | const |
Definition at line 369 of file ImplementationTester.cc.
References HDB::HDBManager::fuEntryIDs(), and hdb_.
Referenced by HDBTester::testAllEntries().
|
private |
Definition at line 403 of file ImplementationTester.cc.
References HDB::FUEntry::architecture(), HDB::FUArchitecture::architecture(), and TTAMachine::FunctionUnit::pipelineElementCount().
Referenced by canTestFU().
|
private |
Definition at line 411 of file ImplementationTester.cc.
References HDB::FUImplementation::externalPortCount(), and HDB::FUEntry::implementation().
Referenced by canTestFU().
|
private |
Definition at line 395 of file ImplementationTester.cc.
References HDB::FUEntry::architecture(), HDB::FUArchitecture::architecture(), and TTAMachine::FunctionUnit::hasAddressSpace().
Referenced by canTestFU().
|
private |
Definition at line 419 of file ImplementationTester.cc.
References HDB::FUImplementation::architecturePortCount(), and HDB::FUEntry::implementation().
Referenced by canTestFU().
|
private |
Creates name for the testbench file
id | ID number of the FU |
Definition at line 467 of file ImplementationTester.cc.
References FileSystem::DIRECTORY_SEPARATOR, and tempDir_.
Referenced by validateFU().
void ImplementationTester::openHdb | ( | std::string | hdbFile | ) |
Tries to open hdb file
hdbFile | Name of the hdb file |
Definition at line 154 of file ImplementationTester.cc.
References Exception::errorMessage(), hdb_, hdbFile_, and HDB::CachedHDBManager::instance().
Referenced by ImplementationTester().
|
private |
|
private |
Definition at line 440 of file ImplementationTester.cc.
References hdb_, and HDB::HDBManager::rfByEntryID().
Referenced by canTestRF(), and validateRF().
std::set< int > ImplementationTester::rfEntryIDs | ( | ) | const |
Definition at line 382 of file ImplementationTester.cc.
References hdb_, and HDB::HDBManager::rfEntryIDs().
Referenced by HDBTester::testAllEntries().
|
private |
Creates name for the testbench file
id | ID number of the RF |
Definition at line 482 of file ImplementationTester.cc.
References FileSystem::DIRECTORY_SEPARATOR, and tempDir_.
Referenced by validateRF().
void ImplementationTester::setVhdlSimulator | ( | VhdlSim | simulator | ) |
Set VHDL simulator to be used in simulation
simulator | Name of the HDL simulator to be used |
Definition at line 143 of file ImplementationTester.cc.
References simulator_.
|
private |
Compiles and simulates the testbech
testbench | Name of the testbench file |
implementation | Implementation of the FU/RF |
errors | Error messages from the compilation/simulation |
Definition at line 536 of file ImplementationTester.cc.
References ImplementationSimulator::compile(), createListOfSimulationFiles(), implementation, leaveDirty_, SIM_GHDL, SIM_MODELSIM, ImplementationSimulator::simulate(), simulator_, and verbose_.
Referenced by validateFU(), and validateRF().
bool ImplementationTester::validateFU | ( | const int | entryID, |
std::vector< std::string > & | errors | ||
) |
Validates that FU behaviour model and implementation are equal
entryID | Entry ID of the FU |
errors | Error messages from the validation process |
Definition at line 263 of file ImplementationTester.cc.
References canTestFU(), createTempDir(), createTestbench(), fuEntryFromHdb(), fuTbName(), hdbFile_, HDB::FUEntry::implementation(), leaveDirty_, FileSystem::removeFileOrDirectory(), simulateTestbench(), and tempDir_.
Referenced by HDBTester::testFU().
bool ImplementationTester::validateRF | ( | const int | entryID, |
std::vector< std::string > & | errors | ||
) |
Validates that RF behaviour model and implementation are equal
entryID | Entry ID of the RF |
errors | Error messages from the validation process |
Definition at line 321 of file ImplementationTester.cc.
References canTestRF(), createTempDir(), createTestbench(), hdbFile_, HDB::RFEntry::implementation(), leaveDirty_, FileSystem::removeFileOrDirectory(), rfEntryFromHdb(), rfTbName(), simulateTestbench(), and tempDir_.
Referenced by HDBTester::testRF().
|
private |
Definition at line 117 of file ImplementationTester.hh.
Referenced by fuEntryFromHdb(), fuEntryIDs(), openHdb(), rfEntryFromHdb(), and rfEntryIDs().
|
private |
Definition at line 116 of file ImplementationTester.hh.
Referenced by canTestFU(), canTestRF(), createListOfSimulationFiles(), ImplementationTester(), openHdb(), validateFU(), and validateRF().
|
private |
Definition at line 121 of file ImplementationTester.hh.
Referenced by simulateTestbench(), validateFU(), validateRF(), and ~ImplementationTester().
|
private |
Definition at line 119 of file ImplementationTester.hh.
Referenced by setVhdlSimulator(), and simulateTestbench().
|
private |
Definition at line 123 of file ImplementationTester.hh.
Referenced by createTempDir(), fuTbName(), rfTbName(), validateFU(), validateRF(), and ~ImplementationTester().
|
private |
Definition at line 120 of file ImplementationTester.hh.
Referenced by simulateTestbench().