Jump to content
Paul Riemer

Concatenate in SystemC

Recommended Posts

Do you want to concatenate a group of sc_signal<bool> into sc_signal<sc_uint> ?

You need to create a SC_METHOD to do this, for example:

 

sc_signal<bool> bool_sig0{"bool_sig0"}; 
sc_signal<bool> bool_sig1{"bool_sig1"};
sc_signal<sc_uint<2>> uint_sig{"uint_sig"};

...

SC_METHOD(concat_method);
sensitive << bool_sig0 << bool_sig1;

...

void concat_method() {
  sc_uint<2> new_val;
  new_val[0] = bool_sig0;
  new_val[1] = bool_sig1;
  uint_sig = new_val;
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×