Skip to content

Commit 07e1535

Browse files
Add MPS3-AN536 tests on QEMU 9
There was a small variation in the counter output from run to run, so I removed the output.
1 parent ac3aa53 commit 07e1535

File tree

7 files changed

+112
-12
lines changed

7 files changed

+112
-12
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cntfrq = 62.500 MHz
2+
Using physical timer ************************
3+
Print five, one per second...
4+
i = 0
5+
i = 1
6+
i = 2
7+
i = 3
8+
i = 4
9+
Waiting for 125000000 physical ticks to count up...
10+
Matched! physical
11+
Waiting for 125000000 physical ticks to count down...
12+
physical countdown hit zero!
13+
Using virtual timer ************************
14+
Print five, one per second...
15+
i = 0
16+
i = 1
17+
i = 2
18+
i = 3
19+
i = 4
20+
Waiting for 125000000 virtual ticks to count up...
21+
Matched! virtual
22+
Waiting for 125000000 virtual ticks to count down...
23+
virtual countdown hit zero!
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Found PERIPHBASE 0xf0000000
2+
Creating GIC driver @ 0xf0000000 / 0xf0100000
3+
Calling git.setup(0)
4+
Configure SGI...
5+
gic.enable_interrupt()
6+
Enabling interrupts...
7+
CPSR: CPSR { N=0 Z=1 C=1 V=0 Q=0 J=0 E=0 A=0 I=1 F=1 T=0 MODE=Ok(Sys) }
8+
CPSR: CPSR { N=0 Z=1 C=1 V=0 Q=0 J=0 E=0 A=0 I=0 F=1 T=0 MODE=Ok(Sys) }
9+
Send SGI
10+
> IRQ
11+
- IRQ handle SGI 3
12+
< IRQ
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Hello, this is semihosting! x = 1.000, y = 2.000
2+
PANIC: PanicInfo {
3+
message: I am an example panic,
4+
location: Location {
5+
file: "src/bin/hello.rs",
6+
line: 26,
7+
col: 5,
8+
},
9+
can_unwind: true,
10+
force_no_backtrace: false,
11+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
MIDR { implementer=0x41 variant=0x1 arch=0xf part_no=0xd13 rev=0x3 }
2+
CPSR { N=0 Z=1 C=1 V=0 Q=0 J=0 E=0 A=0 I=1 F=1 T=0 MODE=Ok(Sys) }
3+
IMP_CBAR { 0xf0000000 }
4+
VBAR { 0x08000000 }
5+
PMSA-v8 MPUIR: Mpuir { iregions: 0, dregions: 16, non_unified: false }
6+
Region 0: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
7+
Region 1: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
8+
Region 2: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
9+
Region 3: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
10+
Region 4: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
11+
Region 5: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
12+
Region 6: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
13+
Region 7: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
14+
Region 8: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
15+
Region 9: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
16+
Region 10: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
17+
Region 11: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
18+
Region 12: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
19+
Region 13: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
20+
Region 14: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
21+
Region 15: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
22+
Region 0: Region { range: 0x0..=0x3fffffff, shareability: OuterShareable, access: ReadWrite, no_exec: true, mair: 0, enable: true }
23+
Region 1: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
24+
Region 2: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
25+
Region 3: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
26+
Region 4: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
27+
Region 5: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
28+
Region 6: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
29+
Region 7: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
30+
Region 8: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
31+
Region 9: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
32+
Region 10: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
33+
Region 11: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
34+
Region 12: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
35+
Region 13: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
36+
Region 14: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
37+
Region 15: Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false }
38+
SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=1 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=0 } before setting C, I and Z
39+
SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=1 RR=0 V=0 I=1 Z=1 SW=0 C=1 A=0 M=0 } after
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
x = 1, y = 2, z = 3.000
2+
In _svc_handler, with arg=0xabcdef
3+
In _svc_handler, with arg=0x456789
4+
x = 1, y = 2, z = 3.000
5+
PANIC: PanicInfo {
6+
message: I am an example panic,
7+
location: Location {
8+
file: "src/bin/svc.rs",
9+
line: 29,
10+
col: 5,
11+
},
12+
can_unwind: true,
13+
force_no_backtrace: false,
14+
}

examples/mps3-an536/src/bin/generic_timer.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,13 @@ fn main() {
4141
}
4242

4343
let now = timer.counter();
44-
println!("{} is now: {}", name, now);
4544
println!("Waiting for {} {} ticks to count up...", delay_ticks, name);
4645
timer.counter_compare_set(now + delay_ticks as u64);
4746
timer.enable(true);
4847
while !timer.interrupt_status() {
4948
core::hint::spin_loop();
5049
}
51-
println!("Matched! {} count now {}", name, timer.counter());
50+
println!("Matched! {}", name);
5251

5352
println!(
5453
"Waiting for {} {} ticks to count down...",
@@ -58,10 +57,6 @@ fn main() {
5857
while !timer.interrupt_status() {
5958
core::hint::spin_loop();
6059
}
61-
println!(
62-
"{} countdown hit zero! (and is now {})",
63-
name,
64-
timer.countdown() as i32
65-
);
60+
println!("{} countdown hit zero!", name,);
6661
}
6762
}

tests.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
rustup target add armv7r-none-eabi
77
rustup target add armv7r-none-eabihf
88
rustup target add armv7a-none-eabi
9+
rustup toolchain add nightly
10+
rustup component add rust-src --toolchain=nightly
911

1012
FAILURE=0
1113

@@ -19,6 +21,7 @@ fail() {
1921
mkdir -p ./target
2022

2123
versatile_ab_cargo="--manifest-path examples/versatileab/Cargo.toml"
24+
mps3_an536_cargo="--manifest-path examples/mps3-an536/Cargo.toml"
2225

2326
# armv7r-none-eabi tests
2427
for binary in hello registers svc; do
@@ -38,12 +41,15 @@ for binary in hello registers svc undef-exception prefetch-exception abt-excepti
3841
diff ./examples/versatileab/reference/$binary-armv7a-none-eabi.out ./target/$binary-armv7a-none-eabi.out || fail $binary "armv7a-none-eabi"
3942
done
4043

44+
# These tests only run on QEMU 9 or higher.
4145
# Ubuntu 24.04 supplies QEMU 8, which doesn't support the machine we have configured for this target
42-
# # armv8r-none-eabihf tests
43-
# for binary in hello registers svc gic; do
44-
# cargo +nightly run --target=armv8r-none-eabihf --bin $binary --features=gic -Zbuild-std=core | tee ./target/$binary-armv8r-none-eabihf.out
45-
# diff ./cortex-r-examples/reference/$binary-armv8r-none-eabihf.out ./target/$binary-armv8r-none-eabihf.out || fail $binary "armv8r-none-eabihf"
46-
# done
46+
if qemu-system-arm --version | grep "version 9"; then
47+
# armv8r-none-eabihf tests
48+
for binary in hello registers svc gic generic_timer; do
49+
cargo +nightly run ${mps3_an536_cargo} --target=armv8r-none-eabihf --bin $binary --features=gic -Zbuild-std=core | tee ./target/$binary-armv8r-none-eabihf.out
50+
diff ./examples/mps3-an536/reference/$binary-armv8r-none-eabihf.out ./target/$binary-armv8r-none-eabihf.out || fail $binary "armv8r-none-eabihf"
51+
done
52+
fi
4753

4854
if [ "$FAILURE" == "1" ]; then
4955
echo "***************************************************"

0 commit comments

Comments
 (0)