Customizing UVMLint for IEEE 1800.2 Base Class Library

Universal Verification Methodology (UVM) stands as the pinnacle of design verification methodologies in the ASIC and FPGA domain. The integration of linting and static code analysis has emerged as a vital practice, particularly in projects with broad user bases, extended lifetimes, and distributed development teams. Recently, during the UVM IEEE 1800.2-2023 release cycle (at DVCon US 2024), the potential for a custom UVMLint solution to enhance the UVM Base Class Library (BCL) development process was recognized. Some of the lead developers of UVM BCL suggested to create a simple rule deck that focuses on specific issues seen by the core development team over last few years than a general-purpose linter that may end up throwing 1000s of violations. 

At AsFigo, we've taken the initiative to develop custom linting rules tailored specifically for the UVM BCL. Our goal is to offer our community an open-source lint package that can be used by the UVM IEEE committee and the wider developer community via GitHub. Our aim is to establish these rules as gatekeepers through GitHub actions, ensuring that all future additions to the UVM BCL are free from common pitfalls.

Why custom lint?

Unlike typical UVMLint rules tailored for Verification IP (VIP) users, which focus on different requirements, our  custom UVMLint checker is specifically designed for the UVM BCL codebase. For instance, while a typical VIP rule might ensure agent reusability, such a rule is impractical for the UVM BCL, which serves as the foundation for a vast number of engineers globally.  

Sample UVMLint Rules:

- Avoid race conditions around "static const" (use localparam instead)

- Avoid one-liner conditional statements and code in loops

- Use endlabels for elements such as endclass, endfunction, endtask, etc.

- Flag non-virtual methods

Below snapshots highlight potential coding enhancement opportunities




Summary:

Above snapshots summarize the custom UVMLint result for BCL. The development of a custom UVMLint solution represents a significant step forward in enhancing the UVM BCL development process. By leveraging Python code and rigorous testing methodologies, we've tailored linting rules to suit the unique requirements of the UVM BCL codebase. As we present our UVMLint findings on the latest IEEE 1800.2-2023 codebase, we anticipate that these efforts will contribute to the ongoing refinement and improvement of UVM verification practices worldwide.

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!

This single character can provide shift-left in your coverage closure cycle - SystemVerilog dist, PySlint