Skip to main content

Cocotb AHB bus driver

Lint Regression Tests codecov Downloads

Introduction

This repository contains AHB drivers (AHB and AHB Lite) and a monitor for cocotb.

Installation

Installation from pip (release version, stable):

$ pip install cocotbext-ahb

Installation for active development:

$ git clone https://github.com/aignacio/cocotbext-ahb

The repository contains a small script that starts a container fetched from Docker Hub, equipped with all the required development tools.

$ cd cocotbext-ahb/
$ ./ship.sh

Once the container is up and running, to run the tests through nox and pytest, run the following:

$ nox -l # See the available build options
$ nox -s run-3.xx # Replace xx by a python version you want to test

The command above will take some time to complete (depends on your machine cfg) because it will run all the tests and its variants, generating waveforms in each run_dir/* folder. If you want to run a specific test, to the following:

$ nox -s run-3.10 -- -k "test_ahb_monitor_slave" # Runs on python 3.10, the test_ahb_monitor_slave

For the list of test, please check the tests/ directory.

Documentation and usage examples

The AHB extension is composed by master and slaves, essentially, the following available classes are:

  • AHB Master - WIP for burst support, base class AHB Lite Master
  • AHB Lite Master - Perform AHB transactions in non-/pipeline mode
  • AHB Slave - WIP for burst support, base class AHB Lite Slave
  • AHB Lite Slave - Support any type of AHB transaction but burst with back-pressure option and configurable default value

All the different master/slaves and also the monitor requires an AHBBus object to be passed to their constructors. This AHBBus defines the pin interface with the dut, some IOs are mandatory but others are optional. In order to create an AHBBus object, here are the two ways.

With a prefix:

# In case your DUT has some prefix for the AHB I/F
# For instance if all AHB signals are following this convention:
# - slave_haddr
# - slave_hsel
# - ...
AHBBus.from_prefix(dut, "slave")

Without a prefix:

# In case your DUT has no prefix for the AHB I/F
# For instance if all AHB signals are following this convention:
# - haddr
# - hsel
# - ...
AHBBus.from_entity(dut)

For reference, down below is the class header of AHB Bus. More arguments cani also be passed as this extends from cocotb-bus base class.

class AHBBus(Bus):
    _signals = ["haddr", "hsize", "htrans", "hwdata",
                "hrdata", "hwrite", "hready", "hresp"]

    _optional_signals = ["hburst", "hmastlock", "hprot", "hnonsec",
                         "hexcl", "hmaster", "hexokay", "hsel", "hready_in"]

Mandatory vs optional AHB signals

  1. AHB Master signals

Mandatory:

  • haddr - Indicates AHB txn address
  • hsize - Indicates AHB txn size
  • htrans - Indicates AHB txn type
  • hwdata - Indicates AHB data to be written
  • hwrite - Indicates type of AHB txn

Optional

  • hburst
  • hmastlock
  • hprot
  • hnonsec
  • hexcl
  • hmaster
  • hexokay
  • hsel
  • hready_in
  1. AHB Slave signals

Mandatory:

  • hresp - Indicates AHB txn response type
  • hrdata - Indicates AHB txn read data
  • hready - Indicates AHB slave availability

The basic example of its usage is demonstrated below within the tests that are available.

Metadata

Release files for cocotbext-ahb 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 cocotbext-ahb 0.1.0
File Size Uploaded
cocotbext-ahb-0.1.0.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cocotbext-ahb 0.1.0
File Interpreter ABI Platform
cocotbext_ahb-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 kB

Release files / cocotbext-ahb-0.1.0.tar.gz

Download URL cocotbext-ahb-0.1.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
358c36ddc7c6bd9ff8b2ef35a3a4746f3fd1568410cfa07d613b197e7f523c5a
BLAKE2b-256 checksum
How to use checksums
f3947785395286e0afff66ade177050ece6dcb43681ce594066fe838533e693d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

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

Download URL cocotbext_ahb-0.1.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa3855b547c5e0d97a4c1b5619900841352d2fd5791f54966f6a2c737f0ec606
BLAKE2b-256 checksum
How to use checksums
5428b8f0fe684acfce56b47f08955b49db8ea232aba56995e6eedb4563357316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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