Jump to content

conversion from '__int128 unsigned' to 'const data_type {aka const sc_dt::sc_biguint<256>}' is ambiguous FUNC_IN.write(0x2238787adf909278327848273467382467fffffffffffffffff130389);


acc_sysC

Recommended Posts

There is no constructor defined for sc_biguint taking an __int128 or a __uint128. _int128 is not a C nor C++ datatype, some compiler support it, many do not. But your literal does not fit into it anyways. So if you want to assign as 256bit datatype you have to slice it into supported datatypes (uint64_t):

auto write_val = sc_dt:.sc_biguint<64>(0x2238787)<<192 + sc_dt:.sc_biguint<64>(0xf909278327848273)<<128  + sc_dt:.sc_biguint<64>(0x467382467fffffff)<<64 + sc_dt:.sc_biguint<64>(0xffffffffff130389);
FUNC_IN.write(write_val);

 

Link to comment
Share on other sites

@Eyck I tried it and it gives me this error:

error: expected primary-expression before ':' token
    auto write_val = sc_dt:.sc_biguint<64>(0x2238787)<<192 + sc_dt:.sc_biguint<64>(0xf909278327848273)<<128 + sc_dt:.sc_biguint<64>(0x46738ffff)<<64 + sc_dt:.sc_biguint<64>(0xffffffffff130389);

Here's the EDA link:https://www.edaplayground.com/x/bUPa


 

 

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