Pico 2 (RP2350) CYCCNT measurement firmware (hardware testing Setup 2)#21
Merged
Conversation
Standalone Pico SDK project (examples/pico2_cyccnt/, not wired into the
root build) implementing the cycle-measurement deliverable of
docs/HARDWARE_TESTING.md Setup 2: the icount runPipeline workload
(push/pull 32-frame blocks, 997 Hz sine, 1000 warmup + 2000 measured
iterations) timed per block with the Cortex-M33 cycle counter, over
Q15 x {fast, balanced} x {1, 2, 12} channels plus float 1ch (guarded by
PICO2_MEASURE_FLOAT, default ON). Prints mean/p99/max cycles per block,
cycles/frame and the 150 MHz core share of one 48 kHz stream, ending
with SRT_PICO2_DONE; correlating against the committed M33 QEMU
instruction baselines calibrates the cycles-per-instruction ratio.
Pico SDK 2.1.1 pinned via FetchContent (git tag; release tarballs lack
the tinyusb submodule USB stdio needs). Verified: full cross-build with
arm-none-eabi-gcc 13.2.1 produces pico2_cyccnt.uf2 (text 74,588 B,
bss 12,224 B; SMLALD present in the Q15 dot product). Not run -- no
RP2350 hardware in this environment.
https://claude.ai/code/session_01HuAFfoeD5a5Xe5aGNA16M9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Setup 2 deliverable from docs/HARDWARE_TESTING.md: standalone Raspberry Pi Pico 2 (RP2350) firmware that measures the converter's real-silicon cost with DWT.CYCCNT — closing the loop between our deterministic QEMU instruction counts and actual M33 cycles.
What's in here (
examples/pico2_cyccnt/, not wired into the root build)GIT_SUBMODULES "lib/tinyusb"keeps the clone minimal; source tarballs can't work — they exclude the tinyusb submodule USB stdio needs),PICO_BOARD=pico2.main.cpp: enables CYCCNT, runs exactly the icount pipeline workload (997 Hz sine, push/pull 32-frame blocks, 1000 warmup + 2000 measured) across Q15 × {fast, balanced} × {1, 2, 12}ch plus float 1ch (option-gated), and prints mean/p99/max cycles per block, cycles/frame, and the % of a 150 MHz core per 48 kHz stream. The source documents the QEMU M33 baselines it calibrates against (pipeline_q15 5,043 insns/frame; pipeline12_q15 10,027) — flash it and the printed table answers "cycles per QEMU instruction" for all future M33 budget math.Verified
Full cross-build to a flashable
pico2_cyccnt.uf2(74.6 KB binary, 12.2 KB static RAM; heap analysis says 12ch fits). Disassembly confirms the SMLALD dual-MAC Q15 path (C4) is in the binary — the measurement covers the intended kernel. Not run: needs your physical Pico 2; that's the point.https://claude.ai/code/session_01HuAFfoeD5a5Xe5aGNA16M9
Generated by Claude Code