The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::app::SimulationConfiguration::SimDBConfig Class Reference

#include <SimulationConfiguration.hpp>

Public Member Functions

void setSimExecutable (const std::string &exe_name)
 Set the simulation executable. This will be used as the default database filename (with a .db extension) unless otherwise specified.
 
void enableApp (const std::string &app_name)
 Tell the simulation to enable the given app. Unless otherwise specified, the database will be the executable name with a '.db' file extension, and one app instance will be available.
 
bool appEnabled (const std::string &app_name) const
 Check if the given app is enabled.
 
std::vector< std::string > getEnabledApps () const
 Return a list of all enabled apps.
 
void setAppCount (const std::string &app_name, size_t count)
 Set the number of instances that should be available for the given app.
 
void inferAppCountFromTreePattern (const std::string &app_name, const std::string &pattern)
 Set the number of instances that should be available for the given app using a device tree wildcard pattern. The app count will be inferred as the number of tree nodes matching this pattern by the time finalizeFramework() is called.
 
std::string getTreePatternForInferredAppCount (const std::string &app_name) const
 Get the device tree pattern from which to infer the number of instances of the given app we should create.
 
size_t getAppCount (const std::string &app_name) const
 Return the number of instances we should create for the given app.
 
void setAppDatabase (const std::string &app_name, const std::string &db_file)
 Direct the given app to go to the provided database file.
 
std::string getAppDatabase (const std::string &app_name) const
 Get the database file for the given app.
 
void reuseDatabase (const std::string &db_file)
 Tell SimDB to open the given file without overwriting it.
 
bool shouldOverwriteDatabase (const std::string &db_file) const
 See if the given database should be overwritten or reused.
 
void disableLegacyReports ()
 When used together with –enable-simdb-reports, the option –disable-legacy-reports results in stats reports only going to SimDB.
 
bool legacyReportsEnabled () const
 See if legacy stats reports are enabled or not.
 
void enableVerboseMode (bool enable=true)
 Call the setVerbose() method for all SimDB apps once created.
 
bool verboseMode () const
 Get verbose flag.
 
void addPragmaOnOpen (const std::string &name, const std::string &val)
 Add a SQLite PRAGMA to execute on database creation.
 
std::vector< std::pair< std::string, std::string > > getPragmas () const
 Get a list of name-value pairs for SQLite PRAGMA's to execute on database creation.
 

Detailed Description

SimDB configuration

Definition at line 488 of file SimulationConfiguration.hpp.

Member Function Documentation

◆ addPragmaOnOpen()

void sparta::app::SimulationConfiguration::SimDBConfig::addPragmaOnOpen ( const std::string & name,
const std::string & val )
inline

Add a SQLite PRAGMA to execute on database creation.

Note
Applies to all app databases if different.

Definition at line 672 of file SimulationConfiguration.hpp.

◆ appEnabled()

bool sparta::app::SimulationConfiguration::SimDBConfig::appEnabled ( const std::string & app_name) const
inline

Check if the given app is enabled.

Definition at line 520 of file SimulationConfiguration.hpp.

◆ disableLegacyReports()

void sparta::app::SimulationConfiguration::SimDBConfig::disableLegacyReports ( )
inline

When used together with –enable-simdb-reports, the option –disable-legacy-reports results in stats reports only going to SimDB.

Note
"Legacy" here means formatted output files, e.g. json/html/txt.
This is being deprecated in map_v3.

Definition at line 633 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ enableApp()

void sparta::app::SimulationConfiguration::SimDBConfig::enableApp ( const std::string & app_name)
inline

Tell the simulation to enable the given app. Unless otherwise specified, the database will be the executable name with a '.db' file extension, and one app instance will be available.

Note
Use setAppDatabase() to override the database file for this app.
Use setAppCount() to override the number of instances for this app.

Definition at line 507 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ enableVerboseMode()

void sparta::app::SimulationConfiguration::SimDBConfig::enableVerboseMode ( bool enable = true)
inline

Call the setVerbose() method for all SimDB apps once created.

Definition at line 655 of file SimulationConfiguration.hpp.

◆ getAppCount()

size_t sparta::app::SimulationConfiguration::SimDBConfig::getAppCount ( const std::string & app_name) const
inline

Return the number of instances we should create for the given app.

Note
Only to be called after the tree is fully built. Throws if not.

Definition at line 579 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ getAppDatabase()

std::string sparta::app::SimulationConfiguration::SimDBConfig::getAppDatabase ( const std::string & app_name) const
inline

Get the database file for the given app.

Definition at line 604 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ getEnabledApps()

std::vector< std::string > sparta::app::SimulationConfiguration::SimDBConfig::getEnabledApps ( ) const
inline

Return a list of all enabled apps.

Definition at line 528 of file SimulationConfiguration.hpp.

◆ getPragmas()

std::vector< std::pair< std::string, std::string > > sparta::app::SimulationConfiguration::SimDBConfig::getPragmas ( ) const
inline

Get a list of name-value pairs for SQLite PRAGMA's to execute on database creation.

Definition at line 681 of file SimulationConfiguration.hpp.

◆ getTreePatternForInferredAppCount()

std::string sparta::app::SimulationConfiguration::SimDBConfig::getTreePatternForInferredAppCount ( const std::string & app_name) const
inline

Get the device tree pattern from which to infer the number of instances of the given app we should create.

Definition at line 562 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ inferAppCountFromTreePattern()

void sparta::app::SimulationConfiguration::SimDBConfig::inferAppCountFromTreePattern ( const std::string & app_name,
const std::string & pattern )
inline

Set the number of instances that should be available for the given app using a device tree wildcard pattern. The app count will be inferred as the number of tree nodes matching this pattern by the time finalizeFramework() is called.

Definition at line 550 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ legacyReportsEnabled()

bool sparta::app::SimulationConfiguration::SimDBConfig::legacyReportsEnabled ( ) const
inline

See if legacy stats reports are enabled or not.

Note
"Legacy" here means formatted output files, e.g. json/html/txt.
This is being deprecated in map_v3.

Definition at line 647 of file SimulationConfiguration.hpp.

◆ reuseDatabase()

void sparta::app::SimulationConfiguration::SimDBConfig::reuseDatabase ( const std::string & db_file)
inline

Tell SimDB to open the given file without overwriting it.

Definition at line 613 of file SimulationConfiguration.hpp.

◆ setAppCount()

void sparta::app::SimulationConfiguration::SimDBConfig::setAppCount ( const std::string & app_name,
size_t count )
inline

Set the number of instances that should be available for the given app.

Definition at line 536 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ setAppDatabase()

void sparta::app::SimulationConfiguration::SimDBConfig::setAppDatabase ( const std::string & app_name,
const std::string & db_file )
inline

Direct the given app to go to the provided database file.

Definition at line 595 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ setSimExecutable()

void sparta::app::SimulationConfiguration::SimDBConfig::setSimExecutable ( const std::string & exe_name)
inline

Set the simulation executable. This will be used as the default database filename (with a .db extension) unless otherwise specified.

Definition at line 495 of file SimulationConfiguration.hpp.

◆ shouldOverwriteDatabase()

bool sparta::app::SimulationConfiguration::SimDBConfig::shouldOverwriteDatabase ( const std::string & db_file) const
inline

See if the given database should be overwritten or reused.

Definition at line 621 of file SimulationConfiguration.hpp.

◆ verboseMode()

bool sparta::app::SimulationConfiguration::SimDBConfig::verboseMode ( ) const
inline

Get verbose flag.

Definition at line 663 of file SimulationConfiguration.hpp.


The documentation for this class was generated from the following file: