+1 855-VERIFYY
+

DVi Code Guidelines of System Verilog Universal Verification Methodology Checks

SV/UVM coding guidelines Automatically checked by DVinsight

  • Rule : Class should define its constructor.
    • If a class is inherited from another class then it should have a constructor.
  • Rule : Constructor of base class should be called.
    • Call constructor of base class from the constructor the derived class.
  • Rule : UVM phases should be named correctly.
    • Spelling mistakes in the names will not be caught by the compiler!
  • Rule : reset_phase, configure_phase, main_phase, shutdown_phase, run_phase and their hook methods should be “task” and rest phases should be “function”.
    • reset_phase, configure_phase, main_phase, shutdown_phase, run_phase and their hook methods can be time consuming so should be task while rest of the phases should not consume simulation time, so should be function.
  • Rule : Only one class should be defined in a file. And file name should be “ClassName.svh”.
    • To maintain file structure in project it is good to define one class in a file and the class name should be “ClassName.svh”.
  • Rule : All classes in UVM tree should be registered with UVM Factory.
    • All classes in UVM tree should be registered with UVM Factory as it enables you to create object and override that class using factory.
  • Rule : Name passed into factory registration should be same as name of class.
    • All classes should be registered in factory using their own name.
  • Rule : Classes should be registered using correct factory registration macro.
    • Correct factory registration macro should be used for class registration like class inherited from uvm_component should be registered using “`uvm_component_utils” but “`uvm_component_param_utils” if its a parametrized class.
  • Rule : In parametrized class, all parameters in class declaration should be passed in factory registration.
    • Parameterized class should pass all its parameters along with class name in factory registration macro.
  • Rule : All parameters passed in factory registration should be same as in class declaration.
    • Name of parameters passed in factory registration macro should be same as in class declaration.
  • Rule : String name passed into the create() call, should be same as object’s handle name.
    • To maintain unique name in a scope, String name passed into the create() call, should be same as object’s handle name.
  • Rule : A class must be registered with factory in order to create its objects using factory.
    • An object of class can be created using factory only if class is registered with factory.
  • Rule : Class scope used in object creation should be same as class name of handle.
    • Correct class scope should be used while creating object of class using factory.
  • Rule : Create statement should be called from build_phase function only.
    • All the object should be created in build_phase only.
  • Rule : All the objects in same scope should have an unique name.
    • While object creation using factory, either the first argument should be string same as name of handle or if handle is an array it should be formatted string or a variable which changes with array iteration.
  • Rule : All classes/functions/tasks/modules should be ended with a proper ending.
    • All classes/functions/tasks/modules should have a proper ending.
  • Rule : All phases should be call super.<name_of_phase>().
    • All phases should be call super.<name_of_phase>() in order to ensure that all phases has been called.
  • Rule : Connection of ports and exports should be correct.
    • In same same level while connecting ports and exports connect method should be called on port and export should be passed in connect. In different hierarchy level while connecting port with port connect method should be called on child port and parent port should be passed in connect and while connecting export with export connect method should be called on parent export and child export should be passed in connect.
  • Rule : Connect statement should be called from connect_phase function only.
    • All port connection should done in connect_phase only.
  • Rule : A method should be present in base class in order to use super.<method_name>().
    • Its a common mistake to call a method without having it in base class. Hence a method should be present in base class in order to use super.<method_name>().
  • Rule : A Class should be extended from any other class in order to use usage “super”.
    • Its illegal to use super construct if class is not extending from any class.

System Verilog Universal Verification Methodology guide

DISCLAIMER : This is the current list of checks in DVinsight.  For a complete and comprehensive list refer to Verification Academy and Doulos.

 

Download DVinsight a SV UVM IDE

 

How to Streamline the UVM implementation process

 

Schedule a System Verilog Universal Verification Methodology Training Class

 

Hardware Verification Services