OpenASIP 2.2
|
#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. | |
CostEstimator::Estimator | estimator_ |
The estimator frontend. | |
std::ostringstream * | oStream_ |
Output stream. | |
Static Private Attributes | |
static PluginTools | pluginTool_ |
The plugin tool. | |
static CostEstimates | dummyEstimate_ |
Used for the default evaluate() argument. | |
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 84 of file DesignSpaceExplorer.cc.
References oStream_, and OperationGlobals::setOutputStream().
|
virtual |
The destructor.
Definition at line 95 of file DesignSpaceExplorer.cc.
References oStream_.
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 794 of file DesignSpaceExplorer.cc.
References DSDBManager::addConfiguration(), debugLog, dsdb_, and Exception::errorMessage().
Referenced by createImplementationAndStore(), Evaluate::explore(), and MinimalOpSet::explore().
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 774 of file DesignSpaceExplorer.cc.
References estimator_, CostEstimator::Estimator::longestPath(), and CostEstimator::Estimator::totalArea().
Referenced by createImplementation(), createImplementationAndStore(), and evaluate().
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 689 of file DesignSpaceExplorer.cc.
References DSDBManager::addImplementation(), DSDBManager::architecture(), DSDBManager::MachineConfiguration::architectureID, createEstimateData(), dsdb_, DSDBManager::MachineConfiguration::hasImplementation, DSDBManager::MachineConfiguration::implementationID, and selectComponents().
Referenced by MinimalOpSet::explore(), and SimpleICOptimizer::explore().
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 636 of file DesignSpaceExplorer.cc.
References addConfToDSDB(), DSDBManager::addImplementation(), DSDBManager::architecture(), DSDBManager::MachineConfiguration::architectureID, createEstimateData(), dsdb_, DSDBManager::MachineConfiguration::hasImplementation, DSDBManager::MachineConfiguration::implementationID, and selectComponents().
Referenced by FrequencySweepExplorer::explore().
|
virtual |
Returns the DSDBManager of the current exploration process.
Definition at line 339 of file DesignSpaceExplorer.cc.
References dsdb_.
Referenced by ConnectionSweeper::averageWorsening(), MinimizeMachine::checkCycleCounts(), ADFCombiner::explore(), BlocksConnectIC::explore(), ComponentAdder::explore(), Evaluate::explore(), GrowMachine::explore(), ImplementationSelector::explore(), MinimalOpSet::explore(), RemoveUnconnectedComponents::explore(), VectorLSGenerator::explore(), VLIWConnectIC::explore(), ConnectionSweeper::explore(), FrequencySweepExplorer::explore(), ImmediateGenerator::explore(), SimpleICOptimizer::explore(), MinimizeMachine::minimizeBuses(), MinimizeMachine::minimizeFunctionUnits(), MinimizeMachine::minimizeMachine(), MinimizeMachine::minimizeRegisterFiles(), Evaluate::printEstimates(), ConnectionSweeper::removeAllConnections(), ConnectionSweeper::removeLeastNecessaryConnections(), simulate(), ConnectionSweeper::sweepBypasses(), and ConnectionSweeper::sweepRFs().
|
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 135 of file DesignSpaceExplorer.cc.
References __func__, DSDBManager::addCycleCount(), DSDBManager::addEnergyEstimate(), DSDBManager::applicationIDs(), TestApplication::applicationPath(), DSDBManager::applicationPath(), DSDBManager::architecture(), DSDBManager::MachineConfiguration::architectureID, assert, TestApplication::correctOutput(), createEstimateData(), debugLog, dsdb_, TTAProgram::CodeSnippet::endAddress(), Exception::errorMessageStack(), estimator_, TestApplication::functionsOfInterest(), TestApplication::hasCorrectOutput(), DSDBManager::hasCycleCount(), TestApplication::hasFunctionsOfInterest(), DSDBManager::MachineConfiguration::hasImplementation, DSDBManager::implementation(), DSDBManager::MachineConfiguration::implementationID, Application::increasedVerbose(), TTAProgram::CodeSnippet::instructionCount(), DSDBManager::isUnschedulable(), TTAProgram::Address::location(), Application::logStream(), oStream_, schedule(), CostEstimates::setArea(), DSDBManager::setAreaEstimate(), CostEstimates::setEnergy(), CostEstimates::setLongestPathDelay(), DSDBManager::setLongestPathDelayEstimate(), DSDBManager::setUnschedulable(), simulate(), TTAProgram::CodeSnippet::startAddress(), CostEstimator::Estimator::totalEnergy(), and StringTools::trim().
Referenced by MinimizeMachine::evalNewConfigWithoutImplementation(), Evaluate::explore(), GrowMachine::explore(), MinimalOpSet::explore(), ConnectionSweeper::explore(), SimpleICOptimizer::explore(), MinimizeMachine::minimizeBuses(), MinimizeMachine::minimizeFunctionUnits(), MinimizeMachine::minimizeMachine(), MinimizeMachine::minimizeRegisterFiles(), ConnectionSweeper::removeAllConnections(), and ConnectionSweeper::removeLeastNecessaryConnections().
std::vector< DesignSpaceExplorerPlugin * > DesignSpaceExplorer::getPlugins | ( | ) |
Parses the plugin search directories and loads all available plugins
Definition at line 596 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 566 of file DesignSpaceExplorer.cc.
References PluginTools::addSearchPath(), Environment::explorerPluginPaths(), FileSystem::fileExists(), PluginTools::importSymbol(), pluginTool_, PluginTools::registerModule(), and setDSDB().
Referenced by BlocksConnectICCmd::Do(), VLIWConnectICCmd::Do(), ADFCombiner::explore(), FrequencySweepExplorer::explore(), SimpleICOptimizer::explore(), getPlugins(), 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 354 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 evaluate(), and 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 737 of file DesignSpaceExplorer.cc.
References debugLog, Exception::errorMessage(), and ComponentImplementationSelector::selectComponents().
Referenced by createImplementation(), and createImplementationAndStore().
|
virtual |
Sets new design space database.
dsdb | Design space database to be used with the explorer. |
Definition at line 109 of file DesignSpaceExplorer.cc.
References dsdb_.
Referenced by BlocksConnectICCmd::Do(), VLIWConnectICCmd::Do(), GrowMachine::explore(), loadExplorerPlugin(), MinimizeMachine::minimizeBuses(), MinimizeMachine::minimizeFunctionUnits(), MinimizeMachine::minimizeRegisterFiles(), and CallExplorerPluginWindow::onRun().
|
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 455 of file DesignSpaceExplorer.cc.
References SimulatorFrontend::cycleCount(), db(), SimulatorFrontend::executableInstructionAt(), ExecutableInstruction::executionCount(), SimulatorFrontend::forceTraceDBFileName(), TestApplication::hasSimulateTTASim(), BaseLineReader::initialize(), TclInterpreter::interpret(), SimulatorInterpreter::isQuitCommandGiven(), SimulatorFrontend::killSimulation(), SimulatorFrontend::lastTraceDB(), SimulatorFrontend::loadMachine(), SimulatorFrontend::loadProgram(), machine, oStream_, 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().
Referenced by evaluate().
|
private |
Design space database where results are stored.
Definition at line 131 of file DesignSpaceExplorer.hh.
Referenced by addConfToDSDB(), createImplementation(), createImplementationAndStore(), db(), evaluate(), and setDSDB().
|
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.
Referenced by createEstimateData(), and evaluate().
|
private |
Output stream.
Definition at line 137 of file DesignSpaceExplorer.hh.
Referenced by DesignSpaceExplorer(), evaluate(), simulate(), and ~DesignSpaceExplorer().
|
staticprivate |
The plugin tool.
Definition at line 133 of file DesignSpaceExplorer.hh.
Referenced by loadExplorerPlugin().