Jump to content

cci_param of cci_value_list/map


Recommended Posts

Hi,

In my model I would like to have a module for which the number of parameters is variable i.e. I would like to have a vector of cci_parameters, or a cci_parameter which contains a vector of cci_values.

I read the following in the specification in section "5.5.2 cci_value":

Quote

The cci_value class shall provide a variant type for exchanging configuration parameter values. The following types are supported:

User-specific data types, supported by implementing the helper template class cci_value_converter<T>(which is also the mechanism by which the C++ and SystemC data types are supported)

C++ arrays and std::vector<> of any supported data type, converting to a cci_value_list.

Lists (vectors) of cci_value, represented as cci_value_list.

String-keyed maps of cci_value, represented as cci_value_map.

This seemed to imply to me that it is possible to have a cci_param which contains a cci_value_list or cci_value_map with entries that are cci_values and hence have individual handles. This is exacly what I'm looking for. However, I have no clue how to use it. :-)

For example doing the following (in analogy to the usage of custom types in Annex D) results in a compiler error:

 cci::cci_value_map testmap;
 cci::cci_param<cci::cci_value_map> myparam("paramname", testmap);

How could I get this to work? Or should I resort to writing my own custom type?

Thanks!

Wim

 

 

 

Link to comment
Share on other sites

Hi,

Thanks for the feedback. With the above 2 lines of code I get following compiler errors:

cci-1.0.0/src/cci_cfg/cci_param_typed.h:760:40: error: no matching function for call to cci::cci_value::get() const

cci-1.0.0/src/cci_core/cci_value.h:200:27: error: no type named type in struct cci::cci_value_converter<cci::cci_value_map>

cci-1.0.0/src/cci_cfg/cci_param_typed.h:809:5: error: no matching function for call to cci::cci_value::try_get(cci::cci_value_map&)

cci-1.0.0/src/cci_core/cci_value.h:192:8: error: no type named type in struct cci::cci_value_converter<cci::cci_value_map>

cci-1.0.0/src/cci_cfg/cci_param_typed.h:769:48: error: no matching function for call to ‘cci::cci_value::get() const

cci-1.0.0/src/cci_core/cci_value.h:200:27: error: no type named type in struct cci::cci_value_converter<cci::cci_value_map>

Cheers,

Wim

Link to comment
Share on other sites

Hi Wim,

On 11/25/2019 at 5:41 PM, wvandamm said:

This seemed to imply to me that it is possible to have a cci_param which contains a cci_value_list or cci_value_map with entries that are cci_values and hence have individual handles

Currently, cci_param<T> indeed does not support any of cci_value, cci_value_list, cci_value_map as value type T. The main reason is, that it would otherwise cause ambiguities in the API of cci_value(_list,_map) itself, if the generic conversion functions (which are used by cci_param internally) would support this.  However, it might be possible to extend cci_param<T> to support this scenario explicitly.

Greetings from Duisburg,
  Philipp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...