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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file avl_spi-0.1.0.tar.gz.
File metadata
- Download URL: avl_spi-0.1.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
313e963be0fc6f58f4bd56186bb8a18981d4251312878d93de8395808d906b04
|
|
| MD5 |
ff41d450282c90ac9e4c4496d08209b8
|
|
| BLAKE2b-256 |
ab5c90bcb3c2258c26575d9523bffdad0f6e1eb74f6acc6245ab638c2bbf8411
|
File details
Details for the file avl_spi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: avl_spi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbdde4729e2d873b4d8b7747c452229d573e29673c6e1e0ded816abb28595e40
|
|
| MD5 |
9395497a030f70136290970ecd8a8217
|
|
| BLAKE2b-256 |
745de883174c826c3f39de10c0ac1702630702872e05867b20d89cffbebe1a46
|