Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/mps3-an536/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ semihosting = { version = "0.1.18", features = ["stdio"] }
arm-gic = { version = "0.7.1", optional = true }
critical-section = "1.2.0"
heapless = "0.9.1"
libm = "0.2.15"

[build-dependencies]
arm-targets = {version = "0.3.0", path = "../../arm-targets"}
Expand Down
202 changes: 202 additions & 0 deletions examples/mps3-an536/reference/fpu-test-armv8r-none-eabihf.out
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions examples/mps3-an536/src/bin/fpu-test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//! Simple FPU test

#![no_std]
#![no_main]

// pull in our start-up code
use cortex_r_rt::entry;

// pull in our library
use mps3_an536 as _;

use semihosting::println;

static BAR: &str = "............................................................";
const MAX_LEN: f32 = BAR.len() as f32;

/// The entry-point to the Rust application.
///
/// It is called by the start-up code in `cortex-r-rt`.
#[entry]
fn main() -> ! {
const STEPS: u16 = 100;
const RADIANS_PER_STEP: f32 = (4.0 * core::f32::consts::PI) / (STEPS as f32);
println!("Sine wave test (f32)...");
for row in 0..STEPS {
let angle = (row as f32) * RADIANS_PER_STEP;
let sine = libm::sinf(angle);
let bar_len = ((sine + 1.0) * (MAX_LEN / 2.0)) as usize;
println!("({:7.04}) {:.*}o", sine, bar_len, BAR);
}

println!("Sine wave test (f64)...");
for row in 0..STEPS {
let angle = (row as f64) * f64::from(RADIANS_PER_STEP);
let sine = libm::sin(angle);
let bar_len = ((sine + 1.0) * (f64::from(MAX_LEN) / 2.0)) as usize;
println!("({:7.04}) {:.*}o", sine, bar_len, BAR);
}
semihosting::process::exit(0);
}
1 change: 1 addition & 0 deletions examples/versatileab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cortex-ar = { path = "../../cortex-ar", features = ["critical-section-single-cor
cortex-a-rt = { path = "../../cortex-a-rt" }
cortex-r-rt = { path = "../../cortex-r-rt" }
semihosting = { version = "0.1.18", features = ["stdio"] }
libm = "0.2.15"

[build-dependencies]
arm-targets = { version = "0.3.0", path = "../../arm-targets" }
Expand Down
Loading