sosarkar 0 Report post Posted January 31, 2014 Hello, I am somewhat new to SystemC and I am interested in converting ASCII string to sc_bv and vice versa. I tried static casting the string without success. I am trying with stringstream; first convert the string to a stream and then stream into sc_bv. Any comments and suggestions are welcome. Thanks for your kind attention. ~S Share this post Link to post Share on other sites
ralph.goergen 57 Report post Posted January 31, 2014 Hi. As far as I know, the following should work: sc_bv<8> my_bv_var("01010101"); and my_bv_var.to_string(); See IEEE 1666 - 2011: 7.9.3 and 7.9.5 for details. Greetings Ralph Share this post Link to post Share on other sites
sosarkar 0 Report post Posted January 31, 2014 Thanks Ralph. Share this post Link to post Share on other sites
dakupoto 33 Report post Posted February 1, 2014 Hello, I am somewhat new to SystemC and I am interested in converting ASCII string to sc_bv and vice versa. I tried static casting the string without success. I am trying with stringstream; first convert the string to a stream and then stream into sc_bv. Any comments and suggestions are welcome. Thanks for your kind attention. ~S Hello Sir. Please note that whenever you use casting, you are trying to force the compiler to do something that it normally would not do, and so create irritating side-effects. This especially true in a complicated simulation involving large number of interacting modules. The best option is to use string literals. This is especially true if Share this post Link to post Share on other sites