Paul Riemer Posted January 7, 2019 Report Posted January 7, 2019 How does one concatenate a group of bool signals into a sc_uint? Quote
Roman Popov Posted January 7, 2019 Report Posted January 7, 2019 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; } Quote
Paul Riemer Posted January 7, 2019 Author Report Posted January 7, 2019 Yes, I have been trying uint_sig = (bool_sig1, bool_sig0); Which does compile but only the bool_sig0 is concatenated. Quote
Roman Popov Posted January 7, 2019 Report Posted January 7, 2019 28 minutes ago, Paul Riemer said: Yes, I have been trying uint_sig = (bool_sig1, bool_sig0); Which does compile but only the bool_sig0 is concatenated. As expected: https://stackoverflow.com/questions/52550/what-does-the-comma-operator-do Quote
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.