Jump to content

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 ?





Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...