|
scc 2025.09
SystemC components library
|
design configuration reader More...
#include <configurer.h>


Classes | |
| struct | ConfigHolder |
Public Types | |
| enum | { NEVER = 0 , BEFORE_END_OF_ELABORATION = 1 , END_OF_ELABORATION = 2 , START_OF_SIMULATION = 4 } |
| using | base_type = sc_core::sc_module |
| using | broker_t = cci::cci_broker_handle |
| using | cci_param_cln = std::vector<std::pair<cci::cci_param_post_write_callback_untyped, std::unique_ptr<cci::cci_param_untyped>>> |
Public Member Functions | |
| configurer (std::string const &filename, unsigned sc_attr_config_phases=BEFORE_END_OF_ELABORATION) | |
| configurer (const configurer &)=delete | |
| configurer (configurer &&)=delete | |
| configurer & | operator= (const configurer &)=delete |
| configurer & | operator= (configurer &&)=delete |
| void | read_input_file (std::string const &filename) |
| void | configure () |
| void | dump_configuration (std::string const &file_name, bool with_description=false, bool complete=true, std::vector< std::string > stop_list=std::vector< std::string >{}) |
| void | dump_configuration (std::ostream &os=std::cout, bool as_yaml=true, bool with_description=false, bool complete=true, sc_core::sc_object *obj=nullptr) |
| template<typename T> | |
| void | set_value (std::string const &hier_name, T value) |
| void | set_value_from_str (const std::string &hier_name, const std::string &value) |
| void | set_configuration_value (sc_core::sc_attr_base *attr_base, sc_core::sc_object *owner) |
Static Public Member Functions | |
| static configurer & | get () |
Protected Member Functions | |
| configurer (std::string const &filename, unsigned sc_attr_config_phases, sc_core::sc_module_name nm) | |
| void | config_check () |
| void | before_end_of_elaboration () override |
| void | end_of_elaboration () override |
| void | start_of_simulation () override |
| void | set_value (const std::string &hier_name, cci::cci_value value) |
Protected Attributes | |
| unsigned const | config_phases |
| std::string | dump_file_name {""} |
| bool | with_description {false} |
| bool | complete {true} |
| std::vector< std::string > | stop_list {} |
| broker_t | cci_broker |
| cci_param_cln | cci2sc_attr |
| cci::cci_originator | cci_originator |
| std::unique_ptr< ConfigHolder > | root |
design configuration reader
A class to configure a design hierarchy using a JSON input file. It reads a file and and stores its values into a CCI broker. It can apply the value also to sc_attribute once the design is installed.
Definition at line 41 of file configurer.h.
| using scc::configurer::base_type = sc_core::sc_module |
Definition at line 45 of file configurer.h.
| using scc::configurer::broker_t = cci::cci_broker_handle |
Definition at line 46 of file configurer.h.
| using scc::configurer::cci_param_cln = std::vector<std::pair<cci::cci_param_post_write_callback_untyped, std::unique_ptr<cci::cci_param_untyped>>> |
Definition at line 47 of file configurer.h.
| anonymous enum |
Definition at line 48 of file configurer.h.
| scc::configurer::configurer | ( | std::string const & | filename, |
| unsigned | sc_attr_config_phases = BEFORE_END_OF_ELABORATION ) |
create a configurer using an input file
| filename | the input file to read containing the values to apply |
| sc_attr_config_phases | defines when to apply the values to sc_attribute instances |
Definition at line 667 of file configurer.cpp.
| scc::configurer::~configurer | ( | ) |
Definition at line 680 of file configurer.cpp.
|
protected |
Definition at line 670 of file configurer.cpp.
|
inlineoverrideprotected |
Definition at line 154 of file configurer.h.
|
protected |
Definition at line 848 of file configurer.cpp.
| void scc::configurer::configure | ( | ) |
configure the design hierarchy using the input file. Apply the values to sc_core::sc_attribute in th edsign hierarchy
Definition at line 726 of file configurer.cpp.
| void scc::configurer::dump_configuration | ( | std::ostream & | os = std::cout, |
| bool | as_yaml = true, | ||
| bool | with_description = false, | ||
| bool | complete = true, | ||
| sc_core::sc_object * | obj = nullptr ) |
Immediately dumps the parameters of a design hierarchy to the given output stream As this dumps the parameters immediately it should only be called during start_of_simulation since many parameters are created during before_end_of_elaboration or end_of_elaboration.
| os | the output stream, std::cout by default |
| as_yaml | write in YAML format instead of JSON |
| with_description | if dumped to YAML write also the description of cci param as comments |
| complete | includes unused cci preset values liek log_level |
| obj | if not null specifies the root object of the dump |
Definition at line 701 of file configurer.cpp.
|
inline |
Schedule the dump of the parameters of a design hierarchy to a file during start_of_simulation()
| file_name | the output stream, std::cout by default |
| with_description | if dumped to YAML write also the description of cci param as comments |
| complete | includes unused cci preset values liek log_level |
| stop_list | a list of hierarchy paths where dumping should stop |
Definition at line 84 of file configurer.h.
|
inlineoverrideprotected |
Definition at line 158 of file configurer.h.
|
inlinestatic |
find the configurer in the design hierarchy
Definition at line 139 of file configurer.h.
| void scc::configurer::read_input_file | ( | std::string const & | filename | ) |
Definition at line 682 of file configurer.cpp.
| void scc::configurer::set_configuration_value | ( | sc_core::sc_attr_base * | attr_base, |
| sc_core::sc_object * | owner ) |
set a value of an sc_attribute from given configuration. This is being used by the scc::ext_attribute which allows to use config values during construction
| attr_base | |
| owner |
Definition at line 728 of file configurer.cpp.
|
protected |
Definition at line 742 of file configurer.cpp.
|
inline |
set a value of some property (sc_attribute or cci_param) directly
In case the configurer is being used without CCI the function can only be called after the simulation objects are instantiated since the sc_attributes have to exist.
| hier_name | the hierarchical name of the property |
| value | the value to put |
Definition at line 113 of file configurer.h.
| void scc::configurer::set_value_from_str | ( | const std::string & | hier_name, |
| const std::string & | value ) |
set a value of some property (sc_attribute or cci_param) directly
this version automatically converts the string into the needed target data type
In case the configurer is being used without CCI the function can only be called after the simulation objects are instantiated since the sc_attributes have to exist.
| hier_name | the hierarchical name of the property |
| value | the value to put |
Definition at line 760 of file configurer.cpp.
|
overrideprotected |
Definition at line 871 of file configurer.cpp.
|
protected |
Definition at line 165 of file configurer.h.
|
protected |
Definition at line 163 of file configurer.h.
|
protected |
Definition at line 166 of file configurer.h.
|
protected |
Definition at line 150 of file configurer.h.
|
protected |
Definition at line 147 of file configurer.h.
|
protected |
Definition at line 148 of file configurer.h.
|
protected |
Definition at line 167 of file configurer.h.
|
protected |
Definition at line 151 of file configurer.h.
|
protected |
Definition at line 149 of file configurer.h.