Hi, I'm new to UVM and have a constraint/general test bench architecture question. I'm wondering how can I override my sequence_item/transaction constraints (that are buried within my hierarchy)? I'm architecting this test bench such that the default constraints buried in the hierarchy have the "good" configuration (such that the DUT receives "good/expected" data). I want to have the atypical/variations on the "good/default" case occur in each test via overriding various constraints. I'm having trouble figuring out how to access these constraints at the test level. Below is the pseudocode of my hierarchy. In this example, how could I constrain "value" to something other than [0:200] at the test level?
class my_data extends uvm_object;
rand bit [15:0] value;
`uvm_object_utils_begin(my_data)
`uvm_field_int(value, UVM_ALL_ON)
`uvm_object_utils_end
constraint value_c {value inside {[0:200]}; }
endclass
class my_transaction extends uvm_sequence_item;
rand my_data data_obj;
`uvm_object_utils_begin(my_transaction)
`uvm_field_object(data_obj, UVM_ALL_ON)
`uvm_object_utils_end
endclass
class my_sequence extends uvm_sequence#(my_transaction);
task body();
my_transaction my_tr;
repeat(10) begin
my_tr = my_transaction::type_id::create("my_tr");
start_item(my_tr);
assert(my_tr.randomize());
finish_item(my_tr);
end
endtask: body
endclass
class my_base_test extends uvm_test;
task run_phase(uvm_phase phase);
my_sequence my_seq;
phase.raise_objection(.obj(this));
my_seq = my_sequence::type_id::create("my_seq", this);
assert(my_seq.randomize());
my_seq.start(my_env.my_agnt.my_seqr);
phase.drop_objection(.obj(this));
endtask: run_phase
endclass: my_base_test