OpenCores

USB 2.0 capture and decode core

Project maintainers

Details

Name: usb_sniffer
Created: Jun 5, 2020
Updated: Jun 5, 2020
SVN Updated: Jun 6, 2020
SVN: Browse
Latest version: download (might take a bit to start...)
Statistics: View
Bugs: 0 reported / 0 solved
Star0you like it: star it!

Other project properties

Category:Coprocessor
Language:Verilog
Development status:Stable
Additional info:
WishBone compliant: No
WishBone version: n/a
License: LGPL

USB Sniffer

Github: https://github.com/ultraembedded/core_usb_sniffer

This core is a HS/FS USB2.0 analyzer (USB bus sniffer).
The core monitors a UTMI interface and logs the traffic seen to a memory buffer via an AXI-4 bus master interface.
The log format can be extracted continuously (continuous capture mode) or the core can stop capturing when the memory buffer is full (one-shot mode).

Configuration of the IP is performed using an AXI4-Lite slave interface.

This core has been used to produce a USB 2.0 Capture Device.

Features

  • Option of filtering based on device ID and/or endpoint.
  • Option of filtering out SOF packets.
  • Option of filtering out IN+NAK packets.
  • Dense logging format.
  • Supports continuous streaming or one-shot mode.
  • Detection of buffer overruns.
Register Map
OffsetNameDescription
0x00USB_BUFFER_CFGRW Configuration Register
0x04USB_BUFFER_STSR Status Register
0x08USB_BUFFER_BASERW Buffer Base Address
0x0cUSB_BUFFER_ENDRW Buffer End Address
0x10USB_BUFFER_CURRENTR Buffer Current address
Register: USB_BUFFER_CFG
BitsNameDescription
31CONTContinuous capture - overwrite on wrap (0 = Stop on full, 1 = cont)
30:24DEVDevice ID to match (only if MATCH_DEV = 1)
19:16EPEndpoint to match (only if MATCH_EP = 1)
15PHY_DMPULLDOWNUTMI PHY D+ Pulldown Enable (valid if SPEED=manual)
14PHY_DPPULLDOWNUTMI PHY D+ Pulldown Enable (valid if SPEED=manual)
13PHY_TERMSELECTUTMI PHY Termination Select (valid if SPEED=manual)
12:11PHY_XCVRSELECTUTMI PHY Transceiver Select (valid if SPEED=manual)
10:9PHY_OPMODEUTMI PHY Output Mode (valid if SPEED=manual)
8:7SPEEDUSB bus speed (0 = HS, 1 = FS, 2 = LS, 3=manual)
6EXCLUDE_EPExclude specific endpoint
5MATCH_EPMatch specific endpoint
4EXCLUDE_DEVExclude specific device ID
3MATCH_DEVMatch specific device ID
2IGNORE_SOFDrop SOF packets (0 = Log SOF, 1 = Drop SOF)
1IGNORE_IN_NAKDrop IN + NAK sequences
0ENABLEDCapture enabled
Register: USB_BUFFER_STS
BitsNameDescription
2DATA_LOSSData lost due to stream backpressure
1WRAPPEDCapture wrapped
0TRIGCapture triggered
Register: USB_BUFFER_BASE
BitsNameDescription
31:0ADDRAddress of buffer base
Register: USB_BUFFER_END
BitsNameDescription
31:0ADDRAddress of buffer end
Register: USB_BUFFER_CURRENT
BitsNameDescription
31:0ADDRCurrent buffer address - last entry written

References