diff --git a/.cargo/config.toml b/.cargo/config.toml index 1d43fc3..0215727 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,27 +2,45 @@ # Note, this requires QEMU 9 or higher runner = "qemu-system-arm -machine mps3-an536 -cpu cortex-r52 -semihosting -nographic -audio none -kernel" +[target.thumbv8r-none-eabihf] +# Note, this requires QEMU 9 or higher +runner = "qemu-system-arm -machine mps3-an536 -cpu cortex-r52 -semihosting -nographic -audio none -kernel" + [target.armv7r-none-eabihf] runner = "qemu-system-arm -machine versatileab -cpu cortex-r5f -semihosting -nographic -audio none -kernel" +[target.thumbv7r-none-eabihf] +runner = "qemu-system-arm -machine versatileab -cpu cortex-r5f -semihosting -nographic -audio none -kernel" + [target.armv7r-none-eabi] # change '-mcpu=cortex-r5' to '-mcpu=cortex-r5f' if you use eabi-fpu feature, otherwise # qemu-system-arm will lock up runner = "qemu-system-arm -machine versatileab -cpu cortex-r5 -semihosting -nographic -audio none -kernel" +[target.thumbv7r-none-eabi] +# change '-mcpu=cortex-r5' to '-mcpu=cortex-r5f' if you use eabi-fpu feature, otherwise +# qemu-system-arm will lock up +runner = "qemu-system-arm -machine versatileab -cpu cortex-r5 -semihosting -nographic -audio none -kernel" + [target.armv7a-none-eabihf] runner = "qemu-system-arm -machine versatileab -cpu cortex-a8 -semihosting -nographic -audio none -kernel" +[target.thumbv7a-none-eabihf] +runner = "qemu-system-arm -machine versatileab -cpu cortex-a8 -semihosting -nographic -audio none -kernel" + [target.armv7a-none-eabi] runner = "qemu-system-arm -machine versatileab -cpu cortex-a8 -semihosting -nographic -audio none -kernel" +[target.thumbv7a-none-eabi] +runner = "qemu-system-arm -machine versatileab -cpu cortex-a8 -semihosting -nographic -audio none -kernel" + [target.armv5te-none-eabi] runner = "qemu-system-arm -machine versatileab -cpu arm926 -semihosting -nographic -audio none -kernel" -[target.armv4t-none-eabi] +[target.thumbv5te-none-eabi] runner = "qemu-system-arm -machine versatileab -cpu arm926 -semihosting -nographic -audio none -kernel" -[target.thumbv5te-none-eabi] +[target.armv4t-none-eabi] runner = "qemu-system-arm -machine versatileab -cpu arm926 -semihosting -nographic -audio none -kernel" [target.thumbv4t-none-eabi] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73a8786..ba71484 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,16 +33,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install ${{ matrix.rust }} rustup default ${{ matrix.rust }} rustup target add ${{ matrix.target }} - name: Build run: | - cargo build --target ${{ matrix.target }} - cargo build --target ${{ matrix.target }} --features "serde, defmt, critical-section-multi-core, check-asm" - cargo build --target ${{ matrix.target }} --features "serde, defmt, critical-section-single-core, check-asm" + just build-tier2 ${{ matrix.target }} # These targets need build-std, and have no atomics build-tier3-no-atomics: @@ -58,39 +58,41 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install nightly-2025-10-29 rustup component add rust-src --toolchain nightly-2025-10-29 + rustup default nightly-2025-10-29 - name: Build run: | - cargo +nightly-2025-10-29 build --target ${{ matrix.target }} -Zbuild-std=core - cargo +nightly-2025-10-29 build --target ${{ matrix.target }} -Zbuild-std=core --features "serde, defmt, check-asm" + just build-tier3-no-atomics ${{ matrix.target }} - # Build the host tools - build-host: + # Build the host-only stuff + build-arm-targets: runs-on: ubuntu-24.04 needs: setup strategy: matrix: - rust: [stable, 1.59] + rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install ${{ matrix.rust }} rustup default ${{ matrix.rust }} - name: Build run: | - cd arm-targets - cargo build - cargo test + just build-arm-targets # Gather all the above build jobs together for the purposes of getting an overall pass-fail build-all: runs-on: ubuntu-24.04 - needs: [build-tier2, build-tier3-no-atomics, build-host] + needs: [build-tier2, build-tier3-no-atomics, build-arm-targets] steps: - run: /bin/true @@ -110,7 +112,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Rust run: | rustup install ${{ matrix.rust }} rustup default ${{ matrix.rust }} @@ -130,7 +132,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Rust run: | rustup install ${{ matrix.rust }} rustup default ${{ matrix.rust }} @@ -147,95 +149,86 @@ jobs: - run: /bin/true # Format the workspace - fmt: + fmt-all: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install stable rustup default stable rustup component add rustfmt - name: Format run: | - cargo fmt --check + just fmt-check - # Format the host tools - fmt-host: + # Run clippy on the workpace + clippy: runs-on: ubuntu-24.04 + needs: setup + strategy: + matrix: + target: ${{ fromJSON(needs.setup.outputs.stable-targets) }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | - rustup install stable - rustup default stable - rustup component add rustfmt - - name: Format + rustup toolchain install 1.92 + rustup default 1.92 + rustup target add ${{ matrix.target }} + rustup component add clippy + - name: Clippy run: | - cd arm-targets - cargo fmt --check + just clippy-target ${{ matrix.target }} - # Gather all the above fmt jobs together for the purposes of getting an overall pass-fail - fmt-all: - runs-on: ubuntu-24.04 - needs: [fmt, fmt-host] - steps: - - run: /bin/true - - # Run clippy on the workpace - clippy: + # Run clippy on the examples + clippy-examples: runs-on: ubuntu-24.04 needs: setup - strategy: - matrix: - rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }} - target: ${{ fromJSON(needs.setup.outputs.stable-targets) }} - exclude: - - rust: 1.83 - target: armv7a-none-eabihf - - rust: 1.83 - target: armv8r-none-eabihf steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | - rustup install ${{ matrix.rust }} - rustup default ${{ matrix.rust }} - rustup target add ${{ matrix.target }} + rustup toolchain install 1.92 + rustup default 1.92 + rustup target add armv7r-none-eabihf + rustup target add armv8r-none-eabihf rustup component add clippy - name: Clippy run: | - cargo clippy --target ${{ matrix.target }} - cargo clippy --target ${{ matrix.target }} --no-default-features - cargo clippy --target ${{ matrix.target }} --all-features + just clippy-examples # Run clippy on the host tools clippy-host: runs-on: ubuntu-24.04 needs: setup - strategy: - matrix: - rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | - rustup install ${{ matrix.rust }} - rustup default ${{ matrix.rust }} + rustup toolchain install 1.92 + rustup default 1.92 rustup component add clippy - name: Clippy run: | - cd arm-targets - cargo clippy + just clippy-host # Gather all the above clippy jobs together for the purposes of getting an overall pass-fail clippy-all: runs-on: ubuntu-24.04 - needs: [clippy, clippy-host] + needs: [clippy, clippy-examples, clippy-host] steps: - run: /bin/true @@ -245,13 +238,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install stable rustup default stable - - name: Run cargo test - run: | - cargo test --manifest-path aarch32-cpu/Cargo.toml + - run: | + just test-cargo # Run some programs in QEMU 9 # These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets @@ -261,6 +255,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Just + uses: taiki-e/install-action@just - name: Install Dependencies run: | sudo apt-get -y update @@ -271,7 +267,7 @@ jobs: - name: Run tests in QEMU run: | export PATH=/opt/qemu/bin:$PATH - ./tests.sh + just test-qemu # Gather all the above xxx-all jobs together for the purposes of getting an overall pass-fail all: diff --git a/.gitignore b/.gitignore index a9d37c5..a139b23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ target +examples/mps3-an536/target +examples/mps3-an536/target-d32 +examples/versatileab/target +examples/versatileab/target-d32 Cargo.lock +**/.DS_Store + diff --git a/aarch32-rt/src/arch_v7/svc.rs b/aarch32-rt/src/arch_v7/svc.rs index 3a906e1..000fa69 100644 --- a/aarch32-rt/src/arch_v7/svc.rs +++ b/aarch32-rt/src/arch_v7/svc.rs @@ -21,10 +21,14 @@ core::arch::global_asm!( r#" mrs r0, spsr // Load processor status that was banked on entry tst r0, {t_bit} // SVC occurred from Thumb state? - ldrhne r0, [lr,#-2] // Yes: Load halfword and... - bicne r0, r0, #0xFF00 // ...extract comment field - ldreq r0, [lr,#-4] // No: Load word and... - biceq r0, r0, #0xFF000000 // ...extract comment field + beq 1f + ldrh r0, [lr,#-2] // Yes: Load halfword and... + bic r0, r0, #0xFF00 // ...extract comment field + b 2f + 1: + ldr r0, [lr,#-4] // No: Load word and... + bic r0, r0, #0xFF000000 // ...extract comment field + 2: // r0 now contains SVC number bl _svc_handler "#, diff --git a/aarch32-rt/src/lib.rs b/aarch32-rt/src/lib.rs index 7f653b4..f7c6048 100644 --- a/aarch32-rt/src/lib.rs +++ b/aarch32-rt/src/lib.rs @@ -274,7 +274,7 @@ //! use aarch32_rt::exception; //! //! #[exception(PrefetchAbort)] -//! fn my_handler(addr: usize) -> usize { +//! unsafe fn my_handler(addr: usize) -> usize { //! // do stuff, then go back to the instruction after the one that failed //! addr + 4 //! } diff --git a/arm-targets/Cargo.toml b/arm-targets/Cargo.toml index 8cef727..3143926 100644 --- a/arm-targets/Cargo.toml +++ b/arm-targets/Cargo.toml @@ -11,7 +11,7 @@ name = "arm-targets" readme = "README.md" repository = "https://github.com/rust-embedded/aarch32.git" homepage = "https://github.com/rust-embedded/aarch32" -rust-version = "1.59" +rust-version = "1.83" version = "0.4.0" [dependencies] diff --git a/arm-targets/README.md b/arm-targets/README.md index 7ed05a2..0d19ced 100644 --- a/arm-targets/README.md +++ b/arm-targets/README.md @@ -29,7 +29,7 @@ This allows you to write Rust code in your firmware like: ## Minimum Supported Rust Version (MSRV) -This crate is guaranteed to compile on stable Rust 1.59.0 and up, as recorded +This crate is guaranteed to compile on stable Rust 1.83.0 and up, as recorded by the `package.rust-version` property in `Cargo.toml`. Increasing the MSRV is not considered a breaking change and may occur in a diff --git a/arm-targets/src/lib.rs b/arm-targets/src/lib.rs index 259e4e5..296c30e 100644 --- a/arm-targets/src/lib.rs +++ b/arm-targets/src/lib.rs @@ -216,11 +216,14 @@ impl Arch { Some(Arch::Armv8MBase) } else if target.starts_with("thumbv8m.main-") { Some(Arch::Armv8MMain) - } else if target.starts_with("armv7r-") || target.starts_with("armebv7r") { + } else if target.starts_with("armv7r-") + || target.starts_with("armebv7r-") + || target.starts_with("thumbv7r-") + { Some(Arch::Armv7R) - } else if target.starts_with("armv8r-") { + } else if target.starts_with("armv8r-") || target.starts_with("thumbv8r-") { Some(Arch::Armv8R) - } else if target.starts_with("armv7a-") { + } else if target.starts_with("armv7a-") || target.starts_with("thumbv7a-") { Some(Arch::Armv7A) } else if target.starts_with("aarch64-") || target.starts_with("aarch64be-") { Some(Arch::Armv8A) @@ -347,12 +350,7 @@ pub enum Abi { impl Abi { /// Decode a target string pub fn get(target: &str) -> Option { - if Arch::get(target).is_none() { - // Don't give an ABI for non-Arm targets - // - // e.g. PowerPC also has an ABI called EABI, but it's not the same - return None; - } + let _ = Arch::get(target)?; if target.ends_with("eabi") { Some(Abi::Eabi) } else if target.ends_with("eabihf") { @@ -489,6 +487,16 @@ mod test { assert_eq!(target_info.abi(), Some(Abi::EabiHf)); } + #[test] + fn thumbv8r_none_eabihf() { + let target = "thumbv8r-none-eabihf"; + let target_info = process_target(target); + assert_eq!(target_info.isa(), Some(Isa::T32)); + assert_eq!(target_info.arch(), Some(Arch::Armv8R)); + assert_eq!(target_info.profile(), Some(Profile::R)); + assert_eq!(target_info.abi(), Some(Abi::EabiHf)); + } + #[test] fn armv7a_none_eabi() { let target = "armv7a-none-eabi"; diff --git a/arm-targets/src/main.rs b/arm-targets/src/main.rs index c1824ba..cfa259e 100644 --- a/arm-targets/src/main.rs +++ b/arm-targets/src/main.rs @@ -2,7 +2,7 @@ /// Entry point to the program fn main() { - if let Some(target) = std::env::args().skip(1).next() { + if let Some(target) = std::env::args().nth(1) { println!("// These are the features for the target '{}'", target); arm_targets::process_target(&target); } else { diff --git a/examples/mps3-an536/reference/abt-exception-a32-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/abt-exception-a32-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..d521f0b --- /dev/null +++ b/examples/mps3-an536/reference/abt-exception-a32-thumbv8r-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=0b0010 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=0b0010 Status=0b00001 } +DFSR Status: Ok(AlignmentFault) +caught unaligned_from_a32 +caught fault on COUNTER +Skipping instruction +Recovered from fault OK! diff --git a/examples/mps3-an536/reference/abt-exception-t32-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/abt-exception-t32-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..0067a8b --- /dev/null +++ b/examples/mps3-an536/reference/abt-exception-t32-thumbv8r-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=0b0010 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=0b0010 Status=0b00001 } +DFSR Status: Ok(AlignmentFault) +caught unaligned_from_t32 +caught fault on COUNTER +Skipping instruction +Recovered from fault OK! diff --git a/examples/mps3-an536/reference/el2_hello-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/el2_hello-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..97d1c10 --- /dev/null +++ b/examples/mps3-an536/reference/el2_hello-thumbv8r-none-eabihf.out @@ -0,0 +1,27 @@ +Hello, this is semihosting! x = 1.000, y = 2.000 +Region 0: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 1: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 2: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 3: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 4: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 5: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 6: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 7: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 8: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 9: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 10: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 11: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 12: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 13: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 14: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +Region 15: El2Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL10, no_exec: false, mair: 0, enable: false } +PANIC: PanicInfo { + message: I am an example panic, + location: Location { + file: "src/bin/el2_hello.rs", + line: 27, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/mps3-an536/reference/fpu-test-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/fpu-test-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..e26f6b9 --- /dev/null +++ b/examples/mps3-an536/reference/fpu-test-thumbv8r-none-eabihf.out @@ -0,0 +1,202 @@ +Sine wave test (f32)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) ..............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +Sine wave test (f64)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o diff --git a/examples/mps3-an536/reference/generic_timer-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/generic_timer-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..bd2c08a --- /dev/null +++ b/examples/mps3-an536/reference/generic_timer-thumbv8r-none-eabihf.out @@ -0,0 +1,26 @@ +Found PERIPHBASE 0xf0000000 +Creating GIC driver @ 0xf0000000 / 0xf0100000 +Calling git.setup(0) +cntfrq = 62.500 MHz +Using physical timer ************************ +Print five, every 100ms... +i = 0 +i = 1 +i = 2 +i = 3 +i = 4 +Waiting for 31250000 physical ticks to count up... +Matched! physical +Waiting for 31250000 physical ticks to count down... +physical countdown hit zero! +Using virtual timer ************************ +Print five, every 100ms... +i = 0 +i = 1 +i = 2 +i = 3 +i = 4 +Waiting for 31250000 virtual ticks to count up... +Matched! virtual +Waiting for 31250000 virtual ticks to count down... +virtual countdown hit zero! diff --git a/examples/mps3-an536/reference/generic_timer_irq-armv8r-none-eabihf.out b/examples/mps3-an536/reference/generic_timer_irq-armv8r-none-eabihf.out index d44bcd5..1c3bdd6 100644 --- a/examples/mps3-an536/reference/generic_timer_irq-armv8r-none-eabihf.out +++ b/examples/mps3-an536/reference/generic_timer_irq-armv8r-none-eabihf.out @@ -3,8 +3,8 @@ Creating GIC driver @ 0xf0000000 / 0xf0100000 Calling git.setup(0) Configure Timer Interrupt... Enabling interrupts... -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) } -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) } +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } > IRQ - Timer fired, resetting < IRQ diff --git a/examples/mps3-an536/reference/generic_timer_irq-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/generic_timer_irq-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..1c3bdd6 --- /dev/null +++ b/examples/mps3-an536/reference/generic_timer_irq-thumbv8r-none-eabihf.out @@ -0,0 +1,48 @@ +Found PERIPHBASE 0xf0000000 +Creating GIC driver @ 0xf0000000 / 0xf0100000 +Calling git.setup(0) +Configure Timer Interrupt... +Enabling interrupts... +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 0 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 1 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 2 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 3 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 4 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 5 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 6 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 7 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 8 + > IRQ + - Timer fired, resetting + < IRQ +Main loop wake up 9 +Timer IRQ test completed OK diff --git a/examples/mps3-an536/reference/gic-map-armv8r-none-eabihf.out b/examples/mps3-an536/reference/gic-map-armv8r-none-eabihf.out index db56b21..05e6eea 100644 --- a/examples/mps3-an536/reference/gic-map-armv8r-none-eabihf.out +++ b/examples/mps3-an536/reference/gic-map-armv8r-none-eabihf.out @@ -5,8 +5,8 @@ Configure low-prio SGI... Configure high-prio SGI... gic.enable_interrupt() Enabling interrupts... -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) } -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) } +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } Send lo-prio SGI > IRQ - handle_interrupt_with_id(SGI 3) diff --git a/examples/mps3-an536/reference/gic-map-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/gic-map-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..05e6eea --- /dev/null +++ b/examples/mps3-an536/reference/gic-map-thumbv8r-none-eabihf.out @@ -0,0 +1,20 @@ +Found PERIPHBASE 0xf0000000 +Creating GIC driver @ 0xf0000000 / 0xf0100000 +Calling git.setup(0) +Configure low-prio SGI... +Configure high-prio SGI... +gic.enable_interrupt() +Enabling interrupts... +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } +Send lo-prio SGI +> IRQ +- handle_interrupt_with_id(SGI 3) +- got SGI 3, sending hi-prio SGI 4 +> IRQ +- handle_interrupt_with_id(SGI 4) +- got hi-prio SGI 4! +< IRQ +- finished sending hi-prio! +< IRQ +IRQ test completed OK diff --git a/examples/mps3-an536/reference/gic-priority-ceiling-armv8r-none-eabihf.out b/examples/mps3-an536/reference/gic-priority-ceiling-armv8r-none-eabihf.out index bd00a91..bde2935 100644 --- a/examples/mps3-an536/reference/gic-priority-ceiling-armv8r-none-eabihf.out +++ b/examples/mps3-an536/reference/gic-priority-ceiling-armv8r-none-eabihf.out @@ -5,8 +5,8 @@ Configure low-prio SGI... Configure high-prio SGI... gic.enable_interrupt() Enabling interrupts... -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) } -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) } +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } Send lo-prio SGI > IRQ - IRQ Handling SGI 3 diff --git a/examples/mps3-an536/reference/gic-priority-ceiling-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/gic-priority-ceiling-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..bde2935 --- /dev/null +++ b/examples/mps3-an536/reference/gic-priority-ceiling-thumbv8r-none-eabihf.out @@ -0,0 +1,23 @@ +Found PERIPHBASE 0xf0000000 +Creating GIC driver @ 0xf0000000 / 0xf0100000 +Calling git.setup(0) +Configure low-prio SGI... +Configure high-prio SGI... +gic.enable_interrupt() +Enabling interrupts... +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } +Send lo-prio SGI +> IRQ +- IRQ Handling SGI 3 + - Low prio! + - Pre lock exit + - HIGH PRIO SHOULD RUN AFTER THIS +> IRQ +- IRQ Handling SGI 4 + - High prio! +< IRQ + - HIGH PRIO SHOULD RUN BEFORE THIS + - Post lock exit +< IRQ +IRQ test completed OK diff --git a/examples/mps3-an536/reference/gic-static-section-irq-armv8r-none-eabihf.out b/examples/mps3-an536/reference/gic-static-section-irq-armv8r-none-eabihf.out index db56b21..05e6eea 100644 --- a/examples/mps3-an536/reference/gic-static-section-irq-armv8r-none-eabihf.out +++ b/examples/mps3-an536/reference/gic-static-section-irq-armv8r-none-eabihf.out @@ -5,8 +5,8 @@ Configure low-prio SGI... Configure high-prio SGI... gic.enable_interrupt() Enabling interrupts... -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) } -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) } +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } Send lo-prio SGI > IRQ - handle_interrupt_with_id(SGI 3) diff --git a/examples/mps3-an536/reference/gic-static-section-irq-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/gic-static-section-irq-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..05e6eea --- /dev/null +++ b/examples/mps3-an536/reference/gic-static-section-irq-thumbv8r-none-eabihf.out @@ -0,0 +1,20 @@ +Found PERIPHBASE 0xf0000000 +Creating GIC driver @ 0xf0000000 / 0xf0100000 +Calling git.setup(0) +Configure low-prio SGI... +Configure high-prio SGI... +gic.enable_interrupt() +Enabling interrupts... +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } +Send lo-prio SGI +> IRQ +- handle_interrupt_with_id(SGI 3) +- got SGI 3, sending hi-prio SGI 4 +> IRQ +- handle_interrupt_with_id(SGI 4) +- got hi-prio SGI 4! +< IRQ +- finished sending hi-prio! +< IRQ +IRQ test completed OK diff --git a/examples/mps3-an536/reference/gic-unified-irq-armv8r-none-eabihf.out b/examples/mps3-an536/reference/gic-unified-irq-armv8r-none-eabihf.out index ab68c14..94023e1 100644 --- a/examples/mps3-an536/reference/gic-unified-irq-armv8r-none-eabihf.out +++ b/examples/mps3-an536/reference/gic-unified-irq-armv8r-none-eabihf.out @@ -5,8 +5,8 @@ Configure low-prio SGI... Configure high-prio SGI... gic.enable_interrupt() Enabling interrupts... -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) } -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) } +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } Send lo-prio SGI > IRQ - IRQ Handling SGI 3 diff --git a/examples/mps3-an536/reference/gic-unified-irq-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/gic-unified-irq-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..94023e1 --- /dev/null +++ b/examples/mps3-an536/reference/gic-unified-irq-thumbv8r-none-eabihf.out @@ -0,0 +1,19 @@ +Found PERIPHBASE 0xf0000000 +Creating GIC driver @ 0xf0000000 / 0xf0100000 +Calling git.setup(0) +Configure low-prio SGI... +Configure high-prio SGI... +gic.enable_interrupt() +Enabling interrupts... +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=1 FI=0 DZ=1 BR=0 RR=0 V=0 I=0 Z=1 SW=0 C=0 A=0 M=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=1 SW=0 C=0 A=0 M=0 } +Send lo-prio SGI +> IRQ +- IRQ Handling SGI 3 +- IRQ got SGI 3, sending hi-prio SGI 4 +> IRQ +- IRQ Handling SGI 4 +< IRQ +- IRQ finished sending hi-prio! +< IRQ +IRQ test completed OK diff --git a/examples/mps3-an536/reference/hello-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/hello-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..0d377af --- /dev/null +++ b/examples/mps3-an536/reference/hello-thumbv8r-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: 18, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/mps3-an536/reference/prefetch-exception-a32-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/prefetch-exception-a32-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..0443a50 --- /dev/null +++ b/examples/mps3-an536/reference/prefetch-exception-a32-thumbv8r-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=0b0010 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=0b0010 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/mps3-an536/reference/prefetch-exception-t32-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/prefetch-exception-t32-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..94da556 --- /dev/null +++ b/examples/mps3-an536/reference/prefetch-exception-t32-thumbv8r-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=0b0010 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=0b0010 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/mps3-an536/reference/registers-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/registers-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..ffd2137 --- /dev/null +++ b/examples/mps3-an536/reference/registers-thumbv8r-none-eabihf.out @@ -0,0 +1,39 @@ +MIDR { implementer=0x41 variant=0x1 arch=0xf part_no=0xd13 rev=0x3 } +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) } +IMP_CBAR { 0xf0000000 } +Vbar(8000000) +PMSA-v8 MPUIR: Mpuir { iregions: 0, dregions: 16, non_unified: false } +Region 0: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 1: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 2: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 3: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 4: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 5: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 6: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 7: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 8: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 9: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 10: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 11: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 12: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 13: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 14: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 15: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 0: El1Region { range: 0x0..=0x3fffffff, shareability: OuterShareable, access: ReadWrite, no_exec: true, mair: 0, enable: true } +Region 1: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 2: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 3: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 4: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 5: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 6: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 7: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 8: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 9: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 10: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 11: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 12: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 13: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 14: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +Region 15: El1Region { range: 0x0..=0x3f, shareability: NonShareable, access: ReadWriteNoEL0, no_exec: false, mair: 0, enable: false } +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 +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 diff --git a/examples/mps3-an536/reference/smp_test-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/smp_test-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..7fe30b8 --- /dev/null +++ b/examples/mps3-an536/reference/smp_test-thumbv8r-none-eabihf.out @@ -0,0 +1 @@ +CPU 1 is missing?! diff --git a/examples/mps3-an536/reference/smp_test-thumbv8r-none-eabihf_smp2.out b/examples/mps3-an536/reference/smp_test-thumbv8r-none-eabihf_smp2.out new file mode 100644 index 0000000..7fe30b8 --- /dev/null +++ b/examples/mps3-an536/reference/smp_test-thumbv8r-none-eabihf_smp2.out @@ -0,0 +1 @@ +CPU 1 is missing?! diff --git a/examples/mps3-an536/reference/svc-a32-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/svc-a32-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..d8cc028 --- /dev/null +++ b/examples/mps3-an536/reference/svc-a32-thumbv8r-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-a32.rs", + line: 21, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/mps3-an536/reference/svc-t32-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/svc-t32-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..3476848 --- /dev/null +++ b/examples/mps3-an536/reference/svc-t32-thumbv8r-none-eabihf.out @@ -0,0 +1,14 @@ +x = 1, y = 2, z = 3.000 +In svc_handler, with arg=0x000012 +In svc_handler, with arg=0x000034 +x = 1, y = 2, z = 3.000 +PANIC: PanicInfo { + message: I am an example panic, + location: Location { + file: "src/bin/svc-t32.rs", + line: 23, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/mps3-an536/reference/undef-exception-a32-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/undef-exception-a32-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..dbafb84 --- /dev/null +++ b/examples/mps3-an536/reference/undef-exception-a32-thumbv8r-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/mps3-an536/reference/undef-exception-t32-thumbv8r-none-eabihf.out b/examples/mps3-an536/reference/undef-exception-t32-thumbv8r-none-eabihf.out new file mode 100644 index 0000000..083a29c --- /dev/null +++ b/examples/mps3-an536/reference/undef-exception-t32-thumbv8r-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/examples/mps3-an536/rust-toolchain.toml b/examples/mps3-an536/rust-toolchain.toml index a0744b5..92667db 100644 --- a/examples/mps3-an536/rust-toolchain.toml +++ b/examples/mps3-an536/rust-toolchain.toml @@ -1,5 +1,6 @@ [toolchain] -channel = "stable" +channel = "nightly-2026-01-02" targets = [ "armv8r-none-eabihf", ] +components = ["rust-src", "clippy", "rustfmt"] diff --git a/examples/mps3-an536/src/bin/generic_timer_irq.rs b/examples/mps3-an536/src/bin/generic_timer_irq.rs index 98cad0a..165bca1 100644 --- a/examples/mps3-an536/src/bin/generic_timer_irq.rs +++ b/examples/mps3-an536/src/bin/generic_timer_irq.rs @@ -44,11 +44,11 @@ fn main() -> ! { ); println!("Enabling interrupts..."); - dump_cpsr(); + dump_sctlr(); unsafe { aarch32_cpu::interrupt::enable(); } - dump_cpsr(); + dump_sctlr(); let mut count: u32 = 0; loop { @@ -63,9 +63,9 @@ fn main() -> ! { } } -fn dump_cpsr() { - let cpsr = aarch32_cpu::register::Cpsr::read(); - println!("CPSR: {:?}", cpsr); +fn dump_sctlr() { + let sctlr = aarch32_cpu::register::Sctlr::read(); + println!("{:?}", sctlr); } #[irq] diff --git a/examples/mps3-an536/src/bin/gic-map.rs b/examples/mps3-an536/src/bin/gic-map.rs index 8be088c..f1caa4a 100644 --- a/examples/mps3-an536/src/bin/gic-map.rs +++ b/examples/mps3-an536/src/bin/gic-map.rs @@ -80,11 +80,11 @@ fn main() -> ! { }); println!("Enabling interrupts..."); - dump_cpsr(); + dump_sctlr(); unsafe { aarch32_cpu::interrupt::enable(); } - dump_cpsr(); + dump_sctlr(); // Send it println!("Send lo-prio SGI"); @@ -109,9 +109,9 @@ fn main() -> ! { semihosting::process::exit(0); } -fn dump_cpsr() { - let cpsr = aarch32_cpu::register::Cpsr::read(); - println!("CPSR: {:?}", cpsr); +fn dump_sctlr() { + let sctlr = aarch32_cpu::register::Sctlr::read(); + println!("{:?}", sctlr); } /// Handles the low-prio SGI diff --git a/examples/mps3-an536/src/bin/gic-priority-ceiling.rs b/examples/mps3-an536/src/bin/gic-priority-ceiling.rs index 43c6367..13433ca 100644 --- a/examples/mps3-an536/src/bin/gic-priority-ceiling.rs +++ b/examples/mps3-an536/src/bin/gic-priority-ceiling.rs @@ -61,11 +61,11 @@ fn main() -> ! { .unwrap(); println!("Enabling interrupts..."); - dump_cpsr(); + dump_sctlr(); unsafe { aarch32_cpu::interrupt::enable(); } - dump_cpsr(); + dump_sctlr(); // Send it println!("Send lo-prio SGI"); @@ -90,9 +90,9 @@ fn main() -> ! { semihosting::process::exit(0); } -fn dump_cpsr() { - let cpsr = aarch32_cpu::register::Cpsr::read(); - println!("CPSR: {:?}", cpsr); +fn dump_sctlr() { + let sctlr = aarch32_cpu::register::Sctlr::read(); + println!("{:?}", sctlr); } #[irq] diff --git a/examples/mps3-an536/src/bin/gic-static-section-irq.rs b/examples/mps3-an536/src/bin/gic-static-section-irq.rs index 18717d3..79e807c 100644 --- a/examples/mps3-an536/src/bin/gic-static-section-irq.rs +++ b/examples/mps3-an536/src/bin/gic-static-section-irq.rs @@ -58,11 +58,11 @@ fn main() -> ! { .unwrap(); println!("Enabling interrupts..."); - dump_cpsr(); + dump_sctlr(); unsafe { aarch32_cpu::interrupt::enable(); } - dump_cpsr(); + dump_sctlr(); // Send it println!("Send lo-prio SGI"); @@ -87,9 +87,9 @@ fn main() -> ! { semihosting::process::exit(0); } -fn dump_cpsr() { - let cpsr = aarch32_cpu::register::Cpsr::read(); - println!("CPSR: {:?}", cpsr); +fn dump_sctlr() { + let sctlr = aarch32_cpu::register::Sctlr::read(); + println!("{:?}", sctlr); } #[unsafe(link_section = ".irq_entries")] diff --git a/examples/mps3-an536/src/bin/gic-unified-irq.rs b/examples/mps3-an536/src/bin/gic-unified-irq.rs index 0cb00c2..844c7b6 100644 --- a/examples/mps3-an536/src/bin/gic-unified-irq.rs +++ b/examples/mps3-an536/src/bin/gic-unified-irq.rs @@ -58,11 +58,11 @@ fn main() -> ! { .unwrap(); println!("Enabling interrupts..."); - dump_cpsr(); + dump_sctlr(); unsafe { aarch32_cpu::interrupt::enable(); } - dump_cpsr(); + dump_sctlr(); // Send it println!("Send lo-prio SGI"); @@ -87,9 +87,9 @@ fn main() -> ! { semihosting::process::exit(0); } -fn dump_cpsr() { - let cpsr = aarch32_cpu::register::Cpsr::read(); - println!("CPSR: {:?}", cpsr); +fn dump_sctlr() { + let sctlr = aarch32_cpu::register::Sctlr::read(); + println!("{:?}", sctlr); } #[irq] diff --git a/examples/mps3-an536/src/bin/registers.rs b/examples/mps3-an536/src/bin/registers.rs index ba989fe..a38b630 100644 --- a/examples/mps3-an536/src/bin/registers.rs +++ b/examples/mps3-an536/src/bin/registers.rs @@ -111,6 +111,7 @@ fn mpu_pmsa_v8() { } // Load a config (but don't enable it) + #[allow(clippy::zero_ptr)] mpu.configure(&El1Config { background_config: true, regions: &[El1Region { diff --git a/examples/mps3-an536/src/bin/smp_test.rs b/examples/mps3-an536/src/bin/smp_test.rs index 37d1dd1..e4d8c46 100644 --- a/examples/mps3-an536/src/bin/smp_test.rs +++ b/examples/mps3-an536/src/bin/smp_test.rs @@ -102,11 +102,13 @@ fn main() -> ! { aarch32_cpu::asm::nop(); } + let mut code = 0; let total_a = SHARED_VARIABLE.load(Ordering::Relaxed); if total_a == CAS_LOOPS * 2 { println!("CAS test passed"); } else { println!("CAS test failed, got {} not 2000", total_a); + code = 1; } let total_b = critical_section::with(|cs| { @@ -118,9 +120,10 @@ fn main() -> ! { println!("CS Mutex test passed"); } else { println!("CS Mutex test failed, got {} not 2000", total_b); + code = 1; } - semihosting::process::exit(0); + semihosting::process::exit(code); } /// The entry-point to the Rust application. diff --git a/examples/mps3-an536/src/bin/svc-a32.rs b/examples/mps3-an536/src/bin/svc-a32.rs index 353c070..7b4a086 100644 --- a/examples/mps3-an536/src/bin/svc-a32.rs +++ b/examples/mps3-an536/src/bin/svc-a32.rs @@ -16,7 +16,7 @@ fn main() -> ! { let y = x + 1; let z = (y as f64) * 1.5; println!("x = {}, y = {}, z = {:0.3}", x, y, z); - aarch32_cpu::svc!(0xABCDEF); + do_svc1(); println!("x = {}, y = {}, z = {:0.3}", x, y, z); panic!("I am an example panic"); } @@ -27,6 +27,16 @@ fn svc_handler(arg: u32) { println!("In svc_handler, with arg=0x{:06x}", arg); if arg == 0xABCDEF { // test nested SVC calls - aarch32_cpu::svc!(0x456789); + do_svc2(); } } + +#[instruction_set(arm::a32)] +fn do_svc1() { + aarch32_cpu::svc!(0xABCDEF); +} + +#[instruction_set(arm::a32)] +fn do_svc2() { + aarch32_cpu::svc!(0x456789); +} diff --git a/examples/versatileab/reference/abt-exception-a32-thumbv7a-none-eabi.out b/examples/versatileab/reference/abt-exception-a32-thumbv7a-none-eabi.out new file mode 100644 index 0000000..a41df9a --- /dev/null +++ b/examples/versatileab/reference/abt-exception-a32-thumbv7a-none-eabi.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-a32-thumbv7a-none-eabihf.out b/examples/versatileab/reference/abt-exception-a32-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..a41df9a --- /dev/null +++ b/examples/versatileab/reference/abt-exception-a32-thumbv7a-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-a32-thumbv7r-none-eabi.out b/examples/versatileab/reference/abt-exception-a32-thumbv7r-none-eabi.out new file mode 100644 index 0000000..a41df9a --- /dev/null +++ b/examples/versatileab/reference/abt-exception-a32-thumbv7r-none-eabi.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-a32-thumbv7r-none-eabihf.out b/examples/versatileab/reference/abt-exception-a32-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..a41df9a --- /dev/null +++ b/examples/versatileab/reference/abt-exception-a32-thumbv7r-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-thumbv7a-none-eabi.out b/examples/versatileab/reference/abt-exception-t32-thumbv7a-none-eabi.out new file mode 100644 index 0000000..35dff8b --- /dev/null +++ b/examples/versatileab/reference/abt-exception-t32-thumbv7a-none-eabi.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/abt-exception-t32-thumbv7a-none-eabihf.out b/examples/versatileab/reference/abt-exception-t32-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..35dff8b --- /dev/null +++ b/examples/versatileab/reference/abt-exception-t32-thumbv7a-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/abt-exception-t32-thumbv7r-none-eabi.out b/examples/versatileab/reference/abt-exception-t32-thumbv7r-none-eabi.out new file mode 100644 index 0000000..35dff8b --- /dev/null +++ b/examples/versatileab/reference/abt-exception-t32-thumbv7r-none-eabi.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/abt-exception-t32-thumbv7r-none-eabihf.out b/examples/versatileab/reference/abt-exception-t32-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..35dff8b --- /dev/null +++ b/examples/versatileab/reference/abt-exception-t32-thumbv7r-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/fpu-test-thumbv7a-none-eabi.out b/examples/versatileab/reference/fpu-test-thumbv7a-none-eabi.out new file mode 100644 index 0000000..e26f6b9 --- /dev/null +++ b/examples/versatileab/reference/fpu-test-thumbv7a-none-eabi.out @@ -0,0 +1,202 @@ +Sine wave test (f32)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) ..............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +Sine wave test (f64)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o diff --git a/examples/versatileab/reference/fpu-test-thumbv7a-none-eabihf.out b/examples/versatileab/reference/fpu-test-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..e26f6b9 --- /dev/null +++ b/examples/versatileab/reference/fpu-test-thumbv7a-none-eabihf.out @@ -0,0 +1,202 @@ +Sine wave test (f32)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) ..............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +Sine wave test (f64)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o diff --git a/examples/versatileab/reference/fpu-test-thumbv7r-none-eabi.out b/examples/versatileab/reference/fpu-test-thumbv7r-none-eabi.out new file mode 100644 index 0000000..e26f6b9 --- /dev/null +++ b/examples/versatileab/reference/fpu-test-thumbv7r-none-eabi.out @@ -0,0 +1,202 @@ +Sine wave test (f32)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) ..............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +Sine wave test (f64)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o diff --git a/examples/versatileab/reference/fpu-test-thumbv7r-none-eabihf.out b/examples/versatileab/reference/fpu-test-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..e26f6b9 --- /dev/null +++ b/examples/versatileab/reference/fpu-test-thumbv7r-none-eabihf.out @@ -0,0 +1,202 @@ +Sine wave test (f32)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) ..............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +Sine wave test (f64)... +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o +( 0.0000) ..............................o +( 0.1253) .................................o +( 0.2487) .....................................o +( 0.3681) .........................................o +( 0.4818) ............................................o +( 0.5878) ...............................................o +( 0.6845) ..................................................o +( 0.7705) .....................................................o +( 0.8443) .......................................................o +( 0.9048) .........................................................o +( 0.9511) ..........................................................o +( 0.9823) ...........................................................o +( 0.9980) ...........................................................o +( 0.9980) ...........................................................o +( 0.9823) ...........................................................o +( 0.9511) ..........................................................o +( 0.9048) .........................................................o +( 0.8443) .......................................................o +( 0.7705) .....................................................o +( 0.6845) ..................................................o +( 0.5878) ...............................................o +( 0.4818) ............................................o +( 0.3681) .........................................o +( 0.2487) .....................................o +( 0.1253) .................................o +(-0.0000) .............................o +(-0.1253) ..........................o +(-0.2487) ......................o +(-0.3681) ..................o +(-0.4818) ...............o +(-0.5878) ............o +(-0.6845) .........o +(-0.7705) ......o +(-0.8443) ....o +(-0.9048) ..o +(-0.9511) .o +(-0.9823) o +(-0.9980) o +(-0.9980) o +(-0.9823) o +(-0.9511) .o +(-0.9048) ..o +(-0.8443) ....o +(-0.7705) ......o +(-0.6845) .........o +(-0.5878) ............o +(-0.4818) ...............o +(-0.3681) ..................o +(-0.2487) ......................o +(-0.1253) ..........................o diff --git a/examples/versatileab/reference/hello-thumbv7a-none-eabi.out b/examples/versatileab/reference/hello-thumbv7a-none-eabi.out new file mode 100644 index 0000000..0d377af --- /dev/null +++ b/examples/versatileab/reference/hello-thumbv7a-none-eabi.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: 18, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/hello-thumbv7a-none-eabihf.out b/examples/versatileab/reference/hello-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..0d377af --- /dev/null +++ b/examples/versatileab/reference/hello-thumbv7a-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: 18, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/hello-thumbv7r-none-eabi.out b/examples/versatileab/reference/hello-thumbv7r-none-eabi.out new file mode 100644 index 0000000..0d377af --- /dev/null +++ b/examples/versatileab/reference/hello-thumbv7r-none-eabi.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: 18, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/hello-thumbv7r-none-eabihf.out b/examples/versatileab/reference/hello-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..0d377af --- /dev/null +++ b/examples/versatileab/reference/hello-thumbv7r-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: 18, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/interrupt-thumbv7a-none-eabi.out b/examples/versatileab/reference/interrupt-thumbv7a-none-eabi.out new file mode 100644 index 0000000..51b9aea --- /dev/null +++ b/examples/versatileab/reference/interrupt-thumbv7a-none-eabi.out @@ -0,0 +1,15 @@ +Setting up interrupts... +Firing interrupt... +> interrupt_handler() +> soft_handler1() +> interrupt_handler() +> soft_handler2() +< soft_handler2() +< interrupt_handler() +< soft_handler1() +< interrupt_handler() +Got interrupted :) +> interrupt_handler() +catchall_handler() fired +< interrupt_handler() +catch all works. All done! diff --git a/examples/versatileab/reference/interrupt-thumbv7a-none-eabihf.out b/examples/versatileab/reference/interrupt-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..51b9aea --- /dev/null +++ b/examples/versatileab/reference/interrupt-thumbv7a-none-eabihf.out @@ -0,0 +1,15 @@ +Setting up interrupts... +Firing interrupt... +> interrupt_handler() +> soft_handler1() +> interrupt_handler() +> soft_handler2() +< soft_handler2() +< interrupt_handler() +< soft_handler1() +< interrupt_handler() +Got interrupted :) +> interrupt_handler() +catchall_handler() fired +< interrupt_handler() +catch all works. All done! diff --git a/examples/versatileab/reference/interrupt-thumbv7r-none-eabi.out b/examples/versatileab/reference/interrupt-thumbv7r-none-eabi.out new file mode 100644 index 0000000..51b9aea --- /dev/null +++ b/examples/versatileab/reference/interrupt-thumbv7r-none-eabi.out @@ -0,0 +1,15 @@ +Setting up interrupts... +Firing interrupt... +> interrupt_handler() +> soft_handler1() +> interrupt_handler() +> soft_handler2() +< soft_handler2() +< interrupt_handler() +< soft_handler1() +< interrupt_handler() +Got interrupted :) +> interrupt_handler() +catchall_handler() fired +< interrupt_handler() +catch all works. All done! diff --git a/examples/versatileab/reference/interrupt-thumbv7r-none-eabihf.out b/examples/versatileab/reference/interrupt-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..51b9aea --- /dev/null +++ b/examples/versatileab/reference/interrupt-thumbv7r-none-eabihf.out @@ -0,0 +1,15 @@ +Setting up interrupts... +Firing interrupt... +> interrupt_handler() +> soft_handler1() +> interrupt_handler() +> soft_handler2() +< soft_handler2() +< interrupt_handler() +< soft_handler1() +< interrupt_handler() +Got interrupted :) +> interrupt_handler() +catchall_handler() fired +< interrupt_handler() +catch all works. All done! diff --git a/examples/versatileab/reference/prefetch-exception-a32-thumbv7a-none-eabi.out b/examples/versatileab/reference/prefetch-exception-a32-thumbv7a-none-eabi.out new file mode 100644 index 0000000..1929eee --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-a32-thumbv7a-none-eabi.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-a32-thumbv7a-none-eabihf.out b/examples/versatileab/reference/prefetch-exception-a32-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..1929eee --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-a32-thumbv7a-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-a32-thumbv7r-none-eabi.out b/examples/versatileab/reference/prefetch-exception-a32-thumbv7r-none-eabi.out new file mode 100644 index 0000000..1929eee --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-a32-thumbv7r-none-eabi.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-a32-thumbv7r-none-eabihf.out b/examples/versatileab/reference/prefetch-exception-a32-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..1929eee --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-a32-thumbv7r-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-thumbv7a-none-eabi.out b/examples/versatileab/reference/prefetch-exception-t32-thumbv7a-none-eabi.out new file mode 100644 index 0000000..2b5664f --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-t32-thumbv7a-none-eabi.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/prefetch-exception-t32-thumbv7a-none-eabihf.out b/examples/versatileab/reference/prefetch-exception-t32-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..2b5664f --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-t32-thumbv7a-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/prefetch-exception-t32-thumbv7r-none-eabi.out b/examples/versatileab/reference/prefetch-exception-t32-thumbv7r-none-eabi.out new file mode 100644 index 0000000..2b5664f --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-t32-thumbv7r-none-eabi.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/prefetch-exception-t32-thumbv7r-none-eabihf.out b/examples/versatileab/reference/prefetch-exception-t32-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..2b5664f --- /dev/null +++ b/examples/versatileab/reference/prefetch-exception-t32-thumbv7r-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-thumbv7a-none-eabi.out b/examples/versatileab/reference/registers-thumbv7a-none-eabi.out new file mode 100644 index 0000000..27fdee0 --- /dev/null +++ b/examples/versatileab/reference/registers-thumbv7a-none-eabi.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/registers-thumbv7a-none-eabihf.out b/examples/versatileab/reference/registers-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..27fdee0 --- /dev/null +++ b/examples/versatileab/reference/registers-thumbv7a-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/registers-thumbv7r-none-eabi.out b/examples/versatileab/reference/registers-thumbv7r-none-eabi.out new file mode 100644 index 0000000..6d58047 --- /dev/null +++ b/examples/versatileab/reference/registers-thumbv7r-none-eabi.out @@ -0,0 +1,38 @@ +MIDR { implementer=0x41 variant=0x1 arch=0xf part_no=0xc15 rev=0x3 } +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(c0000000) +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=0 FI=0 DZ=0 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=0 FI=0 DZ=0 BR=0 RR=0 V=0 I=1 Z=1 SW=0 C=1 A=0 M=0 } after +PMSA-v7 MPUIR: Mpuir { iregions: 0, dregions: 16, non_unified: false } +DRegion 0: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 1: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 2: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 3: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 4: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 5: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 6: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 7: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 8: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 9: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 10: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 11: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 12: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 13: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 14: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 15: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 0: Region { base: 0x20000000, size: _16M, subregion_mask: 0, enabled: true, no_exec: false, mem_attr: Cacheable { outer: NonCacheable, inner: WriteThroughNoWriteAllocate, shareable: true } } +DRegion 1: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 2: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 3: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 4: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 5: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 6: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 7: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 8: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 9: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 10: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 11: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 12: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 13: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 14: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 15: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } diff --git a/examples/versatileab/reference/registers-thumbv7r-none-eabihf.out b/examples/versatileab/reference/registers-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..6d58047 --- /dev/null +++ b/examples/versatileab/reference/registers-thumbv7r-none-eabihf.out @@ -0,0 +1,38 @@ +MIDR { implementer=0x41 variant=0x1 arch=0xf part_no=0xc15 rev=0x3 } +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(c0000000) +SCTLR { IE=0 TE=0 NMFI=0 EE=0 U=0 FI=0 DZ=0 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=0 FI=0 DZ=0 BR=0 RR=0 V=0 I=1 Z=1 SW=0 C=1 A=0 M=0 } after +PMSA-v7 MPUIR: Mpuir { iregions: 0, dregions: 16, non_unified: false } +DRegion 0: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 1: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 2: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 3: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 4: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 5: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 6: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 7: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 8: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 9: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 10: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 11: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 12: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 13: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 14: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 15: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 0: Region { base: 0x20000000, size: _16M, subregion_mask: 0, enabled: true, no_exec: false, mem_attr: Cacheable { outer: NonCacheable, inner: WriteThroughNoWriteAllocate, shareable: true } } +DRegion 1: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 2: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 3: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 4: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 5: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 6: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 7: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 8: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 9: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 10: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 11: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 12: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 13: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 14: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } +DRegion 15: Region { base: 0x0, size: Invalid, subregion_mask: 0, enabled: false, no_exec: false, mem_attr: StronglyOrdered } diff --git a/examples/versatileab/reference/svc-a32-thumbv7a-none-eabi.out b/examples/versatileab/reference/svc-a32-thumbv7a-none-eabi.out new file mode 100644 index 0000000..aa7cc28 --- /dev/null +++ b/examples/versatileab/reference/svc-a32-thumbv7a-none-eabi.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-a32.rs", + line: 22, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/svc-a32-thumbv7a-none-eabihf.out b/examples/versatileab/reference/svc-a32-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..aa7cc28 --- /dev/null +++ b/examples/versatileab/reference/svc-a32-thumbv7a-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-a32.rs", + line: 22, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/svc-a32-thumbv7r-none-eabi.out b/examples/versatileab/reference/svc-a32-thumbv7r-none-eabi.out new file mode 100644 index 0000000..aa7cc28 --- /dev/null +++ b/examples/versatileab/reference/svc-a32-thumbv7r-none-eabi.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-a32.rs", + line: 22, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/svc-a32-thumbv7r-none-eabihf.out b/examples/versatileab/reference/svc-a32-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..aa7cc28 --- /dev/null +++ b/examples/versatileab/reference/svc-a32-thumbv7r-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-a32.rs", + line: 22, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/svc-t32-thumbv7a-none-eabi.out b/examples/versatileab/reference/svc-t32-thumbv7a-none-eabi.out new file mode 100644 index 0000000..3476848 --- /dev/null +++ b/examples/versatileab/reference/svc-t32-thumbv7a-none-eabi.out @@ -0,0 +1,14 @@ +x = 1, y = 2, z = 3.000 +In svc_handler, with arg=0x000012 +In svc_handler, with arg=0x000034 +x = 1, y = 2, z = 3.000 +PANIC: PanicInfo { + message: I am an example panic, + location: Location { + file: "src/bin/svc-t32.rs", + line: 23, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/svc-t32-thumbv7a-none-eabihf.out b/examples/versatileab/reference/svc-t32-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..3476848 --- /dev/null +++ b/examples/versatileab/reference/svc-t32-thumbv7a-none-eabihf.out @@ -0,0 +1,14 @@ +x = 1, y = 2, z = 3.000 +In svc_handler, with arg=0x000012 +In svc_handler, with arg=0x000034 +x = 1, y = 2, z = 3.000 +PANIC: PanicInfo { + message: I am an example panic, + location: Location { + file: "src/bin/svc-t32.rs", + line: 23, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/svc-t32-thumbv7r-none-eabi.out b/examples/versatileab/reference/svc-t32-thumbv7r-none-eabi.out new file mode 100644 index 0000000..3476848 --- /dev/null +++ b/examples/versatileab/reference/svc-t32-thumbv7r-none-eabi.out @@ -0,0 +1,14 @@ +x = 1, y = 2, z = 3.000 +In svc_handler, with arg=0x000012 +In svc_handler, with arg=0x000034 +x = 1, y = 2, z = 3.000 +PANIC: PanicInfo { + message: I am an example panic, + location: Location { + file: "src/bin/svc-t32.rs", + line: 23, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/svc-t32-thumbv7r-none-eabihf.out b/examples/versatileab/reference/svc-t32-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..3476848 --- /dev/null +++ b/examples/versatileab/reference/svc-t32-thumbv7r-none-eabihf.out @@ -0,0 +1,14 @@ +x = 1, y = 2, z = 3.000 +In svc_handler, with arg=0x000012 +In svc_handler, with arg=0x000034 +x = 1, y = 2, z = 3.000 +PANIC: PanicInfo { + message: I am an example panic, + location: Location { + file: "src/bin/svc-t32.rs", + line: 23, + column: 5, + }, + can_unwind: true, + force_no_backtrace: false, +} diff --git a/examples/versatileab/reference/undef-exception-a32-thumbv7a-none-eabi.out b/examples/versatileab/reference/undef-exception-a32-thumbv7a-none-eabi.out new file mode 100644 index 0000000..dbafb84 --- /dev/null +++ b/examples/versatileab/reference/undef-exception-a32-thumbv7a-none-eabi.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-a32-thumbv7a-none-eabihf.out b/examples/versatileab/reference/undef-exception-a32-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..dbafb84 --- /dev/null +++ b/examples/versatileab/reference/undef-exception-a32-thumbv7a-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-a32-thumbv7r-none-eabi.out b/examples/versatileab/reference/undef-exception-a32-thumbv7r-none-eabi.out new file mode 100644 index 0000000..dbafb84 --- /dev/null +++ b/examples/versatileab/reference/undef-exception-a32-thumbv7r-none-eabi.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-a32-thumbv7r-none-eabihf.out b/examples/versatileab/reference/undef-exception-a32-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..dbafb84 --- /dev/null +++ b/examples/versatileab/reference/undef-exception-a32-thumbv7r-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-thumbv7a-none-eabi.out b/examples/versatileab/reference/undef-exception-t32-thumbv7a-none-eabi.out new file mode 100644 index 0000000..083a29c --- /dev/null +++ b/examples/versatileab/reference/undef-exception-t32-thumbv7a-none-eabi.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/examples/versatileab/reference/undef-exception-t32-thumbv7a-none-eabihf.out b/examples/versatileab/reference/undef-exception-t32-thumbv7a-none-eabihf.out new file mode 100644 index 0000000..083a29c --- /dev/null +++ b/examples/versatileab/reference/undef-exception-t32-thumbv7a-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/examples/versatileab/reference/undef-exception-t32-thumbv7r-none-eabi.out b/examples/versatileab/reference/undef-exception-t32-thumbv7r-none-eabi.out new file mode 100644 index 0000000..083a29c --- /dev/null +++ b/examples/versatileab/reference/undef-exception-t32-thumbv7r-none-eabi.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/examples/versatileab/reference/undef-exception-t32-thumbv7r-none-eabihf.out b/examples/versatileab/reference/undef-exception-t32-thumbv7r-none-eabihf.out new file mode 100644 index 0000000..083a29c --- /dev/null +++ b/examples/versatileab/reference/undef-exception-t32-thumbv7r-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/examples/versatileab/rust-toolchain.toml b/examples/versatileab/rust-toolchain.toml index 6cfcef0..cf1e917 100644 --- a/examples/versatileab/rust-toolchain.toml +++ b/examples/versatileab/rust-toolchain.toml @@ -1,9 +1,9 @@ [toolchain] -channel = "stable" +channel = "nightly-2026-01-02" targets = [ "armv7r-none-eabi", "armv7r-none-eabihf", "armv7a-none-eabi", "armv7a-none-eabihf", ] -components = ["rust-src"] +components = ["rust-src", "clippy", "rustfmt"] diff --git a/examples/versatileab/src/bin/svc-a32.rs b/examples/versatileab/src/bin/svc-a32.rs index 3a24519..48eac26 100644 --- a/examples/versatileab/src/bin/svc-a32.rs +++ b/examples/versatileab/src/bin/svc-a32.rs @@ -32,18 +32,12 @@ fn svc_handler(arg: u32) { } } -#[cfg_attr( - any(arm_architecture = "v4t", arm_architecture = "v5te"), - instruction_set(arm::a32) -)] +#[instruction_set(arm::a32)] fn do_svc1() { aarch32_cpu::svc!(0xABCDEF); } -#[cfg_attr( - any(arm_architecture = "v4t", arm_architecture = "v5te"), - instruction_set(arm::a32) -)] +#[instruction_set(arm::a32)] fn do_svc2() { aarch32_cpu::svc!(0x456789); } diff --git a/justfile b/justfile new file mode 100644 index 0000000..17d725d --- /dev/null +++ b/justfile @@ -0,0 +1,174 @@ +# The rust-embedded/aarch32 Just file +# +# You need to install `just` from https://github.com/casey/just to use +# this file + +# We only need this for some targets but we set it globally to avoid +# dependencies like proc-macro2 from being rebuilt +export RUSTC_BOOTSTRAP := "1" + + +# If you run with `just v=1` then we make cargo run in verbose mode +v := "0" +verbose := if v == "1" { "--verbose" } else { "" } + +# Our default target. It does everything that you might want to do pre-checkin. +check: build-all build-all-examples fmt-check clippy-examples clippy-targets clippy-host test + +# Cleans up all the target folders +clean: + # The cross-compiled workspace + cargo clean + # The host-compiled helper library + cd arm-targets && cargo clean + # The cross-compiled examples + cd examples/versatileab && cargo clean + cd examples/mps3-an536 && cargo clean + +# Builds our workspace for all targets +build-all: \ + build-arm-targets \ + (build-tier3-no-atomics "armv4t-none-eabi") \ + (build-tier3-no-atomics "thumbv4t-none-eabi") \ + (build-tier3-no-atomics "armv5te-none-eabi") \ + (build-tier3-no-atomics "thumbv5te-none-eabi") \ + (build-tier2 "armv7r-none-eabi") \ + (build-tier3 "thumbv7r-none-eabi") \ + (build-tier2 "armv7r-none-eabihf") \ + (build-tier3 "thumbv7r-none-eabihf") \ + (build-tier2 "armv7a-none-eabi") \ + (build-tier3 "thumbv7a-none-eabi") \ + (build-tier2 "armv7a-none-eabihf") \ + (build-tier3 "thumbv7a-none-eabihf") \ + (build-tier2 "armv8r-none-eabihf") \ + (build-tier3 "thumbv8r-none-eabihf") \ + +# Build the arm-targets library +build-arm-targets: + cd arm-targets && cargo build {{verbose}} + +# Builds our workspace with various features, building core from source, but skipping anything that requires atomics +build-tier3-no-atomics target: + cargo build --target {{target}} -Zbuild-std=core {{verbose}} + cargo build --target {{target}} -Zbuild-std=core --features "serde, defmt, critical-section-single-core, check-asm" {{verbose}} + +# Builds our workspace with various features, building core from source +build-tier3 target: + cargo build --target {{target}} -Zbuild-std=core {{verbose}} + cargo build --target {{target}} -Zbuild-std=core --features "serde, defmt, critical-section-multi-core, check-asm" {{verbose}} + cargo build --target {{target}} -Zbuild-std=core --features "serde, defmt, critical-section-single-core, check-asm" {{verbose}} + +# Builds our workspace with various features +build-tier2 target: + cargo build --target {{target}} {{verbose}} + cargo build --target {{target}} --features "serde, defmt, critical-section-multi-core, check-asm" {{verbose}} + cargo build --target {{target}} --features "serde, defmt, critical-section-single-core, check-asm" {{verbose}} + +# Builds our examples for each target, which also builds our cross-compiled workspace +build-all-examples: \ + (build-versatileab-tier3 "armv4t-none-eabi") \ + (build-versatileab-tier3 "thumbv4t-none-eabi") \ + (build-versatileab-tier3 "armv5te-none-eabi") \ + (build-versatileab-tier3 "thumbv5te-none-eabi") \ + (build-versatileab-tier2 "armv7r-none-eabi") \ + (build-versatileab-tier2 "armv7r-none-eabihf") \ + (build-versatileab-tier2 "armv7a-none-eabi") \ + (build-versatileab-tier2 "armv7a-none-eabihf") \ + (build-mps3-tier2 "armv8r-none-eabihf") \ + +# Builds the Versatile AB examples, building core from source +build-versatileab-tier3 target: + cd examples/versatileab && cargo build --target={{target}} -Zbuild-std=core {{verbose}} + +# Builds the Versatile AB examples, assuming core has been prebuilt +build-versatileab-tier2 target: + cd examples/versatileab && cargo build --target={{target}} {{verbose}} + +# Builds the MPS3-AN536 examples, assuming core has been prebuilt +build-mps3-tier2 target: + cd examples/mps3-an536 && cargo build --target={{target}} {{verbose}} + +# Formats all the code +fmt: + # The cross-compiled workspace + cargo fmt {{verbose}} + # The host-compiled helper library + cd arm-targets && cargo fmt {{verbose}} + # The cross-compiled examples cargo fmt + cd examples/versatileab && cargo fmt {{verbose}} + cd examples/mps3-an536 && cargo fmt {{verbose}} + +# Checks all the code is formatted +fmt-check: + # The cross-compiled workspace + cargo fmt --check + # The host-compiled helper library + cd arm-targets && cargo fmt --check {{verbose}} + # The cross-compiled examples cargo fmt + cd examples/versatileab && cargo fmt --check {{verbose}} + cd examples/mps3-an536 && cargo fmt --check {{verbose}} + +# Checks all the cross-compiled workspace passes the clippy lints +clippy-targets: \ + (clippy-target "armv7r-none-eabi") \ + (clippy-target "armv7r-none-eabihf") \ + (clippy-target "armv7a-none-eabi") \ + (clippy-target "armv7a-none-eabihf") \ + (clippy-target "armv8r-none-eabihf") \ + +# Checks all the cross-compiled workspace passes the clippy lints +clippy-target target: + cargo clippy --target={{target}} {{verbose}} + +# Checks the examples pass the clippy lints +clippy-examples: + cd examples/versatileab && cargo clippy --target=armv7r-none-eabi {{verbose}} + cd examples/mps3-an536 && cargo clippy --target=armv8r-none-eabihf {{verbose}} + +# Checks the host code passes the clippy lints +clippy-host: + # The cross-compiled workspace + cargo clippy {{verbose}} + # The host-compiled helper library + cd arm-targets && cargo clippy {{verbose}} + +# Run all the tests +test: test-cargo test-qemu test-smp + +# Run the unit tests with cargo +test-cargo: + # The cross-compiled workspace + cargo test {{verbose}} + # The host-compiled helper library + cd arm-targets && cargo test {{verbose}} + +# Run the integration tests in QEMU +test-qemu: + #!/bin/sh + FAIL=0 + ./tests.sh examples/versatileab armv4t-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab thumbv4t-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv5te-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab thumbv5te-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv7r-none-eabi {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab thumbv7r-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv7r-none-eabihf {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab thumbv7r-none-eabihf -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv7a-none-eabi {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab thumbv7a-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv7a-none-eabihf {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab thumbv7a-none-eabihf -Zbuild-std=core {{verbose}} || FAIL=1 + RUSTFLAGS=-Ctarget-feature=+d32 ./tests.sh examples/versatileab armv7a-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} || FAIL=1 + RUSTFLAGS=-Ctarget-feature=+d32 ./tests.sh examples/versatileab thumbv7a-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} || FAIL=1 + ./tests.sh examples/mps3-an536 armv8r-none-eabihf {{verbose}} || FAIL=1 + ./tests.sh examples/mps3-an536 thumbv8r-none-eabihf -Zbuild-std=core {{verbose}} || FAIL=1 + RUSTFLAGS=-Ctarget-cpu=cortex-r52 ./tests.sh examples/mps3-an536 armv8r-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} || FAIL=1 + RUSTFLAGS=-Ctarget-cpu=cortex-r52 ./tests.sh examples/mps3-an536 thumbv8r-none-eabihf -Zbuild-std=core --features=fpu-d32 --target-dir=target-d32 {{verbose}} || FAIL=1 + if [ "${FAIL}" == "1" ]; then exit 1; fi + +# Run the special SMP test +# +# You can't run the normal examples with two CPUs because nothing stops the second CPU from running :/. So we have +# a special test for SMP mode on the MPS3-AN536 +test-smp: + cd examples/mps3-an536 && cargo run --target=armv8r-none-eabihf --bin smp_test {{verbose}} -- --smp 2 diff --git a/tests.sh b/tests.sh index 7700e4b..eb92aa9 100755 --- a/tests.sh +++ b/tests.sh @@ -38,38 +38,20 @@ my_diff() { fi } -run_tests() { - directory=$1 - target="$2" - flags=$3 - echo "Running directory=$directory target=$target flags=$flags" - pushd $directory - cargo build --target=$target $flags || exit 1 - for bin_path in src/bin/*.rs; do - filename=$(basename $bin_path) - binary=${filename%.rs} - cargo run --target=$target --bin $binary $flags > ./target/$binary-$target.out - my_diff ./reference/$binary-$target.out ./target/$binary-$target.out || fail $binary $target - done - popd -} - -run_tests examples/versatileab armv7r-none-eabi "" -run_tests examples/versatileab armv7r-none-eabihf "" -run_tests examples/versatileab armv7a-none-eabi "" -run_tests examples/versatileab armv7a-none-eabihf "" -RUSTFLAGS="-Ctarget-feature=+d32" run_tests examples/versatileab armv7a-none-eabihf "--features=fpu-d32" -RUSTC_BOOTSTRAP=1 run_tests examples/versatileab armv5te-none-eabi "-Zbuild-std=core" -RUSTC_BOOTSTRAP=1 run_tests examples/versatileab armv4t-none-eabi "-Zbuild-std=core" -RUSTC_BOOTSTRAP=1 run_tests examples/versatileab thumbv5te-none-eabi "-Zbuild-std=core" -RUSTC_BOOTSTRAP=1 run_tests examples/versatileab thumbv4t-none-eabi "-Zbuild-std=core" -run_tests examples/mps3-an536 armv8r-none-eabihf "" -RUSTFLAGS="-Ctarget-cpu=cortex-r52" run_tests examples/mps3-an536 armv8r-none-eabihf "--features=fpu-d32" - -# Special case the SMP test. You can't run the normal examples with two CPUs because nothing stops the second CPU from running :/ -pushd examples/mps3-an536 -cargo run --target=armv8r-none-eabihf --bin smp_test -- --smp 2 > ./target/smp_test-armv8r-none-eabihf_smp2.out -my_diff ./reference/smp_test-armv8r-none-eabihf_smp2.out ./target/smp_test-armv8r-none-eabihf_smp2.out || fail smp_test armv8r-none-eabihf +directory=$1 +shift +target=$1 +shift +flags="$*" +echo "Running directory=$directory target=$target flags=$flags" +pushd $directory +cargo build --target=$target $flags || exit 1 +for bin_path in src/bin/*.rs; do + filename=$(basename $bin_path) + binary=${filename%.rs} + cargo run --target=$target --bin $binary $flags > ./target/$binary-$target.out + my_diff ./reference/$binary-$target.out ./target/$binary-$target.out || fail $binary $target +done popd if [ "$FAILURE" == "1" ]; then