Jump to content

Help for UVM pack in verification


Recommended Posts

Hi,

1. There are 2 types, [uvm_sequence_item]

In which there are some fields in it.

Eg:

TYPE 1: [7:0]src,[7:0]dest,xtype,[4:0]ytype ,[16:0]a , [16:0]b , [16:0]c , [16:0]d

TYPE 2: [7:0]src,[7:0]dest,xtype,[4:0]ytype ,[16:0]w, [16:0]x , [16:0]y , [16:0]z

I want to pack all the fields in TYPE 1 and TYPE 2 and send it byte by byte,

But when I do run with TYPE 1 I want to transmit only the TYPE 1 fields.

I am confused how to pack these 2 type with different fields in it , though some fields in TYPE 1 and TYPE 2 are same.

I used single uvm_sequence_item, were all the fields are written.

I used pack_bytes() for sending byte by byte,

But I am unable to take only the TYPE 1 fields.

I don’t want the fields of TYPE 2 when I am running with TYPE 1.

Is there any way to do this using UVM.

2. I have a doubt weather we can have more than one sequence_item., if so how to call that sequence_item alone in different classes. I mean monitor,Scoreboard,etc...

thanks,

Gopi

Link to comment
Share on other sites

  • 1 month later...

1. It you want to pack a specific set of fields, you'll probably want to set UVM_NOPACK on all fields in the automation macros and implement your own do_pack function which will look at the "type" and choose the appropriate fields and order.

2. You can have multiple subclasses that share a common base class that can be passed to drivers, monitors, scoreboards across TLM ports parameterized to that base class. In general, this means the code will have an if( $cast(subclass_var,base_var) ) to select the appropriate type to operate on or you will have to define virtual functions to have the objects perform those operations themselves. Unless the non-overlapping data is very large, that may not be worth it.

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