|
The Sparta Modeling Framework
|
Configuration applicator class that is used for configuring a simulator. Works in conjunction with sparta::app::Simulation. More...
#include <SimulationConfiguration.hpp>

Classes | |
| class | SimDBConfig |
Public Types | |
| enum class | SignalMode { DISABLE_BACKTRACE_SIGNALS , ENABLE_BACKTRACE_SIGNALS } |
| Controls installation of signal handlers. More... | |
| enum class | PostRunDebugDumpPolicy { DEBUG_DUMP_ALWAYS = 0 , DEBUG_DUMP_NEVER = 1 , DEBUG_DUMP_ERROR = 2 , DEBUG_DUMP_MAX = 3 } |
| enum class | PostRunDebugDumpOptions { DEBUG_DUMP_EVERYTHING , DEBUG_DUMP_NOTHING , DEBUG_DUMP_BACKTRACE_ONLY } |
| enum class | AutoSummaryState { AUTO_SUMMARY_OFF = 0 , AUTO_SUMMARY_NORMAL = 1 , AUTO_SUMMARY_VERBOSE = 2 , AUTO_SUMMARY_MAX = 3 } |
| enum class | TriggerSource { TRIGGER_ON_NONE = 0 , TRIGGER_ON_CYCLE , TRIGGER_ON_INSTRUCTION , TRIGGER_ON_ROI } |
Public Member Functions | |
| SimulationConfiguration (const DefaultValues &defaults=DefaultValues()) | |
| Create a SimulationConfiguration. | |
| void | processParameter (const std::string &pattern, const std::string &value, bool optional=false) |
| void | processConfigFile (const std::string &pattern, const std::string &filename, bool is_final=false) |
| void | processArch (const std::string &pattern, const std::string &filename) |
| void | enableLogging (const std::string &pattern, const std::string &category, const std::string &destination) |
| bool | hasFinalConfig () const |
| Was a final configuration file provided? | |
| void | processExtensionFile (const std::string &filename) |
| Consume an extension (.yaml) file. | |
| void | setStateTrackingFile (const std::string &filename) |
| Set the filename for the State Tracking file. | |
| const std::string & | getStateTrackingFilename () const |
| Get the State Tracking filename. | |
| void | addControlFile (const std::string &filename) |
| Consume a simulation control file. | |
| const std::set< std::string > & | getControlFiles () const |
| Get all control files for this simulation. | |
| void | addRunMetadata (const std::string &name, const std::string &value) |
| Add run metadata as a string. | |
| const std::vector< std::pair< std::string, std::string > > & | getRunMetadata () const |
| Get run metadata as key-value pairs. | |
| std::string | stringizeRunMetadata () const |
| Get run metadata stringized as "name1=value1,name2=value2,...". | |
| std::string | getFinalConfigFile () const |
| Get the final config file name. | |
| void | setMemoryUsageDefFile (const std::string &def_file) |
| Set filename which contains heap profiler settings. | |
| const std::string & | getMemoryUsageDefFile () const |
| Get filename for heap profiler configuration. | |
| void | generateStatsMapping () |
| Auto-generate mappings from report column headers to statistic names. | |
| bool | shouldGenerateStatsMapping () const |
| Get statistics mapping "enabled" flag. | |
| void | disablePrettyPrintReports (const std::string &format) |
| const std::set< std::string > & | getDisabledPrettyPrintFormats () const |
| Get all report file extensions which have had their pretty printing disabled. | |
| void | omitStatsWithValueZeroForReportFormat (const std::string &format) |
| const std::set< utils::lowercase_string > & | getReportFormatsWhoOmitStatsWithValueZero () const |
| Get all report formats which are to omit all SI values that are zero. | |
| void | copyTreeNodeExtensionsFromArchAndConfigPTrees () |
| bool | hasTreeNodeExtensions () const |
| ParameterTree & | getUnboundParameterTree () |
| const ParameterTree & | getUnboundParameterTree () const |
| ParameterTree & | getArchUnboundParameterTree () |
| const ParameterTree & | getArchUnboundParameterTree () const |
| ParameterTree & | getExtensionsUnboundParameterTree () |
| Returns a ParameterTree containing an unbound set of named tree node extensions and their parameter value(s). | |
| const ParameterTree & | getExtensionsUnboundParameterTree () const |
| Returns a ParameterTree (const version) containing an unbound set of named tree node extensions and their parameter value(s). | |
| bool | archFileProvided () const |
| void | printArchConfigurations (std::ostream &os) const |
| Print the ArchNodeConfigFileApplicator for informative messages. | |
| void | addArchSearchPath (const std::string &dir) |
| const std::vector< std::string > & | getArchSearchPath () const |
| Get the arch search paths. | |
| void | addConfigSearchPath (const std::string &dir) |
| const std::vector< std::string > & | getConfigSearchPath () const |
| Get the search paths for the configure files. | |
| void | addReportDefnSearchPath (const std::string &dir) |
| const std::vector< std::string > & | getReportDefnSearchPaths () const |
| void | printGenericConfigurations (std::ostream &os) const |
| Print the generic configurations for informative messages. | |
| const DefaultValues & | getDefaults () const |
| Get the defaults this configuration was made with. | |
| const log::TapDescVec & | getTaps () const |
| Get the taps vector. | |
| void | setConsumed () const |
Configuration applicator class that is used for configuring a simulator. Works in conjunction with sparta::app::Simulation.
This class will help a user set up a derived sparta::app::Simulation object, but nothing else. It's up the user to determine how to run simulation, either by calling sparta::app::Simulation::run directly or via the sparta::SysCSpartaSchedulerAdapter::run method if the simulation is embedded in a cosimulation environment where the SystemC scheduler is master of simulation.
Definition at line 121 of file SimulationConfiguration.hpp.
|
strong |
Behavior of auto-summary writing
| Enumerator | |
|---|---|
| AUTO_SUMMARY_OFF | Do not write summary. |
| AUTO_SUMMARY_NORMAL | Write normal summary. |
| AUTO_SUMMARY_VERBOSE | Write verbose summary. |
| AUTO_SUMMARY_MAX | Invalid enum value. |
Definition at line 380 of file SimulationConfiguration.hpp.
|
strong |
Content of post-run debug dumping
Definition at line 371 of file SimulationConfiguration.hpp.
|
strong |
Behavior of post-run debug dumping
Definition at line 361 of file SimulationConfiguration.hpp.
|
strong |
Controls installation of signal handlers.
Definition at line 352 of file SimulationConfiguration.hpp.
|
strong |
Type of trigger to create using trigger_on_value for enabling pipeout collection, logging, and pevents
Definition at line 391 of file SimulationConfiguration.hpp.
|
inline |
Append to the front of the architectural directory paths list the given directory
Definition at line 298 of file SimulationConfiguration.hpp.
|
inline |
Append to the front of the configuration directory path list the given directory
Definition at line 314 of file SimulationConfiguration.hpp.
|
inline |
Append to the front of the report definitions directory path list the given directory
Definition at line 330 of file SimulationConfiguration.hpp.
|
inline |
Was an arch file provided in this configuration?
Definition at line 282 of file SimulationConfiguration.hpp.
| void sparta::app::SimulationConfiguration::copyTreeNodeExtensionsFromArchAndConfigPTrees | ( | ) |
Look for any tree node extensions from the arch / config ParameterTree's, and merge those extensions into the extensions ParameterTree.
| void sparta::app::SimulationConfiguration::disablePrettyPrintReports | ( | const std::string & | format | ) |
Disable pretty printing for the given file format ("json", "html", ...) Note that not all formats differentiate between pretty print and non-pretty print, so calling this method will have no effect for those reports
| void sparta::app::SimulationConfiguration::enableLogging | ( | const std::string & | pattern, |
| const std::string & | category, | ||
| const std::string & | destination ) |
Enable logging on a specific node, for a specific category, and redirect output to the given destination
|
inline |
Get the arch search paths.
Definition at line 306 of file SimulationConfiguration.hpp.
|
inline |
Returns an architectural ParameterTree containing an unbound set of parameter values which can be read and later applied as defaults to newly-constructed parameters.
Definition at line 253 of file SimulationConfiguration.hpp.
|
inline |
Returns an architectural ParameterTree (const version) containing an unbound set of parameter values which can be read and later applied as defaults to newly-constructed parameters.
Definition at line 260 of file SimulationConfiguration.hpp.
|
inline |
Get the search paths for the configure files.
Definition at line 322 of file SimulationConfiguration.hpp.
|
inline |
Get the defaults this configuration was made with.
Definition at line 703 of file SimulationConfiguration.hpp.
|
inline |
Returns a ParameterTree containing an unbound set of named tree node extensions and their parameter value(s).
Definition at line 266 of file SimulationConfiguration.hpp.
|
inline |
Returns a ParameterTree (const version) containing an unbound set of named tree node extensions and their parameter value(s).
Definition at line 275 of file SimulationConfiguration.hpp.
|
inline |
Get the final config file name.
Definition at line 187 of file SimulationConfiguration.hpp.
|
inline |
Return all report definition search paths applied to this simulation (command line option –report-search-path)
Definition at line 338 of file SimulationConfiguration.hpp.
|
inline |
Get the taps vector.
Definition at line 706 of file SimulationConfiguration.hpp.
|
inline |
Returns a ParameterTree containing an unbound set of parameter values which can be read and later applied. Some of these parameters will be applied to Parameter TreeNodes at some point and others will not
Definition at line 238 of file SimulationConfiguration.hpp.
|
inline |
Returns a ParameterTree (const version) containing an unbound set of parameter values which can be read and later applied. Some of these parameters will be applied to Parameter TreeNodes at some point and others will not
Definition at line 246 of file SimulationConfiguration.hpp.
|
inline |
Was a final configuration file provided?
Definition at line 159 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::hasTreeNodeExtensions | ( | ) | const |
Check if the unbound extensions ptree has any extensions.
| void sparta::app::SimulationConfiguration::omitStatsWithValueZeroForReportFormat | ( | const std::string & | format | ) |
Specify that a given report format (NOT a report extension) is to omit StatisticInstance's that have value 0. To be clear, report format is something like "json" or "json_reduced", while the report extension for both of these formats is just "json".
|
inline |
Print the ArchNodeConfigFileApplicator for informative messages.
Definition at line 285 of file SimulationConfiguration.hpp.

