ChangeLog
GreenConfig ChangeLog
This page lists the changes made for GreenConfig for the releases. The first list is a list of the changes, including internal and user-relevant ones. The section Details goes into more details for the changes that are user relevant.
GreenConfig v. 1.x.x
- Changed command line options:
- added gs_ prefix, disabled short options by default (to avoid collisions with other vendors)
- Changed priority of simple parameter array sizing during construction, growing priority:
- default size (10),
- highest implicit member (e.g. set byconfig file) without having specified the init_size-member,
- SystemC constructor array size,
- implicit parameter init_size-member
- Fixed simple parameter array init_size handling
- Added support for
gs_param<unsigned short>
GreenConfig v. 1.2.4
- Fixed bug in extended parameter array (gs_param_array) operator[]
- Added
gs_param<std::vector<std::string> >template specialization - Enhanced
gs_param<sc_time>template specialization to support more deserialization syntaxes - Watcher proof of concept
Details
gs_param<sc_time>
Can now deserialize the following strings to sc_time:
- "<double value>" -> Convert to seconds (reverse way of the
sc_time::to_double()function)- Example:
my_param.setString("0.000000025");sets value to 25 ns
- Example:
- "<uint64> <sc_time_unit>" (reverse way of
sc_time::to_string()function)- Example:
my_param.setString("25 ns");sets value to 25 ns - Example:
my_param.setString("25 SC_NS");sets value to 25 ns
- Example:
gs_param<vector<string> >
Serializes a vector to e.g.
- {"This","is the","simplest","example"}
- {"example","with","quotes \"here\" inside and comma, here","and single quote 'here"}
Syntax to set the string representation of such a parameter:
Example C++ code:
- vecLocal.setString(std::string("{\"example\", \"with\", \"quotes \\\"here\\\" inside and comma, here\", \"and single quote 'here\" }"));
- IPVec.vec5 "{ "with", "quotes in \\"this\\"." }"
- # we need this double \\ syntax to be the same as in code (\" needs to be in the resulting string being set)
GreenConfig v. 1.2.2
- Switch -DUSE_BOOST_PROG_OPT to enable boost program options instead of getopt for parsing command line options.
- Support for 64 bit machines
- Config file parse does handle \\"" to \" instead of " (only search one time for \" and replace)
GreenConfig v. 1.2.1
- GreenConfig command line options use getopt as default again, instead of boost_program_options. The default is defined in config_globals.h
GreenConfig v. 1.2.0
- Config files allow tab character
- gs_param<unsigned char> supports setting with 'x' (Note: the surrounding 's are important! Otherwise a '0'=48 differs not from 0.)
- Added gs_param<char> which also supports setting with 'x'
- Added == operators to compare gs_params of same type to each other and with objects of their type
- Command line option tools now use boost_program_options instead of getopt. This is more portable but needs the linked library boost_program_options.
- Renamed internal enum members to avoid macro clash (enum
gc_config_parse_result) - Fixed bug in lua file parser (for big values)
- gs_param
int,unsigned int,long long,unsigned long longnow ignore decimal dots
GreenConfig v. 1.1.0
- Added support (and fix) for gs_params that are not registered at the database
- Fixed command line tool not using deprecated API calls
- Parameter attributes
- Command CMD_GET_PARAM_LIST deprecated, new command CMD_GET_PARAM_LIST_VEC submitting a vector
- Config API function getPar does no longer make SC_WARNING when getting fails.
Details
Parameter attributes:
Parameters may have a set of attributes which give more information about their usage within the model. Parameter attributes (gs::cnf::param_attribute) (don’t mistake them for sc attributes) are simple unsigned ints, represented with an enumeration: gs::cnf::param_attributes::param_attribute_enum. The possible types are: config, runtime config, elab config, read only, analysis, temp, output, internal.
Parameters not registered at the database There may be situations where it is reasonable to create parameters that are not registered at the database (regardless whether this is the normal or a private one). The advantages of parameters can be used without the need of making them accessible via the API and plugin (database). There are special constructors allowing this (See User's Guide).
GreenConfig v. 1.01
* Compatibility to gspm GreenBus 1.1 release: example gav_demonstration_platform uses static casts.
GreenConfig v. 1.0
- gs_param constructors: added force_top_level_name bool to allow arbitrary parameter names
- constructors of gs_param_base, gs_param_t<T> and gs_param<t> slightly changed
- gs_param, gs_param_array: added constructors getting parent array references (not only pointers)
- marked GCnf_Api::getNewParamEvent as deprecated, use callback mechanism instead
- iterator of gs_param_array returns pointer to member instead of reference
- gs_param template specializations (user and provided ones) need to implement a static deserialize function instead of a non-static one.
- Added GCnf_Api and gs_param_base function get_gs_param<T> returning a casted gs_param (see details).
- Added GCnf_Api and gs_param_base functions getValue<T> returning the value (independent of implicit or explicit status) (see details).
- Added API-Plugin command CMD_GET_VAL to get the implicit or explicit parameter value (as string).
- gs_params now may be used/instantiated at top-level. They are named without any prefix.
- All GCnf_Api calls now are allowed to get non-hierarchical parameter names (to allow top-level parameters).
- moved example demonstration_platform_0.3 -> demonstration_platform and mixed_tests_0.3 -> mixed_tests
- New coding rule: use gs::cnf::GCnf_Api::getApiInstance(module_ptr) instead of creating an own GCnf_Api instance!
- Use interface gs::cnf::cnf_api to store and access GCnf_Api pointers returned by getApiInstance(mod):
gs::cnf::cnf_api *mApi = gs::cnf::GCnf_Api::getApiInstance(this); - gcnf_api_if renamed to initialize_if (and file renamed)
- GCnf_Api header file moved (old one deprecated): use greencontrol/gcnf/apis/GCnf_Api/GCnf_Api.h
- gs_param<*array>: Array size implicitly set during construction according to the implicit member params in the database.
- Array at() 'operator' does automatically resize if member no (yet) existing.
Details
New parameter constructors taking forced top-level names and
Parameter names allow delimiters ('.'):
Parameter constructors now have an optional bool switch which forces the parameter name to be exactly like the submitted name. No prefix (parent's name) is attached. Some example constructors (many more are available):
- gs_param(string name, string/type value, bool force_top_level_name);
- gs_param(string name, string/type value, bool force_top_level_name);
- gs_param(string name, string/type value, parent_array, bool force_top_level_name);
- gs_param<int> myparam1("anyTopLevelName", 10, true);
- gs_param<int> myparam2("anyTopLevelName.hierarchicalparam", 20, true);
- gs_param<int> myparam3("anyHieraryName.subHierarchy.hierarchicalparam", 30);
myparam2 will be named "anyTopLevelName.hierarchicalparam" and NOT "mymodule.anyTopLevelName.hierarchicalparam".
myparam2 will be named "mymodule.anyHieraryName.subHierarchy.hierarchicalparam".
New parameter constructors getting parent array references:
Parent parameter arrays now may be given as references to the created parameter (or array):
- gs::gs_param_array pararr("TestArray");
- gs::gs_param<int> arrMember1("parname1", 42, pararr); // take reference
- gs::gs_param<int> arrMember2("parname2", 42, ¶rr); // take pointer
Access implicit (or explicit) values without using the parameter object itself:
- bool cnf_api::getValue<T>(const std::string &parname, T &value)
- int i;
- bool success = myApi->getValue<int>("modA.int_param", i);
- T cnf_api::getValue<T>(const std::string &parname)
- int i = myApi->getValue<int>("modA.int_param");
Get a gs_param object instead of a gs_param_base object:
- gs_param<T>* cnf_api::get_gs_param<T>(const std::string &parname) (may be used instead of cnf_api::getPar(parname))
- gs_param<unsigned int> *par = myApi->get_gs_param<unsigned int>("modA.uint_par");
gs_param_array iterator returns pointer to member;
Changed from (*it).getString() to (*it)->getString()
- gs::gs_param_array::iterator it;
- for (it = topArr.begin(); it != topArr.end(); ++it) {
- }
GreenConfig v. 0.3
Namespace
- Namespace changed from tlm::gc::config -> gs::cnf
Parameter Data Types
Added supported SystemC data types:
- sc_int_base
- sc_int
- sc_uint_base
- sc_uint
- sc_signed
- sc_bigint
- sc_unsigned
- sc_biguint
- sc_logic
Deprecated daty type:
- sc_bit (deprecated, use bool instead)
Parameter Base: get void* value
The virtual function
virtual void* get_value_pointer()
can be used to cast the value to a base class of the value, e.g. cast a sc_int<length> to sc_int_base.
A use case are SystemC data types where it is not possible to cast a gs_param_base to the corresponding type, e.g. gs_param<sc_int<10> >. In this case call get_value_pointer() on the base parameter and cast the result e.g. to sc_int_base.
Parameter and Base: operators
- Added to param_base operators +, -, *, / returning tripple to be used by the Calculator in GreenAV.
- Added standard operators +, -, *, / to be used instead of the base operators when using a derived class.
GreenConfig v. 0.2
Initial GreenConfig release
- Configuration service plugin
- Configurable parameters gs_param
- Main configuration API GCnf_Api
- SCML API
- Tool API
- Command Line Tool (command line within simulation)
- Config File Parser
- Command Line Config Parser (argv arguments)
- Printer-friendly version
- Login or register to post comments
Posted May 14th, 2008 by ChristianSchroeder