In reply to UVM_learner6:
You can’t. You need a handle to the object to be able to enable/disable a constraint.
This is one reason that you should never use the `uvm_do macros and should implement the actual code necessary to send the sequence_item.
Could you help with how I can convert the uvm_do_with to actual code necessary to send the item?
In reply to cgales:
Could you help with how I can convert the uvm_do_with to actual code necessary to send the item?
In you body task of your sequence you have to create a handle/object of the seq_item.
In the next step you can switch off all conatraints in the seq_item by calling
<seq_item_object>. constraint_mode(0);
If the object name is req it would be reg.constraint_mode(0);
If you want to switch off only a specific constaring you can call:
<seq_item_object>.<constraint_name>.constraint_mode(0);
In reply to UVM_learner6:
In you body task of your sequence you have to create a handle/object of the seq_item.
In the next step you can switch off all conatraints in the seq_item by calling
<seq_item_object>. constraint_mode(0);
If the object name is req it would be reg.constraint_mode(0);
If you want to switch off only a specific constaring you can call:
<seq_item_object>.<constraint_name>.constraint_mode(0);
I created an obj of the SI and then turned off the specific constraint.
This did not work, if I do this to turn off constraint before using uvm_do_with, it says “null object access”
That’s correct what happens.
`uvm_do macros are creating an objetc are calling start_item, randomizing and calling finish_item.
Lööks like you have to to this explicitly without the uvm_do macro.