EP07 - DDR3 DMA on ALINX PI-AR035-F1-1 ===================================== Board : ALINX PI-AR035-F1-1, XC7A35T-FGG484-2 DDR3 : MT41J128M16XX-125, 16-bit, 400 MHz DDR, 256 MiB CPU : OpenHW CVE2 / CV32E20, RV32IM, 50 MHz UI : MIG 7-series native app interface, 4:1, 128-bit, ui_clk = 100 MHz What is tested -------------- A DMA master walks a contiguous byte range in three phases: 1. write an address-derived 128-bit pattern, one BL8 at a time; 2. read the range back and compare every 128-bit beat; 3. read again while computing CRC-32 over the 16 bytes of each beat. The range is selected by CSR: 1 MiB, 16 MiB or 256 MiB. The test runs each size twice in one boot, then repeats the complete sequence after a second independent FPGA configuration. Both UART logs are byte-identical. CSR map (base 0x2001_0000) -------------------------- +0x00 CTRL bit0 start toggle, bits[3:1] size (0=1 MiB,1=16 MiB,2=256 MiB), bit4 CRC enable +0x04 STATUS bit0 calib, bit1 busy, bit2 done, bit3 fail, bit4 crc_ok, bits[7:5] state +0x08 SIZE 0x1000_0000 (256 MiB) +0x0c WR_CYCLES ui_clk cycles for the write phase +0x10 RD_CYCLES ui_clk cycles for the compare phase +0x14 CRC_CYCLES ui_clk cycles for the CRC phase +0x18 BEATS returned 128-bit beats +0x1c ERRORS mismatched beats +0x20 FIRST_ERR first mismatched app_addr +0x24 CRC_DATA computed CRC-32 +0x28 CRC_EXP expected CRC-32 +0x2c VERSION 0x4550_3037 Results (run 1, repeated byte-identically in run 2) --------------------------------------------------- 1 MiB beats 65,536 wr 733 MB/s rd 1,420 MB/s crc 40 MB/s err 0 16 MiB beats 1,048,576 wr 733 MB/s rd 1,422 MB/s crc 39 MB/s err 0 256 MiB beats 16,777,216 wr 733 MB/s rd 1,422 MB/s crc 39 MB/s err 0 CRC-32 at 256 MiB: data = expected = 0x3ac478a7 EP07 RESULT: PASS Timing / resources ------------------ WNS 0.194 ns, WHS 0.001 ns, TNS/THS 0, 0 failing endpoints, 25,668 endpoints. LUT 9,333 (44.87%), FF 8,865 (21.31%), BRAM 32/50 (64%), DSP 11, IOB 73. DRC 0 errors, 0 warnings. Why read is faster than write ----------------------------- The 16-bit DDR3 at 400 MHz DDR has a theoretical 1,600 MB/s peak. Read reaches 1,422 MB/s (88.9%) because reads are pipelined with 32 outstanding commands. Write reaches 733 MB/s (45.8%) because this engine presents the 128-bit write data in one cycle and the write command in the next, i.e. two ui_clk cycles per BL8. That is deliberate: it preserves the known-good native UI sequence used by the factory self-test. Issuing data and command together is a possible next optimisation. Boundaries ---------- - Native MIG UI, not AXI4. The FPGA does not contain an AXI4 interconnect or AXI4-to-native adapter for this test. - One DMA master, one linear range, no scatter/gather and no CPU-visible memory window. The CPU only programs the CSR and polls status. - CRC is byte-wise and intentionally throttled; it measures correctness, not peak CRC throughput. - No ECC, no DDR3 margin sweep, no temperature/voltage corner, no long-soak. - Throughput is measured in ui_clk cycles with a fixed 100 MHz clock; it is not a DRAM efficiency benchmark against other controllers. Build ----- Vivado 2025.2, part xc7a35t-2fgg484. vivado -mode batch -source build_ep07.tcl Firmware: cd sw && make The bitstream embeds sw/firmware.hex through the two simple_ram INIT_FILE parameters, so a firmware change requires re-synthesis.