Collection of arithmetic units written in SystemVerilog.
Tested in Ubuntu 24.04.
-
Set up the python environment:
-
Install Miniconda.
-
Create the environment (only the first time):
conda env create -f environment.yml
-
Activate the environment (every time you open a new terminal):
conda activate arithmetic_units
-
-
Install the Icarus Verilog simulator. We currently use version 12.0. In Ubuntu 24.04, you can do this with:
sudo apt install iverilog
-
Install Verible for SystemVerilog linting and formatting. We currently use version
v0.0-4023-gc1271a00. In Ubuntu, you can do this with:export VERIBLE_VERSION=v0.0-4023-gc1271a00 wget https:wget https://github.com/chipsalliance/verible/releases/download/${VERIBLE_VERSION}/verible-${VERIBLE_VERSION}-linux-static-x86_64.tar.gz tar -xf verible-${VERIBLE_VERSION}-linux-static-x86_64.tar.gz
Then you can install it to your preferred location. For example, to install it in
/home/$USER/tools, run:mkdir -p /home/$USER/tools/verible/${VERIBLE_VERSION}/ mv verible-${VERIBLE_VERSION}/* /home/$USER/tools/verible/${VERIBLE_VERSION}/
You can remove the previous download from the current path with:
rm -rf verible-${VERIBLE_VERSION}*
Finally, add the
/home/$USER/tools/verible/${VERIBLE_VERSION}/binto yourPATHenvironment variable.
The test setup is based on cocotb and pytest. You can find all the tests in the test folder.
To run the tests, run:
make testIf you want the detailed output, run:
pytest -rA -vTo format your code run:
make formatTo run the Verible linter for SystemVerilog run:
make verible-lint[1] M. D. Ercegovac and T. Lang, Digital Arithmetic. 2003. doi: 10.1016/B978-1-55860-798-9.X5000-3. [2] J.-M. Muller et al., Handbook of Floating-Point Arithmetic. Cham: Springer International Publishing, 2018. doi: 10.1007/978-3-319-76526-6.
This project is licensed under the CERN Open Hardware Licence Version 2 - Weakly Reciprocal
or later, unless specified otherwise. The license is also included in this repository in
the LICENSES directory. SPDX-License-Identifier: CERN-OHL-W-2.0+
The software (i.e. all code inside the test directory) is licensed under the
GNU Lesser General Public License v3.0
or later, unless specified otherwise. The license is also included in this repository in
the LICENSES directory. SPDX-License-Identifier: LGPL-3.0-or-later
This project uses the REUSE tool to manage licenses. For more information, please refer to https://reuse.software/. To check the compliance of this repository with the REUSE guidelines, run:
reuse lint