Skip to content

UVM Sequence Item

Summary

The UVM Sequence Item is the base class for user-defined transactions that leverage the stimulus generation and control capabilities of the sequence-sequencer mechanism.

Coding Guidelines

This coding guidelines are directly taken form Easier UVM Coding Guidelines. We encourage users to follow these recommendations so that the code becomes more readable and easier to maintain. By doing so, you will also benefit from better performance and simpler integration.

Tips

  • Use conditional compilation guards to avoid compiling the same include file more than once.
  • Create user-defined transaction classes by extending the class uvm_sequence_item.
  • Try to minimize the number of distinct transaction classes
  • Register the transaction class with the factory using the macro `uvm_object_utils as the first line within the class.
  • Do not use field macros. (This comes at a heavy cost in terms of performance)
  • After the factory registration macro, declare any member variables (using the prefix m_ as a naming convention).
  • Use the rand qualifier in front of any class member variables that might need to be randomized, now or in the future.
  • After any member variables, define a constructor that includes a single string name argument with a default value of the empty string, a call to super.new(), and is otherwise empty.
    function new (string name = "");
      super.new(name);
    endfunction : new
    
  • After the constructor, always override the convert2string, do_copy, do_compare, do_print, and do_record methods.
  • Always instantiate transaction objects using the factory.
    var_name = transaction_type::type_id::create("var_name");
    
  • In general, the string name of the transaction should be the same as the variable name.

Code Example

gpio_uvc_sequence_item.sv
// TODO: add code later

Reference Material

Accellera

Verification Methodology Cookbooks

Source Code

Articles