This repository uses Verible as a linter and formatter to maintain code quality.
To contribute, you will need to install Verible. The recommended approach is to install the pre-built binary:
-
Navigate to the directory where you want to install Verible:
cd "$DIR_YOU_WANT_INSTALL_VERIBLE"
-
Download the pre-built binary:
wget https://github.com/chipsalliance/verible/releases/download/v0.0-3824-g14eed6a0/verible-v0.0-3824-g14eed6a0-linux-static-x86_64.tar.gz
-
Extract the downloaded file:
tar -zxvf verible-v0.0-3824-g14eed6a0-linux-static-x86_64.tar.gz
-
Add Verible to your
PATH
by updating your~/.bashrc
file:export PATH=$DIR_YOU_WANT_INSTALL_VERIBLE/verible-v0.0-3824-g14eed6a0/bin:$PATH
This project also uses pre-commit
to enforce code standards. Follow these steps to set it up:
-
Install
pre-commit
using pip:pip install pre-commit
-
Clone the repository and navigate to the project directory:
git clone https://github.com/fennecJ/formal_RV12 cd formal_RV12
-
Install the pre-commit hooks:
pre-commit install
Before committing your changes, ensure your code is properly formatted and free of linting issues by running the following commands:
-
To format the source code, run:
verible-verilog-format --flagfile=.verible-format-flags --inplace property/isa.sv
-
To check for linting issues, run:
verible-verilog-lint --rules_config=.verible.rules property/isa.sv # There should be no output if no linting issues are found.
Once these steps are complete and there are no issues, you're ready to contribute!
If you prefer to retain your custom code style in certain sections, you can instruct the formatter to ignore specific code blocks by using the following annotations:
// verilog_format: off
// Your custom code here...
// verilog_format: on