Llama Posted March 8, 2023 Report Share Posted March 8, 2023 Hi , I have some variable bit-length variables like, sc_uint<10> x; sc_bit y; sc_int<8> z; and a bit vector sc_bv<19> a; Note: Combined bit-length of x,y,z is equal to length of a. I'm able to assign the combined vector to the bit_vector a like, a = (x,y,z); However I'm unable to do the reverse assignment like, (x,y,z) = a; Please provide suggestions to achieve the above. Quote Link to comment Share on other sites More sharing options...
David Black Posted March 8, 2023 Report Share Posted March 8, 2023 6 minutes ago, Llama said: Hi , I have some variable bit-length variables like, sc_uint<10> x; sc_bit y; sc_int<8> z; and a bit vector sc_bv<19> a; Note: Combined bit-length of x,y,z is equal to length of a. I'm able to assign the combined vector to the bit_vector a like, a = (x,y,z); However I'm unable to do the reverse assignment like, (x,y,z) = a; Please provide suggestions to achieve the above. SystemC is C++. SystemC is neither Verilog nor VHDL. You could create a simple class with a constructor to take apart a vector. With some clever trickery you might even be able to coax a C++11 variadic template to do exactly what you want. Llama 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.