OpenASIP 2.2
|
#include <ProGeTestBenchGenerator.hh>
Public Member Functions | |
ProGeTestBenchGenerator () | |
virtual | ~ProGeTestBenchGenerator () |
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") |
Private Member Functions | |
void | copyTestBenchFiles (const std::string &dstDirectory) |
void | createFile (const std::string &fileName) |
std::string | getSignalMapping (const std::string &fuName, const std::string &epName, bool widthIsOne, const std::string &memoryName, const std::string &memoryLine) |
void | createTBConstFile (std::string dstDirectory, const std::string &dmemImage="dmem_init.img", const std::string &dataWidth="", const std::string &addrWidth="") |
void | createProcArchVhdl (const std::string &dstDirectory, const std::string &topLevelVhdl, const std::string &signalMappings) |
Private Attributes | |
TCEString | entityStr_ |
ProGe::HDL | language_ |
Class for test bench generating objects.
Base class for script generating.
Definition at line 54 of file ProGeTestBenchGenerator.hh.
ProGeTestBenchGenerator::ProGeTestBenchGenerator | ( | ) |
|
virtual |
|
private |
Copies general testbench files to given destination directory.
dstDirectory | Destination directory for test bench files. |
Definition at line 571 of file ProGeTestBenchGenerator.cc.
References FileSystem::copy(), FileSystem::createDirectory(), Environment::dataDirPath(), FileSystem::DIRECTORY_SEPARATOR, DS, entityStr_, FileSystem::fileIsDirectory(), FileSystem::findFromDirectory(), HDLTemplateInstantiator::instantiateTemplateFile(), language_, HDLTemplateInstantiator::setEntityString(), and ProGe::VHDL.
Referenced by generate().
|
private |
Creates a file.
Name | of the script file to be created. |
IOException | Couldn't create the file. |
Definition at line 616 of file ProGeTestBenchGenerator.cc.
References __func__, FileSystem::createFile(), and FileSystem::removeFileOrDirectory().
Referenced by createTBConstFile().
|
private |
Creates a new proc_arch vhdl file from a template file.
Writes a new toplevel and core signal mapping.
dstDirectory | Directory where new proc_arch file is created. |
topLevelVhdl | Toplevel vhdl file where toplevel is read for writing to the proc_arch file. |
signalMappings | Core signal mappings as a string to be writen to the proc_arch file. |
IOException | Problems in handling files. |
Definition at line 351 of file ProGeTestBenchGenerator.cc.
References __func__, FileSystem::appendReplaceFile(), Environment::dataDirPath(), FileSystem::DIRECTORY_SEPARATOR, entityStr_, FileSystem::fileIsReadable(), FileSystem::fileIsWritable(), language_, FileSystem::readBlockFromFile(), HDLTemplateInstantiator::setEntityString(), and ProGe::VHDL.
Referenced by generate().
|
private |
Creates test bench constants package vhdl file.
dstDirectory | Directory where the file is created. |
dataWidth | Memory data width. |
addrWidth | Memory address width. |
Definition at line 499 of file ProGeTestBenchGenerator.cc.
References createFile(), FileSystem::DIRECTORY_SEPARATOR, language_, and ProGe::VHDL.
Referenced by generate().
void ProGeTestBenchGenerator::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" |
||
) |
Generates testbench to given destination directory.
At the moment multiple address spaces for FUs are not supported. Only one data memory and instruction memory are usable. There is no code for generating new memory components, this is a todo item for later. There is also additional limit that at most two function units can use the one address space. Most of the TODO comments mark the places where code needs to be changed to accomodate the removal of these limitations.
mach | Machine for which test bench is generated |
implementation | Implementation of the machine |
dstDirectory | Destination directory where test bench is generated |
progeOutDir | Processor generators output directory |
IOException | Problems in handling files. |
OutOfRange | Too many FUs using same address space or same FU uses more than one address space. |
InvalidName | |
InvalidData | FU was not found from HDB. |
Definition at line 119 of file ProGeTestBenchGenerator.cc.
References __func__, ADDR_WIDTH, copyTestBenchFiles(), TTAMachine::Machine::Navigator< ComponentType >::count(), createProcArchVhdl(), createTBConstFile(), FileSystem::DIRECTORY_SEPARATOR, TTAMachine::AddressSpace::end(), entityStr_, Exception::errorMessage(), HDB::FUImplementation::externalPort(), HDB::FUImplementation::externalPortCount(), FU, HDB::HDBManager::fuByEntryID(), IDF::MachineImplementation::fuImplementation(), TTAMachine::Machine::functionUnitNavigator(), getSignalMapping(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), IDF::MachineImplementation::icDecoderParameterValue(), IDF::UnitImplementationLocation::id(), HDB::FUEntry::implementation(), implementation, HDB::HDBRegistry::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), language_, HDB::ExternalPort::name(), HDB::Parameter::name, TTAMachine::Component::name(), HDB::FUImplementation::parameter(), HDB::FUImplementation::parameterCount(), TTAMachine::HWOperation::port(), StringTools::replaceAllOccurrences(), Conversion::toString(), HDB::Parameter::type, HDB::Parameter::value, ProGe::VHDL, TTAMachine::BaseFUPort::width(), and HDB::ExternalPort::widthFormula().
Referenced by ProGe::ProGeUI::generateTestBench().
|
private |
Creates core signal mapping for FUs external port -> data memory.
Maps signals according to some defined naming "standard".
fuName | Function unit name. |
epName | External port name. |
widthIsOne | True if port width is one, false otherwise. |
memoryName | Memory name. |
memoryLine | Memory port that is used (for dual port memory a or b). |
InvalidName | External port name was invalid (not matching). |
Definition at line 446 of file ProGeTestBenchGenerator.cc.
References __func__, language_, and ProGe::VHDL.
Referenced by generate().
|
private |
Definition at line 80 of file ProGeTestBenchGenerator.hh.
Referenced by copyTestBenchFiles(), createProcArchVhdl(), and generate().
|
private |
Definition at line 81 of file ProGeTestBenchGenerator.hh.
Referenced by copyTestBenchFiles(), createProcArchVhdl(), createTBConstFile(), generate(), and getSignalMapping().