|
inline |
Print the generic configurations for informative messages.
Definition at line 343 of file SimulationConfiguration.hpp.
| void sparta::app::SimulationConfiguration::processArch | ( | const std::string & | pattern, |
| const std::string & | filename ) |
Configure simulator for specific architecture. Will look in the directories supplied in arch_search_paths
| void sparta::app::SimulationConfiguration::processConfigFile | ( | const std::string & | pattern, |
| const std::string & | filename, | ||
| bool | is_final = false ) |
Consume a configuration (.yaml) file
| pattern | The node to apply the given yaml file. Use "" for top |
| filename | The yaml file to consume |
| is_final | Is this a final configuration file |
| void sparta::app::SimulationConfiguration::processParameter | ( | const std::string & | pattern, |
| const std::string & | value, | ||
| bool | optional = false ) |
Handle an individual parameter
| pattern | The path to the parameter node to modify |
| value | The value to be written |
| ignore | Is this an optional parameter? |
|
inline |
Called by app::Simulation to indicate that this configuration has been consumed. Const since this class is passed as a const object to app::Simulation
Definition at line 711 of file SimulationConfiguration.hpp.
| AutoSummaryState sparta::app::SimulationConfiguration::auto_summary_state {AutoSummaryState::AUTO_SUMMARY_OFF} |
Automatic summary state. Determines what to do with the automatic summary after running. Valid values are found in sparta::app""Simulation.
Definition at line 438 of file SimulationConfiguration.hpp.
| PostRunDebugDumpOptions sparta::app::SimulationConfiguration::debug_dump_options {PostRunDebugDumpOptions::DEBUG_DUMP_EVERYTHING} |
Debug dumping options
Definition at line 448 of file SimulationConfiguration.hpp.
| PostRunDebugDumpPolicy sparta::app::SimulationConfiguration::debug_dump_policy {PostRunDebugDumpPolicy::DEBUG_DUMP_NEVER} |
Debug dumping policy
Definition at line 443 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::debug_sim = false |
Should simulator-framework debug messages be written
Definition at line 418 of file SimulationConfiguration.hpp.
| std::string sparta::app::SimulationConfiguration::dump_debug_filename {"error-dump.dbg"} |
Filename of error/final dump. Can be "" to auto-generate the name
Definition at line 453 of file SimulationConfiguration.hpp.
| std::string sparta::app::SimulationConfiguration::parsed_path_to_retired_inst_counter_ |
From "top.core*", what is the path to the counter specifying retired instructions on a given core?
Definition at line 697 of file SimulationConfiguration.hpp.
| std::pair<std::string, app::DefaultValues::RetiredInstPathStrictness> sparta::app::SimulationConfiguration::path_to_retired_inst_counter |
Definition at line 698 of file SimulationConfiguration.hpp.
| std::string sparta::app::SimulationConfiguration::pipeline_collection_file_prefix = NoPipelineCollectionStr |
The default pipeline collection prefix for pipeline collection (-z option). Empty string means no prefix
Definition at line 492 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::report_on_error = true |
Write reports o error
Definition at line 423 of file SimulationConfiguration.hpp.
| ReportDescVec sparta::app::SimulationConfiguration::reports |
Additional report descriptions
Definition at line 497 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::scheduler_exacting_run = false |
Scheduler control: When a user calls sparta::Simulation::run() with an amount of time other than the default, the Scheduler can do one of two things:
If this boolean is set to true, the Scheduler will perform the first action. If set to false it will perform the second action.
Definition at line 685 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::scheduler_measure_run_time = true |
Scheduler control: When a user calls sparta::Simulation::run(), should the Scheduler measure its own performance? This is expensive (and pointless) if a user of SPARTA is doing a run that is less than infinite.
Definition at line 693 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::show_dag = false |
During simulation configuring, dump the contents of the DAG
Definition at line 481 of file SimulationConfiguration.hpp.
| SignalMode sparta::app::SimulationConfiguration::signal_mode {SignalMode::ENABLE_BACKTRACE_SIGNALS} |
Signal configuration – enable signal catching or not. By default, SPARTA will catch all signals thrown by a running process. This can be difficult however, for EDA tools that install their own.
Definition at line 431 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::suppress_unread_parameter_warnings = false |
Suppress parameter unread warnings not the errors
Definition at line 486 of file SimulationConfiguration.hpp.
| std::string sparta::app::SimulationConfiguration::trigger_clock |
The clock to set the trigger on if trigger_on_type is set to TRIGGER_ON_CYCLE
Definition at line 466 of file SimulationConfiguration.hpp.
| TriggerSource sparta::app::SimulationConfiguration::trigger_on_type {TriggerSource::TRIGGER_ON_NONE} |
How to interpret the trigger_on_value number – cycle or instruction number
Definition at line 462 of file SimulationConfiguration.hpp.
| uint64_t sparta::app::SimulationConfiguration::trigger_on_value = 0 |
Cycle count or instruction value to start the debugging
Definition at line 458 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::validate_post_run = false |
Should the simulator validate itself after running
Definition at line 471 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::verbose_cfg = false |
Show verbose messages while parsing input files (e.g. reports parameters).
Definition at line 408 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::verbose_report_triggers = false |
Show verbose report trigger messages
Definition at line 413 of file SimulationConfiguration.hpp.
| bool sparta::app::SimulationConfiguration::warn_stderr = true |
Should log messages in the category log::categories::WARN be written to stderr
Definition at line 402 of file SimulationConfiguration.hpp.
| std::string sparta::app::SimulationConfiguration::warnings_file {""} |
File to which warnings should be logged by default
Definition at line 476 of file SimulationConfiguration.hpp.