Storage & CXL · FPGA

SD card emulator on an FPGA SoC

An FPGA that emulates an SD card and keeps the card image in DRAM. Boot images and test data change in software, with no physical card swaps.

  • PLSDIO slave in hardware
  • DRAMbacked card image
  • AXImaster into the PS

Architecture · block diagram

  • Main data path
  • Logic
  • Processor
  • Memory
  • Interconnect
  • Off-chip
SD card emulator: SDIO slave in PL, AXI master into the PS, card image in DRAMFPGA SOCSD host controllerdevice under testSDIO slavePLAXI masterPLPSArm CPU + DDR controllerDRAMemulated card imageSD bus
FIG. 01

The story

Many embedded boards boot from an SD card. To test them, you usually write an image, insert the card, boot and repeat. The process is slow, wears out cards and connectors, and is hard to automate. An FPGA that emulates an SD card removes the physical card from the test loop.

Challenges

On the SD bus, the host had to see a standard SD card. Software also had to be able to change the contents of the card, between boots or during them.

What I built

The device under test talks to the FPGA through its normal SD host controller. In the PL, an SDIO slave implements the card side of the bus. An AXI master turns card reads and writes into memory transactions to the PS. There, the Arm CPU and the DDR controller keep the emulated card image in DRAM. Software on the PS can load, swap or inspect that image at any time.

The hardest problem

The SD protocol sets strict response timing, and the host times out on a slow card. The SDIO slave is in the PL, with a direct AXI path into DRAM. It answers with hardware latency, and the PS only manages the images.

Result

The host sees a standard SD card, backed by DRAM. Software swaps boot images and test data with no physical card changes. The design is also a base for fault injection and for a log of each host read and write.

Original design diagram
Original design diagram: SD host controller, SDIO slave and AXI master in PL, PS with Arm CPU and DDR controller, DRAM
Where it's used

Where you'd find something like this

01

Automated testing of devices that boot from SD

02

Switching boot images in CI farms for embedded Linux boards

03

Fault injection and capturing a host's storage access patterns

Available · Asia/Dhaka (UTC+6)

Have hardware that needs to work?

Tell me what you're building. I'll come back with questions, a rough scope and an estimate, usually within 2 days.

PAD 01 · I/O