-1

I'm trying to understand about UVM automation macro. among other things, i found some sentence "UVM system Verilog call library also includes macros that automatically implement the print, copy, clone, compare, pack and unpack methods and more" from text.

and I found that lots of example used with the following usage. For example,

....
uvm_object_utils_begin(apb_transfer)
'uvm_field_int(addr, UVM_DEFAULT)
'uvm_field_int(data, UVM_DEFAULT)
...
uvm_object_utils_end

but I didn't get it. that usage of 'uvm_field_int() is just defining the variable not copy, clone, compare....

How do I understand what uvm automation macro to do? even I also curious about why those things are named as a automation? I can't find any something auto kind of thing.

greeting
  • 15
  • 1
  • 9

1 Answers1

0

As you say, the UVM field automation macros generate a number of class utility methods such as copy, print and clone that include the registered fields. That's it. I guess the name "automation" is used, because they automatically write code so you don't have to.

My company (Doulos) recommends you don't use these macros useless you know what you're doing. This is because they can be hard to debug, can generate more code than you need and have a strange side effect (values can be read from the configuration database automatically without your knowledge). Of course, the advantage of using them is that you get a whole bunch of code for free - the copy, compare,, print methods etc.

The HTML documentation supplied with a UVM download is very good. Search for `uvm_object_utils and follow your nose.

Matthew Taylor
  • 13,365
  • 3
  • 17
  • 44