21#include "sparta/sparta.hpp"
22#include "sparta/simulation/ParameterTree.hpp"
24#include "sparta/log/Tap.hpp"
33constexpr char NoPipelineCollectionStr[] =
"NOPREFIX_";
100 std::pair<std::string, RetiredInstPathStrictness> path_to_retired_inst_counter =
101 std::make_pair(
"rob.stats.total_number_retired",
102 RetiredInstPathStrictness::Relaxed);
135 bool optional =
false);
142 bool is_final =
false);
147 const std::string & filename);
152 const std::string & category,
153 const std::string & destination);
175 const std::string & value);
214 const std::set<utils::lowercase_string> &
259 return extensions_ptree_;
268 return extensions_ptree_;
279 os << arch_applicator_->stringize();
282 os <<
"<not provided>";
291 arch_search_paths_.emplace(arch_search_paths_.begin(), dir);
299 return arch_search_paths_;
307 config_search_paths_.emplace(config_search_paths_.begin(), dir);
315 return config_search_paths_;
323 report_defn_search_paths_.emplace(report_defn_search_paths_.begin(), dir);
331 return report_defn_search_paths_;
336 for(
auto & cp : config_applicators_) {
337 os <<
" " << cp->stringize() <<
'\n';
345 simdb_location_ = loc;
404 const std::string & opts_file)
406 simdb_enabled_components_opts_files_.emplace_back(opts_file);
443 const std::set<std::string> & collected_formats = {})
445 simdb_legacy_reports_copy_dir_ = reports_root_dir;
446 for (
const auto & fmt : collected_formats) {
448 simdb_legacy_reports_collected_formats_.insert(lower_fmt.getString());
458 return simdb_location_;
468 return simdb_enabled_components_opts_files_;
477 return simdb_legacy_reports_copy_dir_;
487 return simdb_legacy_reports_collected_formats_;
495 DISABLE_BACKTRACE_SIGNALS,
496 ENABLE_BACKTRACE_SIGNALS
513 DEBUG_DUMP_EVERYTHING,
515 DEBUG_DUMP_BACKTRACE_ONLY
535 TRIGGER_ON_INSTRUCTION,
666 std::pair<std::string, app::DefaultValues::RetiredInstPathStrictness> path_to_retired_inst_counter =
667 std::make_pair(defaults_.path_to_retired_inst_counter.first,
668 app::DefaultValues::RetiredInstPathStrictness::Relaxed);
674 const log::TapDescVec &
getTaps()
const {
return taps_; }
684 mutable bool is_consumed_ =
false;
690 std::string final_config_file_ =
"";
693 std::string memory_usage_def_file_;
697 bool generate_stats_mapping_ =
false;
701 std::set<std::string> disabled_pretty_print_report_formats_;
705 std::set<utils::lowercase_string> zero_values_omitted_report_formats_;
717 std::vector<std::string> arch_search_paths_;
720 std::vector<std::string> config_search_paths_ = {
"./"};
723 std::vector<std::string> report_defn_search_paths_;
726 std::set<std::string> simulation_control_filenames_;
729 std::vector<std::pair<std::string, std::string>> run_metadata_;
732 std::unique_ptr<ArchNodeConfigFileApplicator> arch_applicator_;
735 ConfigVec config_applicators_;
745 log::TapDescVec taps_;
748 std::string state_tracking_file_;
757 std::string simdb_location_;
763 std::vector<std::string> simdb_enabled_components_opts_files_;
767 std::string simdb_legacy_reports_copy_dir_;
771 std::set<std::string> simdb_legacy_reports_collected_formats_;
Configuration Applicators.
Describes reports to instantiate and tracks their instantiations.
Set of macros for Sparta assertions. Caught by the framework.
Virtual Parameter Tree. This represents a tree of parameters read from some source but does not neces...
Optional default values for the simulator which can be customized and provided by anyone instantiatin...
std::string arch_arg_default
bool non_empty_arch_arg_required
std::string run_time_clock
RetiredInstPathStrictness
std::list< ParameterTemplate > other_meta_params
std::vector< std::string > arch_search_dirs
std::string auto_summary_default
Configuration applicator class that is used for configuring a simulator. Works in conjunction with sp...
const DefaultValues & getDefaults() const
Get the defaults this configuration was made with.
const std::vector< std::string > & getArchSearchPath() const
Get the arch search paths.
const std::set< std::string > & getLegacyReportsCollectedFormats() const
const std::string & getSimulationDatabaseLocation() const
std::string parsed_path_to_retired_inst_counter_
PostRunDebugDumpOptions debug_dump_options
std::string getFinalConfigFile() const
Get the final config file name.
const std::vector< std::string > & getReportDefnSearchPaths() const
bool hasFinalConfig() const
Was a final configuration file provided?
void omitStatsWithValueZeroForReportFormat(const std::string &format)
void addSimulationDatabaseAccessOptsYaml(const std::string &opts_file)
const std::vector< std::pair< std::string, std::string > > & getRunMetadata() const
Get run metadata as key-value pairs.
void processExtensionFile(const std::string &filename)
Consume an extension (.yaml) file.
void addReportDefnSearchPath(const std::string &dir)
const std::string & getStateTrackingFilename() const
Get the State Tracking filename.
ParameterTree & getUnboundParameterTree()
const std::string & getLegacyReportsCopyDir() const
const ParameterTree & getArchUnboundParameterTree() const
const std::set< std::string > & getDisabledPrettyPrintFormats() const
Get all report file extensions which have had their pretty printing disabled.
bool scheduler_exacting_run
void printArchConfigurations(std::ostream &os) const
Print the ArchNodeConfigFileApplicator for informative messages.
bool suppress_unread_parameter_warnings
void processConfigFile(const std::string &pattern, const std::string &filename, bool is_final=false)
bool verbose_report_triggers
void addRunMetadata(const std::string &name, const std::string &value)
Add run metadata as a string.
const std::vector< std::string > & getConfigSearchPath() const
Get the search paths for the configure files.
std::string dump_debug_filename
void printGenericConfigurations(std::ostream &os) const
Print the generic configurations for informative messages.
const std::set< utils::lowercase_string > & getReportFormatsWhoOmitStatsWithValueZero() const
Get all report formats which are to omit all SI values that are zero.
void copyTreeNodeExtensionsFromArchAndConfigPTrees()
void setMemoryUsageDefFile(const std::string &def_file)
Set filename which contains heap profiler settings.
void addConfigSearchPath(const std::string &dir)
bool archFileProvided() const
SignalMode
Controls installation of signal handlers.
void addControlFile(const std::string &filename)
Consume a simulation control file.
const std::string & getMemoryUsageDefFile() const
Get filename for heap profiler configuration.
SimulationConfiguration(const DefaultValues &defaults=DefaultValues())
Create a SimulationConfiguration.
PostRunDebugDumpPolicy debug_dump_policy
bool shouldGenerateStatsMapping() const
Get statistics mapping "enabled" flag.
std::string stringizeRunMetadata() const
Get run metadata stringized as "name1=value1,name2=value2,...".
const std::vector< std::string > & getDatabaseAccessOptsFiles() const
void setLegacyReportsCopyDir(const std::string &reports_root_dir, const std::set< std::string > &collected_formats={})
ParameterTree & getArchUnboundParameterTree()
void addArchSearchPath(const std::string &dir)
TriggerSource trigger_on_type
void disablePrettyPrintReports(const std::string &format)
const log::TapDescVec & getTaps() const
Get the taps vector.
const ParameterTree & getUnboundParameterTree() const
AutoSummaryState auto_summary_state
std::string pipeline_collection_file_prefix
std::string trigger_clock
void setStateTrackingFile(const std::string &filename)
Set the filename for the State Tracking file.
const ParameterTree & getExtensionsUnboundParameterTree() const
Returns a ParameterTree (const version) containing an unbound set of named tree node extensions and t...
void enableLogging(const std::string &pattern, const std::string &category, const std::string &destination)
@ AUTO_SUMMARY_VERBOSE
Write verbose summary.
@ AUTO_SUMMARY_OFF
Do not write summary.
@ AUTO_SUMMARY_NORMAL
Write normal summary.
@ AUTO_SUMMARY_MAX
Invalid enum value.
@ DEBUG_DUMP_NEVER
Never dump debug data after running.
@ DEBUG_DUMP_ERROR
Dump debug data only if there is an error while running.
@ DEBUG_DUMP_ALWAYS
Dump debug data in all cases after running.
@ DEBUG_DUMP_MAX
Invalid enum value.
void generateStatsMapping()
Auto-generate mappings from report column headers to statistic names.
void processParameter(const std::string &pattern, const std::string &value, bool optional=false)
ParameterTree & getExtensionsUnboundParameterTree()
Returns a ParameterTree containing an unbound set of named tree node extensions and their parameter v...
bool scheduler_measure_run_time
const std::set< std::string > & getControlFiles() const
Get all control files for this simulation.
std::string warnings_file
void setSimulationDatabaseLocation(const std::string &loc)
uint64_t trigger_on_value
void processArch(const std::string &pattern, const std::string &filename)
Macros for handling exponential backoff.