Skip to content

bunnie/usb-test-suite-testbenches

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usb-test-suite-testbenches

This repository contains test and wrapper scripts for USB IP cores, implemented using cocotb and cocotb_usb.

Setup

You should use the parent repository and follow the steps there to ensure the correct folder structure is maintained. This will also take care of the dependencies.

Dependencies

Usage

Execution is controlled by Makefile. To execute tests with default values, use:

make sim

Test output is saved to a results.xml file. Signal states are stored in dump.vcd.

If you want to switch targets, make sure to run make clean.

Basic options that can be set:

  • TEST_SCRIPT - name of script from the tests directory to be executed, without the .py extension. Default is test-enum.
  • TARGET - IP core to be tested. Currently valentyusb (default), usb1device and foboot are supported.
  • TARGET_OPTIONS - in case some are availablw in the wrapper script.

Other makefile targets:

  • decode - export USB transactions to a usb.pcap file to be viewed i.e. in Wireshark. USB line states are saved to usb.vcd.

For example to run the Windows 10 enumeration test on Foboot core, use:

make TARGET=foboot TEST_SCRIPT=test-w10enum sim

Additional setup

Signal traces are saved in the .vcd format. They can be viewed using GTKWave.

In order to decode USB signals, sigrok decodes are used. You can obtain sigrok-cli and libsigrokdecode from its website or use a conda package. Note that packages provided by your repository manager may be out-of-date, which can lead to significantly longer decoding times.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.7%
  • Verilog 3.2%
  • Makefile 3.1%