OpenASIP
2.0
|
#include <DesignSpaceExplorer.hh>
Public Member Functions | |
DesignSpaceExplorer () | |
virtual | ~DesignSpaceExplorer () |
virtual void | setDSDB (DSDBManager &dsdb) |
virtual bool | evaluate (const DSDBManager::MachineConfiguration &configuration, CostEstimates &results=dummyEstimate_, bool estimate=false) |
virtual DSDBManager & | db () |
std::vector< DesignSpaceExplorerPlugin * > | getPlugins () |
RowID | createImplementationAndStore (const DSDBManager::MachineConfiguration &conf, const double &frequency=0.0, const double &maxArea=0.0, const bool &createEstimates=true, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb") |
bool | createImplementation (const DSDBManager::MachineConfiguration &conf, DSDBManager::MachineConfiguration &newConf, const double &frequency=0.0, const double &maxArea=0.0, const bool &createEstimates=true, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb") |
IDF::MachineImplementation * | selectComponents (const TTAMachine::Machine &mach, const double &frequency=0.0, const double &maxArea=0.0, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb") const |
void | createEstimateData (const TTAMachine::Machine &mach, const IDF::MachineImplementation &idf, CostEstimator::AreaInGates &area, CostEstimator::DelayInNanoSeconds &longestPathDelay) |
RowID | addConfToDSDB (const DSDBManager::MachineConfiguration &conf) |
Static Public Member Functions | |
static DesignSpaceExplorerPlugin * | loadExplorerPlugin (const std::string &pluginName, DSDBManager *dsdb=NULL) |
Protected Member Functions | |
TTAProgram::Program * | schedule (const std::string applicationFile, TTAMachine::Machine &machine, TCEString paramOptions="-O3") |
const ExecutionTrace * | simulate (const TTAProgram::Program &program, const TTAMachine::Machine &machine, const TestApplication &testApplication, const ClockCycleCount &maxCycles, ClockCycleCount &runnedCycles, const bool tracing, const bool useCompiledSimulation=false, std::vector< ClockCycleCount > *executionCounts=NULL) |
Private Attributes | |
DSDBManager * | dsdb_ |
Design space database where results are stored. More... | |
CostEstimator::Estimator | estimator_ |
The estimator frontend. More... | |
std::ostringstream * | oStream_ |
Output stream. More... | |
Static Private Attributes | |
static PluginTools | pluginTool_ |
The plugin tool. More... | |
static CostEstimates | dummyEstimate_ |
Used for the default evaluate() argument. More... | |
Design space explorer interface provides methods to automatically evaluate machine configurations and select best implementations to the processor components according the test applications set in Design Space Database (DSDB).
Definition at line 70 of file DesignSpaceExplorer.hh.
DesignSpaceExplorer::DesignSpaceExplorer | ( | ) |
The constructor.
Definition at line 82 of file DesignSpaceExplorer.cc.
References OperationGlobals::setOutputStream().
|
virtual |
The destructor.
Definition at line 93 of file DesignSpaceExplorer.cc.
RowID DesignSpaceExplorer::addConfToDSDB | ( | const DSDBManager::MachineConfiguration & | conf | ) |
Add given configuration to the database.
conf | Configuration to be added to the database. |
dsdb | Database where to add the configuration. |
Definition at line 755 of file DesignSpaceExplorer.cc.
References debugLog, and Exception::errorMessage().
void DesignSpaceExplorer::createEstimateData | ( | const TTAMachine::Machine & | mach, |
const IDF::MachineImplementation & | idf, | ||
CostEstimator::AreaInGates & | area, | ||
CostEstimator::DelayInNanoSeconds & | longestPathDelay | ||
) |
creates estimate data for machine and idf.
mach | Machine mathcing given idf. |
idf | Implementation definition for given machine. |
area | Estimated area cost. |
longestPathDelay | Estimated longest path delay. |
Definition at line 735 of file DesignSpaceExplorer.cc.
bool DesignSpaceExplorer::createImplementation | ( | const DSDBManager::MachineConfiguration & | conf, |
DSDBManager::MachineConfiguration & | newConf, | ||
const double & | frequency = 0.0 , |
||
const double & | maxArea = 0.0 , |
||
const bool & | createEstimates = true , |
||
const std::string & | icDec = "DefaultICDecoder" , |
||
const std::string & | icDecHDB = "asic_130nm_1.5V.hdb" |
||
) |
Selects components for a machine and ands them to a given config.
conf | MachineConfiguration of which architecture is used. |
newConf | MachineConfiguration where idf is to be added. |
frequency | The minimum frequency of the implementations. |
maxArea | Maximum area for implementations. |
createEstimates | Boolean for creating estimates. |
icDec | IC decoder to be used. |
icDecHDB | IC decoder HDB file. |
Definition at line 650 of file DesignSpaceExplorer.cc.
References DSDBManager::MachineConfiguration::architectureID, DSDBManager::MachineConfiguration::hasImplementation, and DSDBManager::MachineConfiguration::implementationID.
RowID DesignSpaceExplorer::createImplementationAndStore | ( | const DSDBManager::MachineConfiguration & | conf, |
const double & | frequency = 0.0 , |
||
const double & | maxArea = 0.0 , |
||
const bool & | createEstimates = true , |
||
const std::string & | icDec = "DefaultICDecoder" , |
||
const std::string & | icDecHDB = "asic_130nm_1.5V.hdb" |
||
) |
Selects components for a machine and creates a new configuration.
Also stores the new configuration to the dsdb and returns it's rowID.
conf | MachineConfiguration of which architecture is used. |
frequency | The minimum frequency of the implementations. |
maxArea | Maximum area for implementations. |
createEstimates | Boolean for creating estimates. |
icDec | IC decoder to be used. |
icDecHDB | IC decoder HDB file. |
Definition at line 597 of file DesignSpaceExplorer.cc.
References DSDBManager::MachineConfiguration::architectureID, DSDBManager::MachineConfiguration::hasImplementation, and DSDBManager::MachineConfiguration::implementationID.
|
virtual |
Returns the DSDBManager of the current exploration process.
Definition at line 300 of file DesignSpaceExplorer.cc.
|
virtual |
Evaluates one processor configuration (architecture+implementation pair).
Evaluates the total area and the longest path delay of the current processor configuration (architecture+implementation pair) and also the energy consumed in each program in the DSDB with this processor configuration. Also configurations without implementation can be evaluated but no cost estimations are performed so the CostEstimate object won't include area, energy and longest path delay estimations. Estimation is not included either if the estimate flag is set to false.
configuration | Machine configuration (architecture, implementation). |
result | CostEstimates object where the configuration cost estimates are stored if the evaluation succeeds. |
estimate | Flag indicating that the evaluate will also estimate the given configuration. |
InvalidData | thrown in case there are flaws in the application configuration which leads to evaluation failure. |
Definition at line 133 of file DesignSpaceExplorer.cc.
References __func__, TestApplication::applicationPath(), DSDBManager::MachineConfiguration::architectureID, TestApplication::correctOutput(), debugLog, Exception::errorMessageStack(), TestApplication::hasCorrectOutput(), DSDBManager::MachineConfiguration::hasImplementation, DSDBManager::MachineConfiguration::implementationID, CostEstimates::setArea(), CostEstimates::setEnergy(), and CostEstimates::setLongestPathDelay().
Referenced by MinimizeMachine::evalNewConfigWithoutImplementation(), GrowMachine::explore(), MinimizeMachine::minimizeBuses(), MinimizeMachine::minimizeFunctionUnits(), and MinimizeMachine::minimizeRegisterFiles().
std::vector< DesignSpaceExplorerPlugin * > DesignSpaceExplorer::getPlugins | ( | ) |
Parses the plugin search directories and loads all available plugins
Definition at line 557 of file DesignSpaceExplorer.cc.
References Environment::explorerPluginPaths(), FileSystem::fileExists(), FileSystem::fileNameBody(), FileSystem::findFromDirectory(), and loadExplorerPlugin().
|
static |
Loads the given explorer plugin from the default search pathes of the explorer plugins.
Searches for file named the plugin with an extension ".so". e.g. if the plugin is namen SimplePlugin is the file SimplePlugin.so loaded. Plugins are searched from the default search pathes of explorer plugins.
pluginName | Name of the plugin to be loaded. |
dsdb | DSDBManager to be used by the plugin. |
FileNotFound | If the given plugin is not found from the search paths of explorer plugins. |
DynamicLibraryException | If the dynamic library cannot be opened. |
Definition at line 527 of file DesignSpaceExplorer.cc.
References Environment::explorerPluginPaths(), FileSystem::fileExists(), and setDSDB().
Referenced by BlocksConnectICCmd::Do(), VLIWConnectICCmd::Do(), SimpleICOptimizer::explore(), ADFCombiner::explore(), FrequencySweepExplorer::explore(), and loadExplorerPlugin().
|
protected |
Compiles the given application bytecode file on the given target machine.
bytecodeFile | Bytecode filename with path. |
target | The machine to compile the sequential program against. |
paramOptions | Compiler options (if cmdline options are not given) |
Definition at line 315 of file DesignSpaceExplorer.cc.
References __func__, Application::cmdLineOptions(), FileSystem::createTempDirectory(), FileSystem::DIRECTORY_SEPARATOR, DS, Exception::errorMessage(), FileSystem::fileExists(), FileSystem::fileIsReadable(), TTAProgram::Program::loadFromTPEF(), options, FileSystem::removeFileOrDirectory(), Application::runShellCommandAndGetOutput(), Exception::setCause(), XMLSerializer::setDestinationFile(), Environment::tceCompiler(), Application::verboseLevel(), and ADFSerializer::writeMachine().
Referenced by SimpleICOptimizer::explore().
IDF::MachineImplementation * DesignSpaceExplorer::selectComponents | ( | const TTAMachine::Machine & | mach, |
const double & | frequency = 0.0 , |
||
const double & | maxArea = 0.0 , |
||
const std::string & | icDec = "DefaultICDecoder" , |
||
const std::string & | icDecHDB = "asic_130nm_1.5V.hdb" |
||
) | const |
Selects components for a machine, creates a idf.
mach | Target machine for which components are selected. |
frequency | The minimum frequency of the implementations. |
maxArea | Maximum area for implementations. |
icDec | IC decoder to be used. |
icDecHDB | IC decoder HDB file. |
Definition at line 698 of file DesignSpaceExplorer.cc.
References debugLog, Exception::errorMessage(), and ComponentImplementationSelector::selectComponents().
|
virtual |
Sets new design space database.
dsdb | Design space database to be used with the explorer. |
Definition at line 107 of file DesignSpaceExplorer.cc.
Referenced by BlocksConnectICCmd::Do(), VLIWConnectICCmd::Do(), GrowMachine::explore(), loadExplorerPlugin(), MinimizeMachine::minimizeBuses(), MinimizeMachine::minimizeFunctionUnits(), and MinimizeMachine::minimizeRegisterFiles().
|
protected |
Simulates the parallel program.
Simulates the target machine as long as the program runs or the maximum cycle count is reached. If maximum cycle count is reached an exception is thrown.
program | Sequential program. |
machine | Target machine. |
testApplication | Test application directory. |
maxCycles | Maximum amount of clock cycles that program is allowed to run. Not used by this implementation. |
runnedCycles | Simulated cycle amount is stored here. |
tracing | Flag indicating is the tracing used. |
Exception | All exceptions produced by simulator engine except SimulationCycleLimitReached in case of max cycles are reached without program finishing and SimulationTimeOut in case of simulation is killed after simulating maximum time that is currently 10h. |
Definition at line 416 of file DesignSpaceExplorer.cc.
References SimulatorFrontend::cycleCount(), SimulatorFrontend::executableInstructionAt(), ExecutableInstruction::executionCount(), SimulatorFrontend::forceTraceDBFileName(), TestApplication::hasSimulateTTASim(), BaseLineReader::initialize(), TclInterpreter::interpret(), SimulatorInterpreter::isQuitCommandGiven(), SimulatorFrontend::killSimulation(), SimulatorFrontend::lastTraceDB(), SimulatorFrontend::loadMachine(), SimulatorFrontend::loadProgram(), machine, program, BaseLineReader::readLine(), ScriptInterpreter::result(), SimulatorFrontend::run(), SimulatorFrontend::setExecutionTracing(), BaseLineReader::setPromptPrinting(), SimulatorFrontend::setRFAccessTracing(), SimulatorFrontend::setTimeout(), TestApplication::setupSimulation(), SimulatorFrontend::setUtilizationDataSaving(), SimulatorFrontend::SIM_COMPILED, SIM_INTERP_QUIT_COMMAND, SimulatorFrontend::SIM_NORMAL, TestApplication::simulateTTASim(), and StringTools::trim().
|
private |
Design space database where results are stored.
Definition at line 131 of file DesignSpaceExplorer.hh.
|
staticprivate |
Used for the default evaluate() argument.
Definition at line 139 of file DesignSpaceExplorer.hh.
|
private |
The estimator frontend.
Definition at line 135 of file DesignSpaceExplorer.hh.
|
private |
Output stream.
Definition at line 137 of file DesignSpaceExplorer.hh.
|
staticprivate |
The plugin tool.
Definition at line 133 of file DesignSpaceExplorer.hh.