diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc86c7f..9cfffbc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,20 +101,20 @@ jobs: cargo build # Build the workspace for the target architecture but using nightly to compile libcore - # Technically it doens't need 'setup' but it makes the graph look nicer + # Technically it doesn't need 'setup' but it makes the graph look nicer build-tier3: runs-on: ubuntu-24.04 needs: setup strategy: matrix: target: - - armebv7r-none-eabi - - armebv7r-none-eabihf - - armv7r-none-eabi - armv7a-none-eabi - armv7a-none-eabihf + - armv7r-none-eabi - armv7r-none-eabihf - armv8r-none-eabihf + - armebv7r-none-eabi + - armebv7r-none-eabihf steps: - name: Checkout uses: actions/checkout@v4 diff --git a/examples/versatileab/reference/abt-exception-a32-armv7a-none-eabihf.out b/examples/versatileab/reference/abt-exception-a32-armv7a-none-eabihf.out new file mode 100644 index 0000000..a41df9a --- /dev/null +++ b/examples/versatileab/reference/abt-exception-a32-armv7a-none-eabihf.out @@ -0,0 +1,14 @@ +Hello, this is an data abort exception example +data abort occurred +DFSR (Fault Status Register): DFSR { ext=false wnr=false Domain=0b0000 Status=0b00001 } +DFSR Status: Ok(AlignmentFault) +caught unaligned_from_a32 +caught fault on COUNTER +Doing it again +data abort occurred +DFSR (Fault Status Register): DFSR { ext=false wnr=false Domain=0b0000 Status=0b00001 } +DFSR Status: Ok(AlignmentFault) +caught unaligned_from_a32 +caught fault on COUNTER +Skipping instruction +Recovered from fault OK! diff --git a/examples/versatileab/reference/abt-exception-t32-armv7a-none-eabihf.out b/examples/versatileab/reference/abt-exception-t32-armv7a-none-eabihf.out new file mode 100644 index 0000000..35dff8b --- /dev/null +++ b/examples/versatileab/reference/abt-exception-t32-armv7a-none-eabihf.out @@ -0,0 +1,14 @@ +Hello, this is an data abort exception example +data abort occurred +DFSR (Fault Status Register): DFSR { ext=false wnr=false Domain=0b0000 Status=0b00001 } +DFSR Status: Ok(AlignmentFault) +caught unaligned_from_t32 +caught fault on COUNTER +Doing it again +data abort occurred +DFSR (Fault Status Register): DFSR { ext=false wnr=false Domain=0b0000 Status=0b00001 } +DFSR Status: Ok(AlignmentFault) +caught unaligned_from_t32 +caught fault on COUNTER +Skipping instruction +Recovered from fault OK! diff --git a/examples/versatileab/reference/hello-armv7a-none-eabihf.out b/examples/versatileab/reference/hello-armv7a-none-eabihf.out new file mode 100644 index 0000000..59aae22 --- /dev/null +++ b/examples/versatileab/reference/hello-armv7a-none-eabihf.out @@ -0,0 +1,11 @@ +Hello, this is semihosting! x = 1.000, y = 2.000 +PANIC: PanicInfo { + message: I am an example panic, + location: Location { + file: "src/bin/hello.rs", + line: 19, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/prefetch-exception-a32-armv7a-none-eabihf.out b/examples/versatileab/reference/prefetch-exception-a32-armv7a-none-eabihf.out new file mode 100644 index 0000000..1929eee --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-a32-armv7a-none-eabihf.out @@ -0,0 +1,14 @@ +Hello, this is a prefetch abort exception example +prefetch abort occurred +IFSR (Fault Status Register): IFSR { ext=false Domain=0b0000 Status=0b00010 } +IFSR Status: Ok(DebugEvent) +IFAR (Faulting Address Register): Ifar(0) +caught bkpt_from_a32 +Doing it again +prefetch abort occurred +IFSR (Fault Status Register): IFSR { ext=false Domain=0b0000 Status=0b00010 } +IFSR Status: Ok(DebugEvent) +IFAR (Faulting Address Register): Ifar(0) +caught bkpt_from_a32 +Skipping instruction +Recovered from fault OK! diff --git a/examples/versatileab/reference/prefetch-exception-t32-armv7a-none-eabihf.out b/examples/versatileab/reference/prefetch-exception-t32-armv7a-none-eabihf.out new file mode 100644 index 0000000..2b5664f --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-t32-armv7a-none-eabihf.out @@ -0,0 +1,14 @@ +Hello, this is a prefetch abort exception example +prefetch abort occurred +IFSR (Fault Status Register): IFSR { ext=false Domain=0b0000 Status=0b00010 } +IFSR Status: Ok(DebugEvent) +IFAR (Faulting Address Register): Ifar(0) +caught bkpt_from_t32 +Doing it again +prefetch abort occurred +IFSR (Fault Status Register): IFSR { ext=false Domain=0b0000 Status=0b00010 } +IFSR Status: Ok(DebugEvent) +IFAR (Faulting Address Register): Ifar(0) +caught bkpt_from_t32 +Skipping instruction +Recovered from fault OK! diff --git a/examples/versatileab/reference/registers-armv7a-none-eabihf.out b/examples/versatileab/reference/registers-armv7a-none-eabihf.out new file mode 100644 index 0000000..27fdee0 --- /dev/null +++ b/examples/versatileab/reference/registers-armv7a-none-eabihf.out @@ -0,0 +1,5 @@ +MIDR { implementer=0x41 variant=0x0 arch=0xf part_no=0xc08 rev=0x0 } +CPSR { N=0 Z=1 C=1 V=0 Q=0 J=0 E=0 A=1 I=1 F=1 T=0 MODE=Ok(Sys) } +Mpidr(0) +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=0 SW=0 C=0 A=0 M=0 } before setting C, I and Z +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=1 Z=1 SW=0 C=1 A=0 M=0 } after diff --git a/examples/versatileab/reference/svc-armv7a-none-eabihf.out b/examples/versatileab/reference/svc-armv7a-none-eabihf.out new file mode 100644 index 0000000..5933c55 --- /dev/null +++ b/examples/versatileab/reference/svc-armv7a-none-eabihf.out @@ -0,0 +1,14 @@ +x = 1, y = 2, z = 3.000 +In svc_handler, with arg=0xabcdef +In svc_handler, with arg=0x456789 +x = 1, y = 2, z = 3.000 +PANIC: PanicInfo { + message: I am an example panic, + location: Location { + file: "src/bin/svc.rs", + line: 22, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/undef-exception-a32-armv7a-none-eabihf.out b/examples/versatileab/reference/undef-exception-a32-armv7a-none-eabihf.out new file mode 100644 index 0000000..dbafb84 --- /dev/null +++ b/examples/versatileab/reference/undef-exception-a32-armv7a-none-eabihf.out @@ -0,0 +1,8 @@ +Hello, this is a undef exception example +undefined abort occurred +caught udf_from_a32 +Doing it again +undefined abort occurred +caught udf_from_a32 +Skipping instruction +Recovered from fault OK! diff --git a/examples/versatileab/reference/undef-exception-t32-armv7a-none-eabihf.out b/examples/versatileab/reference/undef-exception-t32-armv7a-none-eabihf.out new file mode 100644 index 0000000..083a29c --- /dev/null +++ b/examples/versatileab/reference/undef-exception-t32-armv7a-none-eabihf.out @@ -0,0 +1,8 @@ +Hello, this is a undef exception example +undefined abort occurred +caught udf_from_t32 +Doing it again +undefined abort occurred +caught udf_from_t32 +Skipping instruction +Recovered from fault OK! diff --git a/tests.sh b/tests.sh index 2e5f179..d540a54 100755 --- a/tests.sh +++ b/tests.sh @@ -56,6 +56,14 @@ for bin_path in $(ls examples/versatileab/src/bin/*.rs); do my_diff ./examples/versatileab/reference/$binary-armv7a-none-eabi.out ./target/$binary-armv7a-none-eabi.out || fail $binary "armv7a-none-eabi" done +# armv7a-none-eabihf tests +for bin_path in $(ls examples/versatileab/src/bin/*.rs); do + filename=${bin_path##*/} + binary=${filename%.rs} + RUSTC_BOOTSTRAP=1 cargo run ${versatile_ab_cargo} --target=armv7a-none-eabihf --bin $binary | tee ./target/$binary-armv7a-none-eabihf.out + my_diff ./examples/versatileab/reference/$binary-armv7a-none-eabihf.out ./target/$binary-armv7a-none-eabihf.out || fail $binary "armv7a-none-eabihf" +done + # These tests only run on QEMU 9 or higher. # Ubuntu 24.04 supplies QEMU 8, which doesn't support the machine we have configured for this target if qemu-system-arm --version | grep "version 9"; then