casting failed in the below code. It was working and then started failing the casting(no change in this sequence) . what could be the issue to make the casting failed in this code?
sequencer also having same transaction type.
import xyz:: *;
class simple_seq extends simple_base_seq;
`uvm_object_utils(simple_seq)
`uvm_declare_p_sequencer(seqr1);
xyz::simple_txn txn1;
function new(string name = "simple_seq");
super.new(name);
endfunction : new
virtual task body();
If(!$cast (txn1, uvm_factory::get().create_object_by_name(xyz::simple_txn, simple_txn_inst1))) begin
`uvm_fatal(get_full_name(), unable to cast ")
end
//assigning values to transaction item in txn1
....
…
endtask
endclass