Verissimo SystemVerilog Testbench Linter User Guide
Rev. 18.1.29, 13 September 2018

7.2 Ruleset File Examples

Example 1 - Ruleset with two categories:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ruleset version="2">
   <category
       name="Architecture"
       description="Rules that inspect the environment architecture" >
     <rule
         id="ARIN"
         name="ARAI"
         title="Agent Instantiation"
         description="Verify that all agents are properly instantiated ..."
      />
    </category>
    <category
        name="Sequences" >
      <rule
          id="SQSD"
          severity="INFO"
          name="SQSD"
          title="Sub-sequencers in Virtual Sequencers"
          description="Verify that all virtual sequencers have sub-sequencers ..."
      />
      <rule
          id="MSUA"
          severity="WARNING"
          name="MSUA"
          title="Use Print() for Printing"
          description="It is recommended to use the field macro automation..."
      />
    </category>
    <category name="XVM Build Phase">
       <rule id="SVTB.7.14.0" name="Build Calls Super" title="Always call super.build_phase()" description="An overridden uvm_component.build_phase() must call super.build_phase().">
         <property key="baseClass" value="uvm_pkg::uvm_component" />
         <property key="methodName" value="build_phase" />
       </rule>
    </category>
</ruleset>

Example 2 - Ruleset with XVM rules configured as UVM and all failures reported as warnings:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset library="uvm" version="2">
  <configuration>
    <architecture>
      <component
          type="AGENT"
          base-class="uvm_agent"
      />
      <component
          type="CONFIGURATION_OBJECT"
          name-pattern=".*_cfg"
      />
      <component
          type="DRIVER"
          base-class="uvm_driver"
          name-pattern=".*driver"
      />
      <component
          type="ENVIRONMENT"
          base-class="no_class_at_all"
          name-pattern="environment"
      />
      <component
          type="MONITOR"
          base-class="ubus_slave_monitor"
          name-pattern=".*monitor"
        />
      <component
          type="SCOREBOARD"
          base-class="uvm_scoreboard"
        />
    </architecture>
    <skip-file name-pattern=".*_seq.svh"/>
    <skip-element name-pattern=".*_word_seq|.*_byte_seq"/>
    <failed severity="WARNING"/>
  </configuration>
  <category name="Names">
      <rule
          id="XVM.2.2.1"
          title="Driver Class Name"
      />
      <rule
          id="XVM.2.3.1"
          title="Monitor Class Name"
      />
      <rule
          id="XVM.2.4.1"
          title="Sequencer Class Name"
      />
      <rule
          id="XVM.2.6.1"
          title="Agent Class Name"
      />
      <rule
          id="XVM.2.7.1"
          title="Environment Class Name"
      />
      <rule
          id="XVM.2.8.2"
          title="Test Class Name"
      />
  </category >
</ruleset>

Example 3 - Ruleset with author name annotated on failures using git blame and including the source code in HTML format

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ruleset version="2">
  <configuration>
    <annotation name="Author" show-in="filters, details, table" type="git" git-field="author" />
    <include-html-code />
  </configuration>
  <category
      name="Architecture"
      description="Rules that inspect the environment architecture" >
    <rule
        id="ARIN"
        name="ARAI"
        title="Agent Instantiation"
        description="Verify that all agents are properly instantiated ..."
     />
  </category>
</ruleset>

Example 4 - Ruleset with description-append and value-append parameters

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ruleset version="2">
   <category name="Checks for class members comment">
     <rule
         id="SVTB.25.6.6.0"
         name="Class members comment"
      />
      <rule
         id="SVTB.25.6.6.0"
         name="Class members comment"
         description-append="Use this for validating type parameters comment aswell."
             <property
                 key="memberKinds"
                 value-append="type_parameter"
             />
      />
    </category>
</ruleset>

Example 5 - Ruleset with effort levels

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ruleset version="2">
  <configuration>
    <effort-levels>
      <effort level="default" time="10s" />
      <effort level="low" time="1m 30s" />
      <effort level="high" time="1h 10m 10s" />
    </effort-levels>
  </configuration>
  <category name="XVM Factory Override">
    <rule
      id="XVM.2.8.5"
      title="Set type overrides only in the build phase method"
      effort-level="low"
    />
    <rule
       id="XVM.5.2.1.1"
       title="Factory override methods must use compatible override types"
       effort-level="high"
    />
    <rule
       id="XVM.5.2.1.2"
       title="Factory overrides must be called before any create call"
    />
  </category>
</ruleset>