Use of $cast to copy values

In reply to hkc:

Hello,

I attach further piece of code here

`uvm_info(get_full_name(),{"\nOBSERVED OUTPUTS ::\n",item.convert2string()},UVM_LOW)
	
pkt = idct_sequence_item::type_id::create("PKT");
		
$cast(pkt,item);
//pkt.copy(item);
				
//Calculating expected outputs
pkt = M0.idct_process(pkt);
`uvm_info(get_name(),{"\nEXPECTED OUTPUTS ::\n",pkt.convert2string()},UVM_LOW)

After calling idct_process(pkt), both “pkt” and “item” has same interval property values which is undesired. So I used copy (do_copy) method to solve this issue so that process done on “pkt” is not reflected on “item” object.