mahbod72 Posted July 8, 2015 Report Share Posted July 8, 2015 Hi i define this signals sc_signal< sc_lv <8> > ctrl; sc_signal< sc_bit> ctrl_ac; and i want to assign bit 0 ctrl to ctrl_ac but i dont no how i can do it ctrl_ac = ctrl[0]; please help me Quote Link to comment Share on other sites More sharing options...
ralph.goergen Posted July 8, 2015 Report Share Posted July 8, 2015 Hi. a) for signals, you should use methods 'read' and 'write' instead of assignment. you are using sc_lv which is a vector of sc_logics together with sc_bit. Maybe, you should think about using sc_bv (vector of bits) instead of sc_lv or sc_logic instead of sc_bit. c) ctrl_ac.write(ctrl.read()[0]); Greetings Ralph Quote Link to comment Share on other sites More sharing options...
mahbod72 Posted July 8, 2015 Author Report Share Posted July 8, 2015 thank you very much Quote Link to comment Share on other sites More sharing options...
apfitch Posted July 8, 2015 Report Share Posted July 8, 2015 By the way, sc_bit was deprecated in 1666-2005 (10 years ago!) so it's preferred to use bool, regards Alan Quote Link to comment Share on other sites More sharing options...
Amit Bhandu Posted August 7, 2015 Report Share Posted August 7, 2015 you can also use - ctrl_ac.write( ctrl.read().to_uint() & 0x01 ); 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.