Skip to main content

AVL-JTAG - Apheleia Verification Library JTAG Verification Component

License: MIT Python

AVL-JTAG provides a simple, extensible verification component for IEEE 1149.1 JTAG
developed in Python and the AVL library.

Unlike a conventional bus VIP, the driver does not implement the protocol itself. Instead it uses
OpenOCD with the remote_bitbang adapter:

 Sequence ──(OpenOCD Tcl command)──► Driver ──Tcl RPC──► OpenOCD
                                       ▲                    │
                                       └── remote_bitbang ◄─┘
                                       │
                            TCK/TMS/TDI/TRST ► DUT ► TDO
  • Sequences issue any OpenOCD Tcl command (irscan, drscan, runtest, pathmove, jtag_reset, scan_chain, user procs, targets...)
  • The driver is the remote_bitbang server - each bitbang request becomes pin activity on the interface
  • Simulation time only advances on bitbang requests, so runs are deterministic regardless of host load
  • The monitor is independent of OpenOCD and reconstructs IR / DR scans from the pins

AVL is built on the CocoTB framework, but aims to combine the best elements of
UVM in a more engineer friendly and efficient way.

Protocol Features

Signal Name Description Driven By
TCK Test clock. OpenOCD
TMS Test mode select - sampled on the rising edge of TCK to move the TAP state machine. OpenOCD
TDI Test data in - sampled on the rising edge of TCK in Shift-IR / Shift-DR. OpenOCD
TDO Test data out - changes on the falling edge of TCK. DUT
TRSTn Optional asynchronous active-low TAP reset. OpenOCD
SRSTn Optional active-low system reset. OpenOCD

Component Features

  • OpenOCD driven sequence / sequencer / driver
  • Convenience sequence API: command, irscan, drscan, runtest, pathmove
  • Simple RTL interface to interact with HDL and define configuration options
  • TAP state machine monitor generating IR, DR and reset items
  • Bandwidth monitor generating bit activity plots over user defined windows during simulation
  • Functional coverage
  • Searchable trace file generation

📦 Installation

OpenOCD must be installed and built with the remote_bitbang adapter (openocd -c "adapter list").
Set OPENOCD to use a specific executable.

Using pip

# Standard build
pip install avl-jtag

# Development build
pip install avl-jtag[dev]

Install from Source

git clone https://github.com/projectapheleia/avl-jtag.git
cd avl-jtag

# 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, OpenOCD and appropriate simulator installed, so all examples and documentation will build out of the box.

git clone https://github.com/projectapheleia/avl-jtag.git
cd avl-jtag
source avl-jtag.sh

🚀 Usage

class MySequence(avl_jtag.Sequence):
    async def body(self):
        await self.irscan(0x1)
        idcode = await self.drscan(32, 0)
        item = await self.command("scan_chain")
        self.info(item.response)

avl.Factory.set_variable("*.hdl", dut.jtag_if)
avl.Factory.set_variable("*.agent.cfg.has_driver", True)
avl.Factory.set_variable("*.agent.cfg.has_monitor", True)
avl.Factory.set_variable("*.agent.drv.openocd_cfg", ["jtag newtap avl tap -irlen 4", "reset_config trst_only"])
avl.Factory.set_override_by_type(avl_jtag.Sequence, MySequence)

📖 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 waveforms generated (dump.vcd) - use make sim WAVES=0 to disable. This can be modified using the standard CocoTB build system.

Rendered waveforms for each example are included in the documentation (regenerate with python3 doc/gen_waveforms.py after running the examples).


🧹 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

Metadata

Release files for avl-jtag 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for avl-jtag 0.1.0
File Size Uploaded Provenance Actions
avl_jtag-0.1.0.tar.gz 18.3 kB Without provenance Details for avl_jtag-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for avl-jtag 0.1.0
File Interpreter ABI Platform Actions
avl_jtag-0.1.0-py3-none-any.whl Python 3 none any Details for avl_jtag-0.1.0-py3-none-any.whl

Total release size: 40.9 kB

Release files / avl_jtag-0.1.0.tar.gz

Download URL avl_jtag-0.1.0.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
41eaf6e1f3f6027661f8884c793d56739eb74e9d1ec73f30addb9b08bc4ab39a
BLAKE2b-256 checksum
How to use checksums
e69c9b3415c5dd31744f266afe9d66404d9dbf0d275b6735df449954a590bb9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / avl_jtag-0.1.0-py3-none-any.whl

Download URL avl_jtag-0.1.0-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48dc30dea18694ad17f0ddf49c0e332ac4097f57b9d0706b59a2b4d98246a597
BLAKE2b-256 checksum
How to use checksums
5f3ca51dcc0160a7229c2b14271fcd949e6c1f7d4d1896d0d24f7b952f17e574
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for avl-jtag 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page