I am using `uvm_do_with with variable constraints . I am trying to assign object instance through uvm_do_with –
class io_item extends uvm_sequence_item;
rand i_entry entry; (object instance)
rand o_exit exit; (object instance)
function new ()
entry = new
exit = new
endfunction
endclass
class seq extends uvm_sequence#(io_item);
rand int addr;
rand i_entry entry; (object instance)
rand o_exit exit; (object instance)
`uvm_do_with(req,{req.addr == local::addr;req.entry == local::entry;req.exit == local::exit;})
endclass
from above example -
object instance assigment req.entry == local::entry and req.exit == local::exit will not get assigned and throws randomization failure error saying conflicts of constraints.
there are no constraints present . can’t we use object instance in `uvm_do_with ?
Fine, where/how are you randomizing local class, after randomizing can you see (using $display, to make sure no X) that variables of local class are getting randomized ?
I think i have already explained “this” wont work , while assigning local variable either local variable name has to be different or have to use local:: that to only for inline constraint. i am not facing any issue in variable assignment , only for object instance assignment i faced the issue .
and with the use of “this” it wont assign correct value if variable names are same in `uvm_do_with