Jump to content

using packer.unpack_object(x)


Recommended Posts

I am mis-understanding unpack_object in some way. It does not unpack the object as I expect but does if I call unpack_field_int on each member of the instantiated class.

Thanks for any clarification.

class BIG extends uvm_sequence_item;

bit[7:0] b;

SMALL sm;

function void do_unpack(uvm_packer);

super.do_unpack(packer);

b = packer.unpack_field_int($bits(B));

packer.unpack_object(sm); //does NOT give correct value to sm members

// sm.a=packer.unpack_field_int($bits(sm.a)); //this gives correct value

endfunction

endclass

class SMALL extends uvm_sequence_item;

bit[3:0] a;

function void do_unpack(uvm_packer);

super.do_unpack(packer);

this.a=packer.unpack_field_int($bits(a));

endfunction

endclass

Link to comment
Share on other sites

  • 3 weeks later...

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