mirror of
https://github.com/Creased/RCM-Emulator.git
synced 2026-12-06 02:48:11 +01:00
Test the CCPLEX model and the hwtest sweep in CI, and document both
- tests/ccplex: a self-contained BPMP payload (ARM, arm-none-eabi-gcc; the AArch64 side is pre-assembled words) that drives CPU0 through bdk's ccplex_boot_cpu0() register sequence. It checks that an unpowered release is refused with its reason, that a powered one runs at EL3 from the SB vector and writes the mailbox, that CPU0 sees TIMERUS move, that WFE parks the core, and that RST_CPUG_CMPLX_SET stops it. `make test`. - tests/hwtest: build hwtest-rcm from a pinned commit with distro toolchains (an empty base_rules stands in for devkitARM, the CPU0 stub builds with gcc-aarch64-linux-gnu) and run its whole sweep headless, checking the CPU0-driven Wi-Fi probe enumerates the CYW4356. - CI runs both in the Linux job and keeps their logs on failure. - Makefile: `test` target; the clean rule's line continuation was a literal "\n" that only worked by accident. - README/DESIGN: CCPLEX CPU0, the uc_mmio_map bus, the block-level clock and TIMERUS poll pacing, the new bug-history entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YYewwDPujjo5B2xRyC5Grb
This commit is contained in:
10 files changed
+566
-26
No files matched your search
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
# CCPLEX regression test: boot CPU0 from a BPMP payload and check what the
|
||||
# emulator and the payload report. Usage: tests/ccplex/run.sh [rcm_emu] [payload]
|
||||
EMU=${1:-./rcm_emu}
|
||||
PAYLOAD=${2:-tests/ccplex/payload.bin}
|
||||
LOG=${LOG:-tests/ccplex/out.log}
|
||||
|
||||
SDL_VIDEODRIVER=dummy RCM_EMU_NO_AUDIO=1 timeout 120 "$EMU" "$PAYLOAD" \
|
||||
> "$LOG" 2>&1
|
||||
status=$?
|
||||
|
||||
fail=0
|
||||
expect() {
|
||||
if grep -q -- "$1" "$LOG"; then
|
||||
echo " ok $2"
|
||||
else
|
||||
echo " FAIL $2 (missing: $1)"
|
||||
fail=1
|
||||
fi
|
||||
}
|
||||
|
||||
echo "ccplex test (emulator exit $status):"
|
||||
expect 'cannot run: CPU rail off' 'an unpowered release is refused, with the reason'
|
||||
expect 'unpowered: CPU0 stayed dark' 'and the core really did not execute'
|
||||
expect 'CPU0 released: AArch64 EL3, MMU off, entry 0xA0000000' 'a powered release boots CPU0 at the SB vector'
|
||||
expect 'powered: magic=50434945' 'CPU0 ran the blob and wrote the mailbox'
|
||||
expect 'el=0000000C' 'CPU0 came up at EL3'
|
||||
expect 'CPU0 stopped (held in reset)' 'RST_CPUG_CMPLX_SET stops the core'
|
||||
expect 'MAX77620 PWR_OFF received' 'the payload ran to its power-off'
|
||||
|
||||
# TIMERUS as CPU0 saw it must have moved across its busy loop.
|
||||
dt=$(sed -n 's/.*dt=\([0-9A-F]*\).*/\1/p' "$LOG" | head -1)
|
||||
if [ -n "$dt" ] && [ "$dt" != "00000000" ]; then
|
||||
echo " ok CPU0 sees time advance (TIMERUS delta 0x$dt)"
|
||||
else
|
||||
echo " FAIL CPU0's TIMERUS delta is zero or missing"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
# Parked in WFE for ~50 ms, the core must retire next to nothing: the park
|
||||
# loop sleeps to the end of each slice instead of spinning.
|
||||
retired=$(sed -n 's/.*CPU0 stopped (held in reset) after \([0-9]*\) instructions.*/\1/p' "$LOG" | head -1)
|
||||
if [ -n "$retired" ] && [ "$retired" -lt 100000 ]; then
|
||||
echo " ok WFE parks the core ($retired instructions retired in total)"
|
||||
else
|
||||
echo " FAIL WFE did not park the core (retired: ${retired:-?})"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
[ $fail -eq 0 ] && echo "ccplex test: PASS" || { echo "ccplex test: FAIL - see $LOG"; exit 1; }
|
||||
Reference in new issue
Block a user