Building an Open Source Lint Tool for UVM IEEE 1800.2 Core BCL

We are excited to share our journey of developing an open-source lint tool for the Universal Verification Methodology (UVM) IEEE 1800.2 Core Base Class Library (BCL) At AsFigo, our aim is to enhance the UVM ecosystem by providing a robust, community-driven solution that ensures code quality and compliance with industry best practices. Our team will be presenting results from this activity at the upcoming ORConf 2024 in Gothenburg, Sweden this September! 

Understanding the Need

UVM IEEE 1800.2 is a standard that provides a comprehensive verification framework for SystemVerilog, facilitating the creation of reusable and scalable testbenches. However, ensuring that UVM code adheres to best practices and standards can be challenging. This is where a lint tool becomes handy, offering automated code analysis to detect potential issues early in the development cycle. Given the vast language that SystemVerilog is, a single lint tool does not truly fit all needs.


In the context of SystemVerilog linting, there are several potential use cases:

  • SystemVerilog DPI Lint
  • SVALint - for assertions
  • FVLint - for SVA with Formal Verification
  • SVTBLint - for non-UVM class based testbenches
  • TBLint - for testbenches without any classes (yes, they do exist even in 2024!)
  • UVMLint for VIP users
  • UVMLint for subsystem, SoC users
  • RTL Lint
  • CDCLint
  • Emulation focused lint (EMULint) etc. 
However, what the IEEE 1800.2 BCL core development team required is slightly different - adhere to best coding styles, but not check for VIP specific rules etc. There are very focused queries such as:
  1. Does the BCL have single-line conditional statements in use?
  2. Does the BCL have potential race condition prone code?
  3. Are there looping constructs without use of begin..end? etc.
So, after few brainstorming at events such as VF 2023 (UK, US) DVCon US 2023, DVCon EU 2023, ORConf 2023, LatchUp 2023 etc. our team understood the void that exists in the ecosystem to check for a focused rule deck customized for UVM BCL. 

Key Features of PySlint platform

Rule-Based Analysis

It is built on a rule-based system, allowing users to enable or disable specific checks based on their project requirements. This flexibility ensures that the lint tool can adapt to various verification environments.



User-Friendly Reporting

The tool generates detailed reports highlighting issues along with their locations in the code, making it easier for developers to identify and fix problems. The reports can be customized to include severity levels, enabling prioritization of critical issues.



Integration and Extensibility

Designed to seamlessly integrate with existing verification environments, PySlint supports integration with popular CI/CD pipelines and version control systems. Additionally, it is extensible, allowing users to add custom rules specific to their projects.

Community-Driven Development

As an open-source project, our tool thrives on community contributions. We encourage users to contribute by adding new rules, reporting issues, and suggesting enhancements. This collaborative approach ensures continuous improvement and adaptation to evolving industry needs.

Technical Challenges and Solutions

Developing a lint tool for UVM posed several technical challenges. Parsing complex SystemVerilog code, ensuring accurate rule application, and maintaining performance efficiency were some of the critical hurdles. We tackled these challenges by leveraging modern parsing techniques such as Slang/Pyslang. We also prototyped it on Verible parser (from Google). Our tool's architecture is modular, facilitating easy maintenance and scalability.

Future Directions

Looking ahead, we aim to expand the rule set to cover more advanced UVM features and incorporate machine learning techniques to provide intelligent code suggestions. We also plan to enhance the user interface for better usability and integrate with more development tools.

Join us at ORConf 2024 to learn more about our journey, the technical intricacies of building this tool, and how you can contribute to this open-source initiative. Let's work together to elevate the standards of UVM code quality and reliability.

To be presented by AsFigo at ORConf 2024, Gothenburg, Sweden.


Come and join us at the land of ODIN!




All image credits - Bing AI image generator! 
Content credentials  - Generated with AI


Comments

Popular posts from this blog

Don't go "wild" with Associative arrays in SystemVerilog - PySlint it!

Porting a complete UVC to Verilator + UVM - an anecdote!

Opensource testbench generator for VHDL designs, OSVVM included!