Jump to content

dynamic variable size ???


Recommended Posts

You can declare variables from the base classes of the templated SystemC types. These can be sized at run-time.


For instance, sc_lv<N> has a base class sc_lv_base, so you can write


sc_lv_base lv(size);


i.e. use a constructor argument to set the size.




Link to comment
Share on other sites

The constructor is called at runtime.


If you mean that you want to change the length of a vector during runtime, then you'll have to write your own code to do it. For instance to make a vector smaller, you could create a smaller vector, then copy the bits you want to keep across.


Of course you don't have to use SystemC data types, you could just use std::vector if it meets your requirements,


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.

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...