On-chip power side-channel monitoring of an FPGA DNN accelerator
A voltage sensor built from FPGA fabric, next to a neural-network accelerator on Zynq-7000. Its traces show when the accelerator runs inference.
- 150 MHzTDC sensor clock
- 76.56%DSP utilization
- 47.52%BRAM utilization
- 0installs needed on the board
Architecture · block diagram
- Main data path
- Logic
- Processor
- Memory
- Interconnect
- Off-chip
The story
A neural-network accelerator draws current while it runs. The supply voltage of the chip dips in a pattern that follows its workload. On an FPGA, a sensor built from the fabric can measure those dips. For a research client, I built the hardware and software to capture those traces next to a running DNN accelerator, for the client's analysis.
Challenges
The sensor shares the chip with the accelerator, and its placement moves when the design changes. Captures had to be repeatable across many inferences. The board also had to run with no installs, no internet access and no compiles on the board.
What I built
On a Zynq-7000 (ZC706), a TDC-based voltage sensor sits beside the DPU inference engine. Both connect to an AXI control bus. Sensor data flows through AXI DMA into DRAM. The PS runs Linux with the DNN runtime and the tools for offline analysis of the captured traces.
The PetaLinux root filesystem is self-contained. Recipes build the DPU runtime, the dpu.ko kernel module and the capture apps into the image. The board runs on first boot with no setup.
The hardest problem
A TDC sensor is a delay line, and its reading depends on where the placer puts it. When the accelerator changed, auto-placement moved the sensor, and its baseline got worse. Pblock and Tcl placement constraints now lock the location of the sensor, and its baseline holds across design changes.
The final design uses 76.56% of the DSP slices and 47.52% of the BRAM on the XC7Z045.
Result
In the per-inference traces, DNN inference is clearly different from idle. With the placement locked, the sensor baseline holds across design changes. The self-contained Linux image captures traces with no setup on the board.
Resource utilization on the XC7Z045
| Resource | Used | Available | Utilization |
|---|---|---|---|
| LUT | 70552 | 218600 | 32.27% |
| LUTRAM | 2704 | 70400 | 3.84% |
| FF | 202535 | 437200 | 46.33% |
| BRAM | 259 | 545 | 47.52% |
| DSP | 689 | 900 | 76.56% |
| MMCM | 1 | 8 | 12.50% |
Where you'd find something like this
Security assessment of AI accelerators: leakage that can reveal model activity
Threat analysis for multi-tenant FPGA clouds
On-chip activity and health monitoring