Skip to main content

SVA Linter

Project description

SVALint

Linter for SystemVerilog Assertions (SVA). Following the philosophy of BYOL - Build Your Own Linter, SVALint is an example of how users can roll out their own linters!

SVALint is an open-source minimalist linter tool designed to enforce style and consistency rules for SystemVerilog code. It provides a framework for Build Your Own Linter (BYOL), allowing users to create their own custom lint rules while benefiting from built-in checks such as proper encapsulation, naming conventions, line spacing, and other cosmetic rules. This linter integrates seamlessly into your development pipeline to ensure consistent, high-quality code.

Table of Contents

  1. SVALint: SystemVerilog Checker - Linter
  2. BYOL - Build Your Own Linter
  3. Open Source
  4. Directory Structure
  5. Installation
  6. Usage   - Running the Linter from Command Line   - Running with Makefile (Optional)   - Test Cases
  7. Adding New Lint Rules
  8. Example Rule (in src/rules/)
  9. Dependencies
  10. License
  11. Credits

BYOL - Build Your Own Linter

The core concept of SVALint is BYOL (Build Your Own Linter), a framework that lets you easily define custom linting rules tailored to your specific needs. Whether it's enforcing naming conventions, checking for proper encapsulation, or any other rule, SVALint is flexible and extensible. With BYOL, you can create new rules quickly and add them to your pipeline. The linter is fully customizable, empowering you to ensure that your SystemVerilog code adheres to your specific standards.

Open Source

This project is open source and licensed under the MIT License. Contributions are welcome, and you are free to fork, modify, and distribute it according to your needs. We encourage you to contribute to the community by adding new rules, improving the existing ones, or integrating SVALint with other tools and environments.

Directory Structure

TBD

Installation

  1. Clone the repository:
git clone https://github.com/AsFigo/svalint.git
cd svalint
  1. Install required dependencies - Verible mainly

See: https://github.com/chipsalliance/verible

  1. pip install anytree
  2. pip install tomli

Usage

Running the Linter from Command Line

The linter can be run using the svalint.py script located in the bin/ directory. This script checks SystemVerilog files against the defined style rules.

  1. To run the linter on a specific file:
python bin/svalint.py -t <path_to_file.sv>

Adding New Lint Rules

  1. Create a new Python file inside the src/rules/ directory. Each file should contain a class that inherits from the base linter class (AsFigoLinter).
  2. Implement the rule logic in the derived class. Each rule should implement a method like apply or run to check for the specific violation.
  3. After implementing the rule, add the rule to the configuration to enable or disable it.

Example Rule (in src/rules/)

Dependencies

  • Python 3.x- Any necessary libraries like verible_verilog_syntax

License

This project is open source and licensed under the MIT License. See the LICENSE file for details.

This SVALint linter is part of the BYOL (Build Your Own Linter) framework from AsFigo Technologies. It's an open-source tool, and we encourage you to contribute to its growth, whether through adding new lint rules, improving existing ones, or enhancing documentation. Let us know how you're using SVALint, and feel free to contribute back to the community!

Credits

The rules and guidelines in SVALint are based on the following sources:

  • SystemVerilog Assertions Handbook* Ben Cohen, Ajeetha Kumari Venkatesan, Lisa Piper, Srinivasan Venkataramanan: Many of the rules in this linter are inspired by the coding practices and design patterns outlined in this book, which provides a comprehensive approach to SystemVerilog Assertions, focusing on best practices for code quality and maintainability.
  • lowRISC Coding Guidelines: This linter also draws upon the coding standards and guidelines from the lowRISC project. Their best practices for SystemVerilog coding have been a key resource for defining rules related to naming conventions, encapsulation, and other critical aspects of design quality.
  • Verible: is an opensource SystemVerilog parser from Google and available via ChipsAlliance

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

afsvalint-2.2.4.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

afsvalint-2.2.4-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file afsvalint-2.2.4.tar.gz.

File metadata

  • Download URL: afsvalint-2.2.4.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for afsvalint-2.2.4.tar.gz
Algorithm Hash digest
SHA256 084e4dfdcc3b46d356e58217bef5fe53aa7b054740e7883c6536e82aacc57459
MD5 286b3e554b5fe5a9d7e6c72a094a119d
BLAKE2b-256 b52fe41ec80d4210dca57a14f0037a8eb269dd8532cd90d18ff33f27c84a639e

See more details on using hashes here.

File details

Details for the file afsvalint-2.2.4-py3-none-any.whl.

File metadata

  • Download URL: afsvalint-2.2.4-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for afsvalint-2.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f575951484c8749f3c32b0876d8af726f012295a5846008752567d8db1365731
MD5 62e1c9f06e0316a6f46d9bcf27ce8305
BLAKE2b-256 30b7295fbbcb4c317bf4bbc3efaeeed26170e01230b7af8799c4ef33e0f4ac52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page