Actually i have a sequnce item svt_transaction. i have a sequence svt_random_sequence in which object for the class svt_transaction has been created and randomized.
Now i have extended a class as cust_svt_transaction from base class svt_transaction and modified the constraints.
Now for a specific test suppose svt_random_test, i want to randomize the extended sequence item (cust_svt_transaction) instead of base sequence item (svt_transaction) in the sequence svt_random_sequence (not changing anything in the sequence)
i want to make this from the test as follows:
class svt_random_test extends base_test;
…
…
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
factory.set_type_override_by_type(svt_transaction::get_type(),cust_svt_transaction::get_type());
uvm_config_db#(uvm_object_wrapper)::set(this, “env.agent1.sequencer1.main_phase”, “default_sequence”, svt_random_sequence::type_id::get());
endfunction : build_phase
…
…
endclass
Is this right?..