Git Product home page Git Product logo

tracewhisperer's Introduction

TraceWhisperer

TraceWhisperer is a trace sniffer, originally developed for the CW305 DesignStart target, then ported to the PhyWhisperer-USB and ChipWhisperer-Husky platforms. The "trace" we're talking about here is Coresight processor trace data (ETM, DWT, ITM) that can be output by Arm Cortex processors via their parallel trace port or SWO pin.

TraceWhisperer evolved from the DesignStartTrace project, so have a look at the documentation there too for more information. Jupyter notebooks which show how to use TraceWhisperer (for all platforms) are in that repository.

One target with the parallel trace port is our K82F target, but it should be possible to use TraceWhisperer with any target that has a trace port. Currently, TraceWhisperer supports 4-bit wide trace ports only, but adding support for other widths should be fairly easy.

The SWO pin is more common -- you'll find it on our STM32 targets -- but its bandwidth is much lower than the trace port.

The trace sniffer features and capabilities with TraceWhisperer are basically the same as on the CW305 DesignStart platform. Some differences to note:

  • Since the PhyWhisperer FPGA is smaller than the CW305 FPGA, the largest FIFO that can fit here is 16K deep (allowing for up to 16Kbytes of trace data). If ILAs are required for debug and development, define TINYFIFO to free up BRAM resources.
  • On ChipWhisperer-Husky, 8Kbytes of traces data can be recorded.
  • On CW305, the target and trace sniffer are co-located on the same FPGA, and so the trace port signals remain internal (not driving any external pins). On the PhyWhisperer and Husky platforms, the trace data and clock come from an external chip, and this has two implications:
    1. Activity on the trace pins (and, to a lesser degree, SWO) adds significant noise to the side-channel power measurements. See this note for more information.
    2. Since parallel trace port data is DDR, the trace clock received by PhyWhisperer goes to a PLL which has a published minimum of 10 MHz, which means that the target clock must be at least 20 MHz.

To learn more, refer to the DesignStartTrace README.

Trace Port Connections

If using parallel trace, five pins must be connected from the trace target to the front side 20-pin connector of PhyWhisperer-USB / ChipWhisperer Husky in order to supply it with trace data:

  • trace clock: to CK pin
  • trace data[3]: to D7 pin
  • trace data[2]: to D6 pin
  • trace data[1]: to D5 pin
  • trace data[0]: to D4 pin

If using SWO, three pins must be connected:

  • SWDIO/TMS to D0 pin
  • SWCLK/TCLK to D1 pin
  • SWO/TDO to D2 pin

On PhyWhisperer-USB, if the target-generated trigger is to be used to trigger trace collection, then the target trigger must be connected to the "PC" pin of the 20-pin connector on the side of PhyWhisperer-USB. This does not apply to ChipWhisperer-Husky since here the target trigger is available via Husky's internal trigger logic.

Finally, and again only for PhyWhisperer-USB, the target clock can be connected to the 'HS2" ping of the side 20-pin connector. This is highly recommended for SWO mode, to allow for synchronous trace data capture (see clocks.md for more information on this). The target clock may also be used for parallel trace, although it does not provide any advantages over the trace clock.

Implementation Details

This page has details on internal clocking, which is needed to understand the time relationship between power traces and debug traces.

This page has low-level details on how captured trace data is stored and retrieved from the FPGA.

tracewhisperer's People

Contributors

jpcrypt avatar

Stargazers

Junyan MA avatar Daehyeon Bae avatar Jevin Sweval avatar

Watchers

Jevin Sweval avatar James Cloos avatar Colin O'Flynn avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.