Jump to content
campo85

sc_bitref usage

Recommended Posts

Hi all,

 

I've a problem pretty stupid I guess. I have this piece of code that doesn't compile at all. I guess the documentation I'm reading is old and something has changed in the SystemC library because this code comes from the documentation:

sc_logic mybit;
sc_uint<8> myint;
mybit = myint[7];

This is what I get:

fde.cpp: In member function ‘void fde::cir_elab()’:
fde.cpp:42:11: error: ambiguous overload for ‘operator=’ (operand types are ‘sc_dt::sc_logic’ and ‘sc_dt::sc_uint_bitref’)
     mybit = myint[7];
           ^

 

I guess I have to do some typecasting but I'm still not really skilled with C++. I've seen I need to use the sc_bitref class, not clear how. Does someone know how to fix this ?

 

Cheers,

Stefano.

 

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

×