# Constraint solver problem

**URL:** <https://verificationacademy.com/forums/t/constraint-solver-problem/42204>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [August 24, 2023, 7:05pm UTC](https://verificationacademy.com/forums/t/constraint-solver-problem/42204 "2023-08-24T19:05:02Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![sam497](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sam497](https://verificationacademy.com/forums/u/sam497)\
**Post date:** [August 25, 2023, 8:58am UTC](https://verificationacademy.com/forums/t/constraint-solver-problem/42204/4 "2023-08-25T08:58:27Z")

</div>

_In reply to [sam497](https://verificationacademy.com/forums/t/constraint-solver-problem/42204/3):_

sorry for confusion my question is about issue coming when I constraint add to 10 over the size of 100

```verilog
constraint size_1 {

inst.sum with (int'(item==SUB_1) inside {0,2,8,16});
inst.sum with (int'(item==MUL_1) inside {[0:5]} );
inst.sum with (int'(item==XOR) inside {[0:5]} );
inst.sum with ((item==ADD_1) == 10 );

}

```

for ADD instruction only constraint I am seeing constraint solver Issue  
Solver failed when solving following set of constraints

rand bit[30:0] inst.size(); // rand\_mode = ON  
rand ex01\_pkg\_serial\_child\_sequence\_11\_0::instruction fv\_temp\_111; // rand\_mode = ON  
rand bit[0:0] fv\_temp\_114; // rand\_mode = ON  
rand bit[0:0] fv\_temp\_115; // rand\_mode = ON  
rand bit[0:0] fv\_temp\_116; // rand\_mode = ON

constraint size\_1 // (from this) (constraint\_mode = ON) (…/ex01/serial\_child\_sequence.sv:59)  
{  
(fv\_temp\_116 == (inst.size() \* ((fv\_temp\_111 == ex01\_pkg\_serial\_child\_sequence\_11\_0::instruction::ADD\_1) == 10)));  
((fv\_temp\_114 \>= fv\_temp\_115) && (fv\_temp\_114 \<= fv\_temp\_116));  
fv\_temp\_114;  
}

---

_[View the full topic](https://verificationacademy.com/forums/t/constraint-solver-problem/42204)._
