cocotbext-apb

apb modules for cocotb


Keywords
apb, cocotb
License
MIT
Install
pip install cocotbext-apb==0.0.1

Documentation

APB interface modules for Cocotb

Build Status codecov PyPI version Downloads

GitHub repository: https://github.com/daxzio/cocotbext-apb

Introduction

APB simulation models for cocotb.

Installation

Installation from pip (release version, stable):

$ pip install cocotbext-apb

Installation from git (latest development version, potentially unstable):

$ pip install https://github.com/daxzio/cocotbext-apb/archive/main.zip

Installation for active development:

$ git clone https://github.com/daxzio/cocotbext-apb
$ pip install -e cocotbext-apb

Documentation and usage examples

See the tests directory for complete testbenches using these modules.

APB Bus

The APBBus is used to map to a JTAG interface on the dut. Class methods from_entity and from_prefix are provided to facilitate signal default name matching.

Required:

  • psel
  • pwrite
  • paddr
  • pwdata
  • pready
  • prdata

Optional:

  • pstrb
  • pprot
  • pslverr

APB Master

The ApbMaster class implement a APB driver and is capable of generating read and write operations against JTAG devices, either singularly or in a chain.

To use these modules, import the one you need and connect it to the DUT:

from cocotbext.apb import ApbMaster, ApbBus

bus = ApbBus.from_prefix(dut, "s_apb")
apb_driver = ApbMaster(bus, dut.clk)

The first argument to the constructor accepts an ApbBus object. These objects are containers for the interface signals and include class methods to automate connections.

Once the module is instantiated, read and write operations can be initiated in a couple of different ways.