ronyz Posted July 27, 2015 Report Posted July 27, 2015 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! Quote
Recommended Posts
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.