Jump to content

Is there a way to give a large input ?


acc_sysC

Recommended Posts

I tried the following ways:

 auto write_val = sc_dt::sc_biguint<64>(0xffffffffffffffff)<<192 + sc_dt::sc_biguint<64>(0xffffffffffffffff)<<128 + sc_dt::sc_biguint<64>(0xffffffffffffffff)<<64 + sc_dt::sc_biguint<64>(0xffffffffffffffff);

Also tried this:

sc_dt::sc_biguint<N> write_val =  sc_dt::sc_biguint<64>(0xffffffffffffffff)<<192 + sc_dt::sc_biguint<64>(0xffffffffffffffff)<<128 + sc_dt::sc_biguint<64>(0xffffffffffffffff)<<64 + sc_dt::sc_biguint<64>(0xffffffffffffffff);

It compiles but does not take any values I give it. write_val always has 0s. Please guide me.

EDA link:https://www.edaplayground.com/x/Dr6L

Link to comment
Share on other sites

The problem is operator precedence. The expression should look like:

    auto write_val = (sc_dt::sc_biguint<64>(0xffffffffffffffff)<<192) + (sc_dt::sc_biguint<64>(0xffffffffffffffff)<<128) + (sc_dt::sc_biguint<64>(0xffffffffffffffff)<<64) + sc_dt::sc_biguint<64>(0xffffffffffffffff);

 

Link to comment
Share on other sites

  • 2 weeks later...

I modified your example:

 			 sc_bv<N> write_val = (sc_dt::sc_bv<64>(0xffffffffffffffff)<<192) | (sc_dt::sc_bv<64>(0xffffffffffffffff)<<128) | (sc_dt::sc_bv<64>(0xffffffffffffffff)<<64) | sc_dt::sc_bv<64>(0xffffffffffffffff);
 


			Data_in.write(write_val);
          wait(SC_ZERO_TIME);
          cout<< "at time: " << sc_time_stamp()<< endl << "Data_in in stimulus = "<< Data_in.read() << endl;

If you write to a signal you need to wait at least for a delta-cycle to read the same value. Other than in my original post you need to or them rather than add.

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.

Guest
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...