Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

UVM: explain do_copy method in detail

Status
Not open for further replies.

Maulik Suthar

Newbie level 3
Newbie level 3
Joined
Jul 16, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
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)??

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
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??
 

still i am not clear with the do_copy function, i will be glad if u elaborate a little
thank u
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top