Jump to content

UVm Macro usage

Recommended Posts


As I know Uvm macro are specially used for two purposes

(1) Automatically provide a create method

(2) Also get_type_name

and also different methods like pint,clone,pack and un_pack ... etc

Now , there are three types of blocks `uvm_field_utils_begin & end

`uvm_component_utils_begin & end

`uvm_object_utils_begin & end

I want to know where , which macro can be used.

Link to comment
Share on other sites

`uvm_component_utils_begin/end is used in uvm_component subclasses (including indirect ones). You'll place field macros inside which refer to declaration class variable (thus is goes after variable declarations).

`uvm_object_utils_begin/end is used in non-component uvm_object subclasses including sequences. They will also go after the variable declarations for the class.

If you don't have any field macros, the `uvm_component_utils or `uvm_object_utils macros could be used instead of begin/end pair.

`uvm_field_utils should not be used directly by user code.

Link to comment
Share on other sites

Dear Jadec,

Thank you very much for your valuable reply.

Can you please elaborate.I.e. which class will be extended from Uvm component and which classes will be extended from the uvm object.

I am not getting your point (including indirect ones)

Also let me give one scenario like i have made one class A which extended from uvm_component and another class B i have extended from class A.Now i want to use uvm_component_utils_begin/end for class B variables. I am getting error in such scenario,please if you can provide me any help regarding that.

once again thank you for reply.

Link to comment
Share on other sites

Hi Sankey,

uvm_object class should be used to code normal transfer objects which are dynamic in nature.

uvm_compponent class would be used to create your UVC hierarchy. All your quasi static objects like monitor / driver / sequencer / environment / test class etc should be extended from uvm_component class. That way you can use config mechanism to set/get component's filed values.

Please refer to UBUS example inside UVM library to get a working example.


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.

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