Go to the documentation of this file.
87 std::string hdbFile,
VhdlSim simulator):
90 simulator_(simulator),
91 verbose_(
false), leaveDirty_(
false), tempDir_(
"") {
107 std::string hdbFile,
VhdlSim simulator,
bool verbose,
bool leaveDirty):
110 simulator_(simulator),
111 verbose_(verbose), leaveDirty_(leaveDirty), tempDir_(
"") {
123 std::cout <<
"No testbench files created" << std::endl;
125 std::cout <<
"Testbench files are stored at " <<
tempDir_
160 __FILE__, __LINE__,
"ImplementationTester",
182 std::ostringstream errorStream;
183 errorStream <<
"ID " << entryID <<
" does not exist in HDB "
185 reason = errorStream.str();
189 reason =
"FU entry does not have architecture";
192 reason =
"FU entry does not have implementation";
195 reason =
"Simulation of memory accessing FUs is not supported";
198 reason =
"Simulation of non-pipelined FUs in not supported";
201 reason =
"Simulation of FUs with external ports is not supported";
204 reason =
"FU has only one port";
226 std::ostringstream errorStream;
227 errorStream <<
"ID " << entryID <<
" does not exist in HDB "
229 reason = errorStream.str();
233 reason =
"RF entry does not have architecture";
236 reason =
"RF entry does not have implementation";
239 reason =
"RF does not have a read port";
242 reason =
"RF does not have a write port";
245 reason =
"RF has bidirectional ports";
248 reason =
"RF does not have latency of 1 cycle";
264 const int entryID, std::vector<std::string>& errors) {
268 IOException exp(__FILE__, __LINE__,
"ImplementationTester",
269 "Couldn't create temp directory");
277 __FILE__, __LINE__,
"ImplementationTester",
278 "Cannot test FU: " + reason);
286 std::ostringstream errorStream;
287 errorStream <<
"ID " << entryID <<
" does not exist in HDB "
289 string errorMsg = errorStream.str();
290 errors.push_back(errorMsg);
322 const int entryID, std::vector<std::string>& errors) {
326 IOException exp(__FILE__, __LINE__,
"ImplementationTester",
327 "Couldn't create temp directory");
335 __FILE__, __LINE__,
"ImplementationTester",
336 "Cannot test RF: " + reason);
344 std::ostringstream errorStream;
345 errorStream <<
"ID " << entryID <<
" does not exist in HDB "
347 string errorMsg = errorStream.str();
348 errors.push_back(errorMsg);
373 __FILE__, __LINE__,
"ImplementationTester",
374 "HDB is not defined");
386 __FILE__, __LINE__,
"ImplementationTester",
387 "HDB is not defined");
431 __FILE__, __LINE__,
"ImplementationTester",
432 "HDB is not defined");
444 __FILE__, __LINE__,
"ImplementationTester",
445 "HDB is not defined");
469 std::ostringstream name;
471 <<
"tb_fu_" <<
id <<
".vhdl";
484 std::ostringstream name;
486 <<
"tb_rf_" <<
id <<
".vhdl";
493 std::ofstream& fileStream, std::string fileName)
const {
495 fileStream.open(fileName.c_str());
497 IOException(__FILE__, __LINE__,
"ImplementationTester",
498 "Failed to open file " + fileName +
" for writing!");
512 std::vector<std::string>& files)
const {
515 string fullPath =
"";
523 files.push_back(fullPath);
537 std::string testbench,
539 std::vector<std::string>& errors)
const {
541 vector<string> hdlFiles;
bool canTestRF(const int entryID, std::string &reason)
BlockImplementationFile & file(int index) const
void openHdb(std::string hdbFile)
static bool removeFileOrDirectory(const std::string &path)
virtual bool hasImplementation() const
virtual bool hasAddressSpace() const
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
bool fuFullyPipelined(HDB::FUEntry *fuEntry) const
std::string fuTbName(int id) const
virtual bool simulate(std::vector< std::string > &errors)=0
int implementationFileCount() const
TTAMachine::FunctionUnit & architecture() const
void createTestbench(TestbenchGenerator *tbGen, std::string tbName) const
void setVhdlSimulator(VhdlSim simulator)
bool canTestFU(const int entryID, std::string &reason)
virtual ~ImplementationTester()
static std::string absolutePathOf(const std::string &pathName)
RFArchitecture & architecture() const
bool simulateTestbench(std::string testbench, const HDB::HWBlockImplementation *implementation, std::vector< std::string > &errors) const
bool fuHasMemoryAccess(HDB::FUEntry *fuEntry) const
virtual bool hasArchitecture() const
std::set< RowID > fuEntryIDs() const
FUArchitecture & architecture() const
static std::string directoryOfPath(const std::string fileName)
RFImplementation & implementation() const
std::string pathToFile() const
std::string errorMessage() const
virtual int pipelineElementCount() const
bool fuHasExternalPorts(HDB::FUEntry *fuEntry) const
static const std::string DIRECTORY_SEPARATOR
std::set< RowID > rfEntryIDs() const
HDB::FUEntry * fuEntryFromHdb(int entryID) const
find Finds info of the inner loops in the false
std::set< int > rfEntryIDs() const
std::set< int > fuEntryIDs() const
bool fuHasOnePort(HDB::FUEntry *fuEntry) const
int architecturePortCount() const
int readPortCount() const
virtual bool compile(std::vector< std::string > &errors)=0
void createListOfSimulationFiles(const HDB::HWBlockImplementation *impl, std::vector< std::string > &files) const
int bidirPortCount() const
virtual bool hasImplementation() const
FUImplementation & implementation() const
std::string rfTbName(int id) const
virtual void generateTestbench(std::ofstream &file)=0
static bool isAbsolutePath(const std::string &pathName)
FUEntry * fuByEntryID(RowID id) const
static std::string createTempDirectory(const std::string &path="/tmp", const std::string &tempDirPrefix="tmp_tce_")
virtual bool hasArchitecture() const
bool validateFU(const int entryID, std::vector< std::string > &errors)
int externalPortCount() const
int writePortCount() const
void openTbFile(std::ofstream &fileStream, std::string fileName) const
RFEntry * rfByEntryID(RowID id) const
bool validateRF(const int entryID, std::vector< std::string > &errors)
static CachedHDBManager & instance(const std::string &hdbFile)
HDB::RFEntry * rfEntryFromHdb(int entryID) const