Jump to content

Negative values


Recommended Posts

Hi,

 

It seems that the constraint solver has as issue with negative values.

I tried this example:

 

struct addr_constraint : public scv_constraint_base {
 
  scv_smart_ptr<sc_int<8>> row;
  scv_smart_ptr<sc_int<8>> col;
 
  SCV_CONSTRAINT_CTOR(addr_constraint)
{
    SCV_CONSTRAINT ( (col() + row() == 10)
}

 

In this case I only got positive values for col and row.

I tried playing with the constraint and tried the following:

 

 SCV_CONSTRAINT ( (col() + row() == 10) || (col() - (0 - row()) == 10) );

 

This constraint is identical to the previous one but now I get both negative and positive values for col and row.

 

Anyone else had this issue?

Why does it happen?

 

Thanks!

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.

 Share

×
×
  • Create New...