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!