E23 — The V5F runs the DVP ring alone
| ID | E23 |
| Date | 2026-12-03 |
| Status | done |
| Decisions | D102 (DECISIONS.md) |
| Board | #1 (rev A, 12 MHz HSE), RP on the direct PC port, RP PIO counter → DVP at 75 MHz |
| Firmware + results | fw/tests/2026-12-03-1-clocks-v5fdvp-sdorder (final sources, 7 CH32 builds, results.txt) |
| Scripts | dvpv5frun.py |
Summary: The V5F polls the DVP from hart 1, re-arms the ping-pong DMA buffer and checks every chunk: 0 bad samples down to 64-sample chunks at 75 MS/s at 96 and 156 MHz, while the V3F runs at full speed.
What
dvpv5frun <chunk> <ms>: the V3F sets up and starts the DVP, hands the ring to the V5F (V5F_CMD_DVPRUN) and runs its
RAM ALU loop until the end; “v3f free” = loops done vs the same loop with no stream. --pauses sweeps a pause of
0–100 nops between the V5F’s DVP->IFR polls.
Results
| chunk | 96 MHz: bad, V5F busy | 156 MHz: bad, V5F busy |
|---|---|---|
| 4096 | 0, 57.3 % | 0, 49.4 % |
| 1024 | 0, 57.8 % | 0, 50.1 % |
| 256 | 0, 60.3 % | 0, 52.8 % |
| 128 | 0, 63.1 % | 0, 56.4 % |
| 64 | 0, 69.6 % | 0, 63.7 % |
| 32 | 1.85 M bad | 0.28 M bad |
| 1024 / 64 at 37.5 MS/s | 0, 27.1 / 33.3 % | 0, 24.7 / 31.4 % |
- V3F free: 100 % at every point (1803 RAM-loop calls of 1.11 ms in 2 s at 96 MHz, 2929 of 0.68 ms at 156 MHz).
- The pause between IFR polls (0, 4, 16, 100 nops) changes nothing: peripheral polling by the V5F does not slow the V3F (unlike a pure load loop on one shared-RAM word, E17).
- First run reported “V3F free 6.3 %” everywhere: GCC had merged the 16 reference calls of the pure bench function into one. Fixed with a volatile argument.
Lesson
A number that stays identical across very different conditions is a measurement bug. Check a benchmark’s absolute times against a known reference before reading ratios.
Chip facts and numbers: fw/LEARNINGS.md. All experiments: index.