feat: add lab-rv32i-freertos-isr-drivers card
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
nm=$RISCV_NM
|
||||
readelf=$RISCV_READELF
|
||||
if [ -z "$nm" ]; then nm=riscv64-unknown-elf-nm; fi
|
||||
if [ -z "$readelf" ]; then readelf=riscv64-unknown-elf-readelf; fi
|
||||
elf=build/task01_isr_drivers/prog.elf
|
||||
if "$nm" -C -u "$elf" | grep -Eq '__cxa_|_Unwind_|std::|libstdc\+\+'; then echo "hosted C++ runtime dependency" >&2; exit 1; fi
|
||||
if "$nm" -C --defined-only "$elf" | grep -Eq 'vtable for|typeinfo for|typeinfo name for'; then echo "virtual/RTTI metadata" >&2; exit 1; fi
|
||||
if "$readelf" -S "$elf" | grep -Eq '\.init_array|\.eh_frame|\.gcc_except_table'; then echo "initializer/exception/unwind section" >&2; exit 1; fi
|
||||
for symbol in freertos_risc_v_application_interrupt_handler isr_drivers_debug_checkpoint g_mcause g_rx_queued g_rx_dropped g_isr_yield_calls g_isr_drivers_pass; do
|
||||
if ! "$nm" --defined-only "$elf" | grep -Fq "$symbol"; then echo "missing evidence: $symbol" >&2; exit 1; fi
|
||||
done
|
||||
for symbol in g_uart_registers g_gpio_registers g_rx_queue_control g_rx_queue_storage g_receiver_tcb g_receiver_stack; do
|
||||
if ! "$nm" -C --defined-only "$elf" | grep -E "[[:space:]][bB][[:space:]].*$symbol" >/dev/null; then
|
||||
echo "static ISR storage is not in .bss: $symbol" >&2; exit 1
|
||||
fi
|
||||
done
|
||||
echo "PASS ABI: MMIO model, queue and task storage in .bss; no C++ runtime"
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
script_dir=$(CDPATH= cd "$(dirname "$0")" && pwd); repo_root=$(CDPATH= cd "$script_dir/.." && pwd); tex_path="$repo_root/doc/main.tex"
|
||||
read_tex_command() { sed -n "s/^\\\\newcommand{\\\\$1}{\\([^}]*\\)}$/\\1/p" "$tex_path" | head -n 1; }
|
||||
publisher=$(read_tex_command PublisherDomain); area=$(read_tex_command CardArea); series=$(read_tex_command CardSeries); number=$(read_tex_command CardNumber); slug=$(read_tex_command CardSlug); version=$(read_tex_command CardVersion); uuid=$(read_tex_command DocumentUUID)
|
||||
if [ -z "$publisher" ] || [ -z "$area" ] || [ -z "$series" ] || [ -z "$number" ] || [ -z "$slug" ] || [ -z "$version" ] || [ -z "$uuid" ]; then echo "missing card metadata in $tex_path" >&2; exit 1; fi
|
||||
commit=${GITEA_SHA:-${GITHUB_SHA:-}}; if [ -z "$commit" ]; then commit=$(git -C "$repo_root" rev-parse HEAD 2>/dev/null || printf '%s' uncommitted); fi
|
||||
meta="$repo_root/doc/build-meta.tex"; trap 'rm -f "$meta"' EXIT HUP INT TERM; printf '\\newcommand{\\BuildCommit}{%s}\n' "$(printf '%s' "$commit" | cut -c1-12)" > "$meta"
|
||||
out="$repo_root/doc/pdf"; mkdir -p "$out"; ( cd "$repo_root/doc" && latexmk -pdf -interaction=nonstopmode -halt-on-error -outdir="$out" main.tex )
|
||||
target="$out/$publisher-$area-$series-$number-$slug-$version-$uuid.pdf"; mv "$out/main.pdf" "$target"
|
||||
find "$out" -maxdepth 1 -type f \( -name '*.aux' -o -name '*.log' -o -name '*.out' -o -name '*.fls' -o -name '*.fdb_latexmk' \) -delete
|
||||
printf '%s\n' "$target"
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
tb=$1
|
||||
build_dir=$2
|
||||
echo "== task01_isr_drivers =="
|
||||
"$tb" --bin "$build_dir/task01_isr_drivers/prog.bin" --cycles 1000000 --cpuret
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
cxx=c++
|
||||
if [ -n "$CXX_HOST" ]; then cxx=$CXX_HOST; fi
|
||||
build_dir=host-build
|
||||
if [ -n "$1" ]; then build_dir=$1; fi
|
||||
mkdir -p "$build_dir"
|
||||
$cxx -std=c++17 -Wall -Wextra -Werror -pedantic \
|
||||
-fsanitize=address,undefined -fno-omit-frame-pointer \
|
||||
-Itests/host-shim -Iinclude tests/isr_drivers_host.cpp \
|
||||
-o "$build_dir/isr_drivers_host"
|
||||
ASAN_OPTIONS=detect_leaks=1 "$build_dir/isr_drivers_host"
|
||||
echo "PASS host: explicit FromISR views, drop-newest and one accumulated yield"
|
||||
Reference in New Issue
Block a user