Jump to content
sosarkar

ASCII string to sc_bv and vice versa

Recommended Posts

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

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

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

×