i have made constraint for data_in variable in seq_item file.i need to overwrite my constraint so i have used “soft”.
class abc_pkt extends uvm_sequence_item;
rand bit [31:0] data_in[$:15];
rand e_hburst m_hburst;
constraint data_in_c{
(m_hburst == SINGLE) -> soft (data_in.size()==1);
(m_hburst inside {WRAP4,INCR4}) -> soft (data_in.size()==4);
(m_hburst inside {WRAP8,INCR8}) -> soft (data_in.size()==8);
(m_hburst inside {WRAP16,INCR16}) -> soft (data_in.size()==16);
}
endclass
from sequence i have overwrite like below
class buf_wr_rd_seq extends abc_seq;
.
.
`uvm_do_with(req,{req.m_hburst == INCR16;req.m_hwrite == 1;req.m_haddr == t_haddr;req.data_in.size()== 40;})
endclass
but it is showing error like:
Solver failed when solving following set of constraints
rand bit[31:0] data_in.size(); // rand_mode = ON
rand ahb_pkt::e_hburst m_hburst; // rand_mode = ON
constraint data_in_c // (from this) (constraint_mode = ON) (…/cc/abc_seq_item.sv:105)
{
(m_hburst inside {ahb_pkt::e_hburst::WRAP16, ahb_pkt::e_hburst::INCR16}) → (data_in.size() == 16);
}
constraint WITH_CONSTRAINT // (from this) (constraint_mode = ON) (…/cc/abc_seq.sv:250)
{
(m_hburst == ahb_pkt::e_hburst::INCR16);
(data_in.size() == 40);
}
Error-[CNST-CIF] Constraints inconsistency failure
…/cc/abc_seq.sv, 250
Constraints are inconsistent and cannot be solved.
Please check the inconsistent constraints being printed above and rewrite
them.
thanks,