AVL-SPI - Apheleia Verification Library SPI Verification Component
AVL-SPI has been developed by experienced, industry professional verification engineers to provide a simple,
extensible verification component for the Serial Peripheral Interface
developed in Python and the AVL library.
AVL is built on the CocoTB framework, but aims to combine the best elements of
UVM in a more engineer friendly and efficient way.
CocoTB 2.0
AVL-SPI supports CocoTB 2.0 and requires CocoTB 2.1 or later.
Protocol Features
| Signal Name | Description | Driven By |
|---|---|---|
| SCLK | Serial clock. Idles at CPOL. | Master |
| CS | Chip select; one per slave. Polarity configurable per slave. | Master |
| MOSI | Master out, slave in serial data. | Master |
| MISO | Master in, slave out serial data. | Slave |
Note: At present only single bit, uni-directional SPI is supported. Each SCLK cycle transfers one bit on MOSI (master to slave) and one bit on MISO (slave to master). Bi-directional (3-wire), dual, quad and QPI modes are not supported.
Component Features
- Simple RTL interface to interact with HDL and define parameter and configuration options
- Multiple chip selects with individual polarity
- Clock polarity and individual drive and sample edges for master and slave (all 4 SPI modes and beyond)
- Variable transfer length, MSB or LSB first
- Chip select onehot0, setup, hold and inter-frame gap checks in the RTL interface
- Master sequence, sequencer and driver with rate limiter, SCLK frequency and chip select timing control
- Slave sequence, sequencer and driver with vanilla, random and memory response patterns
- Monitor
- Bandwidth monitor generating bus activity plots over user defined windows during simulation
- Functional coverage
- Searchable trace file generation
📦 Installation
Using pip
# Standard build
pip install avl-spi
# Development build
pip install avl-spi[dev]
Install from Source
git clone https://github.com/projectapheleia/avl-spi.git
cd avl-spi
# Standard build
pip install .
# Development build
pip install .[dev]
Alternatively if you want to create a virtual environment rather than install globally a script is provided. This will install, with edit privileges to local virtual environment.
This script assumes you have Graphviz and appropriate simulator installed, so all examples and documentation will build out of the box.
git clone https://github.com/projectapheleia/avl-spi.git
cd avl-spi
source avl-spi.sh
📖 Documentation
In order to build the documentation you must have installed the development build.
Build from Source
cd doc
make html
<browser> build/html/index.html
🏃 Examples
In order to run all the examples you must have installed the development build.
To run all examples:
cd examples
# To run
make -j 8 sim
# To clean
make -j 8 clean
To run an individual example:
cd examples/THE EXAMPLE YOU WANT
# To run
make sim
# To clean
make clean
The examples use the CocoTB Makefile and default to Verilator with all waveforms generated. This can be modified using the standard CocoTB build system.
🧹 Code Style & Linting
This project uses Ruff for linting and formatting.
Check code for issues:
ruff check .
Automatically fix common issues:
ruff check . --fix
📧 Contact
- Email: avl@projectapheleia.net
- GitHub: projectapheleia
Metadata
Release files for avl-spi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| avl_spi-0.1.0.tar.gz | 18.0 kB | Without provenance | Details for avl_spi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| avl_spi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for avl_spi-0.1.0-py3-none-any.whl |
Total release size: 43.1 kB
Release files / avl_spi-0.1.0.tar.gz
| Download URL | avl_spi-0.1.0.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
313e963be0fc6f58f4bd56186bb8a18981d4251312878d93de8395808d906b04
|
|
BLAKE2b-256 checksum How to use checksums |
ab5c90bcb3c2258c26575d9523bffdad0f6e1eb74f6acc6245ab638c2bbf8411
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / avl_spi-0.1.0-py3-none-any.whl
| Download URL | avl_spi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 25.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fbdde4729e2d873b4d8b7747c452229d573e29673c6e1e0ded816abb28595e40
|
|
BLAKE2b-256 checksum How to use checksums |
745de883174c826c3f39de10c0ac1702630702872e05867b20d89cffbebe1a46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for avl-spi 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.