Maulik Suthar
Newbie level 3
- Joined
- Jul 16, 2013
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 26
hello, i want to know how exactly a do_copy method works? what is the need of $cast(rhs_, rhs)?
and also why to call the super.do_copy(rhs)??
here in this do_copy, i am just copying the same type of transaction into another same type object then why i need to do $cast??
and also why to call the super.do_copy(rhs)??
Code:
function void write_xtn::do_copy (uvm_object rhs);
// handle for overriding the variable
write_xtn rhs_;
if(!$cast(rhs_,rhs)) begin
`uvm_fatal("do_copy","cast of the rhs object failed")
end
super.do_copy(rhs);
data= rhs_.data;
address= rhs_.address;
write= rhs_.write;
xtn_type= rhs_.xtn_type;
xtn_delay= rhs_.xtn_delay;
endfunction:do_copy