test: add board FFT validation and VCD capture

This commit is contained in:
2026-07-15 04:13:15 +08:00
parent 2359e7976c
commit d45646342b
10 changed files with 198 additions and 23 deletions

View File

@@ -50,11 +50,16 @@ Commands:
prepare Create evidence directories and Vivado project if absent
lint Run the project-aware Verilator lint check
build Build asm, fft, fft_dma, mlkem_test and mlkem_hello
soc Build all five; simulate all except board-only asm
soc Build all five; simulate mlkem_test and mlkem_hello
soc-fft Explicitly run the long fft and fft_dma simulations
implement Run Vivado implementation and collect PPA/CDC/DRC reports
refresh Parse collected evidence, regenerate figures and build the PDF
quick Run lint and refresh only; does not run Vivado implementation
Set SAVE_VCD=1 for SoC simulations to write evidence/soc/<example>.vcd.
Set VCD_SCOPE to a Vivado hierarchy glob to limit waveform size.
Set SIM_RUN_TIME only for bounded waveform diagnostics; regressions use 'all'.
Board-only tests (matmul official 5000-group timing and reset behavior) are
listed in REPORT_RERUN_CHECKLIST.md and are intentionally not automated here.
EOF
@@ -95,21 +100,31 @@ build() {
run_soc_case() {
local example="$1"
local vcd_path="$EVIDENCE_DIR/soc/$example.vcd"
require_vivado
build_example "$example"
(cd "$ROOT/fpga" && "$VIVADO_BIN" -mode batch \
if [[ "${SAVE_VCD:-0}" != "0" ]]; then
echo "VCD output: $vcd_path (scope: ${VCD_SCOPE:-top-level control signals})"
fi
(cd "$ROOT/fpga" && SOC_VCD_PATH="$vcd_path" "$VIVADO_BIN" -mode batch \
-source "$SCRIPT_DIR/run_soc_sim.tcl") 2>&1 | tee "$EVIDENCE_DIR/soc/$example.log"
}
soc() {
prepare
build_example asm
run_soc_case fft
run_soc_case fft_dma
build_example fft
build_example fft_dma
run_soc_case mlkem_test
run_soc_case mlkem_hello
}
soc_fft() {
prepare
run_soc_case fft
run_soc_case fft_dma
}
implement() {
prepare
require_vivado
@@ -130,6 +145,7 @@ case "${1:-}" in
lint) lint ;;
build) build ;;
soc) soc ;;
soc-fft) soc_fft ;;
implement) implement ;;
refresh) refresh ;;
quick) lint; refresh ;;