cpu_x_transaction class snippet:
1 virtual function bit compare_fields(cpu_x_transaction rhs);
2 cpu_x_transaction trans;
// Cast the object type with transaction type
3 if(!$cast(trans, rhs)) begin
Q:
- What is the purpose of comparing same filed in the same class by taking two handle trans and rhs ?
- Why $cast is required here even though both rhs and trans are same cpu_x_transaction type ?
cpu_x_transaction class snippet:
1 virtual function void do_copy (uvm_object rhs);
2 cpu_x_transaction rhs_;
3 super.do_copy(rhs);
4 $cast(rhs_,rhs);
Q:
What is the use of copying rhs_ in rhs ?
what super.do_copy do here ?
Thanks in advance …