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 useAppFileLogger (const std::string &filename)
 Before creating any apps, call this method to enable all apps to have access to a single thread-safe file logger.
 
std::string getAppLoggerFilename () const
 Get the filename of the apps' shared file logger, if enabled.
 
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 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 482 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 668 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 532 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 645 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 519 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ 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 591 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 616 of file SimulationConfiguration.hpp.

Here is the call graph for this function:

◆ getAppLoggerFilename()

std::string sparta::app::SimulationConfiguration::SimDBConfig::getAppLoggerFilename ( ) const
inline

Get the filename of the apps' shared file logger, if enabled.

Definition at line 507 of file SimulationConfiguration.hpp.

◆ getEnabledApps()

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

Return a list of all enabled apps.

Definition at line 540 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 677 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 574 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 562 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 659 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 625 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 548 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 607 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 489 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 633 of file SimulationConfiguration.hpp.

◆ useAppFileLogger()

void sparta::app::SimulationConfiguration::SimDBConfig::useAppFileLogger ( const std::string & filename)
inline

Before creating any apps, call this method to enable all apps to have access to a single thread-safe file logger.

Parameters
filenameThe name / path of the output file.

Definition at line 499 of file SimulationConfiguration.hpp.


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