Jump to content

problem on clone


chenyong

Recommended Posts

Hi,

I met a problem on clone. In my code for scoreboard, I defined a variable as this:

timer_pkt_item chk_pkt;

the timer_pkt_item is defined as a class in other place. I then register it as:

`uvm_component_utils_begin(timer_scoreboard)

`uvm_field_object(chk_pkt, UVM_DEFAULT)

`uvm_component_utils_end

In my write function for export implementation, I would like to do this:

function void write_pkt(timer_pkt_item rcv_pkt);

chk_pkt = rcv_pkt.clone();

endfunction

My purpose is to save received data of rcv_pkt.

When I start to compile the code, irun reports error as:

assignment operator type check failed (expecting datatype compatible with 'class timer_pkt_item' but found 'class uvm_object' instead). so what is the problem to the code? I think I have defined the variable type as timer_pkt_item, why there is problem? please give me some help. thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...