Verissimo SystemVerilog Linter - How to Define your Own Ruleset

Description

This video shows how to create your own ruleset from hundreds of rules available in Verissimo.

Explore the design and verification tools: https://www.dvteclipse.com
Or request a license: https://www.dvteclipse.com/request-license

Transcript

Introduction

Verissimo SystemVerilog Linter has hundreds of rules to choose from, and new ones are added almost every week. Most of them have parameters that can be adjusted to better suit your needs. As of November 2021, Verissimo has over 700 rules that you can pick from. However, you never run all the Verissimo rules; instead, you run a subset that matches your coding guidelines, using the ruleset argument. It is recommended to start with a small set of rules, as this allows you to quickly focus on the most relevant issues.

Creating Your Own Custom Ruleset

In order to create your own custom ruleset, we recommend starting from the predefined Basic Ruleset. This Basic Ruleset illustrates the areas that Verissimo covers, from performance to dead code, from styling to language pitfalls. The Basic Ruleset XML can be generated using the -gen_ruleset_xml command.

First, you should copy the generated ruleset to give it a meaningful name. If you open the ruleset.xml file, you can see how rules are grouped by categories, how to instantiate specific rules, and how to specify parameters. You can remove rules that are not relevant or simply use copy-paste to instantiate new ones. You can also instantiate a rule multiple times, using different parameters. When doing so, you must specify distinct rule names. If not specified, the name of a rule is the same as the ID. This is why, to distinguish between the instances of the same rule, you must specify a distinct name for each rule instance. Now let's give it a try.

Finding Relevant Verissimo Rules

There are two ways to find relevant Verissimo rules.

Option 1: Browsing Through the Rules Documentation

The first option is to browse through the rules documentation. To get the documentation, use the -gen_rulepool_doc command. To search for a rule, you can browse through the chapters on the left side or use the top filter bar. You can narrow the search based on description or title. Once you locate the relevant rule, you get back to the XML and instantiate it, typically by duplicating an existing rule and changing the attributes as needed.

Option 2: Using the Ruleset Containing All Rules

An alternative way is to use the ruleset containing all rules and search for relevant ones. Use the -gen_rulepool_xml command. As you can see, the rule pool XML includes the documentation as comments for each rule, as well as all available parameters. Search for a rule, copy its definition, and paste it into your own ruleset.

Tuning Rule Attributes

For any rule, you can tune the title, description, severity, and other attributes. You can find more details about the rule attributes in the Verissimo user guide.

Running and Enhancing Your Custom Ruleset

Now you can run your custom ruleset and repeat the process anytime you want to create a new ruleset or enhance the existing one. Speaking of enhancing the ruleset, you can list the rules that were added to Verissimo after a specified date using the -since argument when generating the documentation or the XML of available rules.

Getting Assistance

Last but not least, we can also help you define your custom rulesets, just drop us an email and we'll be happy to assist you.