Martin Barnasconi Posted August 8, 2013 Report Share Posted August 8, 2013 Hi all, I'm using a bit-select of a sc_bv in an expression, something like this: sc_bv<8> mybits; ... if (mybits.to_bool()) // do something Sure this works, but I'm not so happy with this coding style. Therefore I expected some intelligence in the sc_proxy class to resolve the bit to bool conversion, simply because the sc_bv can be seen as an array of bools. I expected that this would work as well: sc_bv<8> mybits; ... if (mybits) // compiler error here // do something Pity... we get the following compiler error: ... error: could not convert ‘sc_dt::sc_proxy<X>::operator(int) [with X = sc_dt::sc_bv_base](0)’ to ‘bool’ It seems this type of functionality is not (or cannot be) implemented in the sc_proxy? Quote Link to comment Share on other sites More sharing options...
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.