Skip to content

Add stm32f4-0.14.0 benchmark #1241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2022
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions collector/benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ They mostly consist of real-world crates.
- **serde**: A serialization/deserialization crate. Used by many other
Rust programs.
- **stm32f4**: A crate that has many thousands of blanket impl blocks.
- **stm32f4-0.14.0**: A crate that has many thousands of blanket impl blocks.
- **syn**: A library for parsing Rust code. An important part of the Rust
ecosystem.
- **unicode_normalization**: Unicode character composition and decomposition
Expand Down
13 changes: 13 additions & 0 deletions collector/benchmarks/stm32f4-0.14.0/0-negate.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/generic.rs b/src/generic.rs
index f0184cd4..2712ae45 100644
--- a/src/generic.rs
+++ b/src/generic.rs
@@ -277,7 +277,6 @@ impl<FI> FieldReader<bool, FI> {
/// Returns `true` if the bit is set (1).
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
- self.bit()
+ !self.bit()
}
}
-
171 changes: 171 additions & 0 deletions collector/benchmarks/stm32f4-0.14.0/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions collector/benchmarks/stm32f4-0.14.0/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2018"
name = "stm32f4"
version = "0.14.0"
authors = ["Adam Greig <[email protected]>", "stm32-rs Contributors"]
description = "Device support crates for STM32F4 devices"
readme = "README.md"
keywords = ["stm32", "svd2rust", "no_std", "embedded"]
categories = ["embedded", "no-std"]
license = "MIT/Apache-2.0"
repository = "https://github.com/stm32-rs/stm32-rs"
[package.metadata.docs.rs]
default-target = "thumbv7em-none-eabihf"
features = ["rt", "stm32f401", "stm32f407", "stm32f413", "stm32f469"]
targets = []
[dependencies.bare-metal]
version = "1.0.0"

[dependencies.cortex-m]
version = "0.7.2"

[dependencies.cortex-m-rt]
version = ">=0.6.15,<0.8"
optional = true

[dependencies.vcell]
version = "0.1.3"

[features]
default = ["rt"]
rt = ["cortex-m-rt/device"]
stm32f401 = []
stm32f405 = []
stm32f407 = []
stm32f410 = []
stm32f411 = []
stm32f412 = []
stm32f413 = []
stm32f427 = []
stm32f429 = []
stm32f446 = []
stm32f469 = []

[workspace]
40 changes: 40 additions & 0 deletions collector/benchmarks/stm32f4-0.14.0/Cargo.toml.orig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions collector/benchmarks/stm32f4-0.14.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# stm32f4
This crate provides an autogenerated API for access to STM32F4 peripherals.
The API is generated using [svd2rust] with patched svd files containing
extensive type-safe support. For more information please see the [main repo].

Refer to the [documentation] for full details.

[svd2rust]: https://github.com/japaric/svd2rust
[main repo]: https://github.com/stm32-rs/stm32-rs
[documentation]: https://docs.rs/stm32f4/latest/stm32f4/

## Usage
Each device supported by this crate is behind a feature gate so that you only
compile the device(s) you want. To use, in your Cargo.toml:

```toml
[dependencies.stm32f4]
version = "0.14.0"
features = ["stm32f401", "rt"]
```

The `rt` feature is optional and brings in support for `cortex-m-rt`.

In your code:

```rust
use stm32f4::stm32f401;

let mut peripherals = stm32f401::Peripherals::take().unwrap();
let gpioa = &peripherals.GPIOA;
gpioa.odr.modify(|_, w| w.odr0().set_bit());
```

For full details on the autogenerated API, please see:
https://docs.rs/svd2rust/0.19.0/svd2rust/#peripheral-api

## Supported Devices

| Module | Devices | Links |
|:------:|:-------:|:-----:|
| stm32f401 | STM32F401 | [RM0368](https://www.st.com/resource/en/reference_manual/dm00096844.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html) |
| stm32f405 | STM32F405, STM32F415 | [RM0090](https://www.st.com/resource/en/reference_manual/dm00031020.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f405-415.html) |
| stm32f407 | STM32F407, STM32F417 | [RM0090](https://www.st.com/resource/en/reference_manual/dm00031020.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f407-417.html) |
| stm32f410 | STM32F410 | [RM0401](https://www.st.com/resource/en/reference_manual/dm00180366.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f410.html) |
| stm32f411 | STM32F411 | [RM0383](https://www.st.com/resource/en/reference_manual/dm00119316.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html) |
| stm32f412 | STM32F412 | [RM0402](https://www.st.com/resource/en/reference_manual/dm00180369.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f412.html) |
| stm32f413 | STM32F413, STM32F423 | [RM0430](https://www.st.com/resource/en/reference_manual/dm00305666.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f413-423.html) |
| stm32f427 | STM32F427, STM32F437 | [RM0090](https://www.st.com/resource/en/reference_manual/dm00031020.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f427-437.html) |
| stm32f429 | STM32F429, STM32F439 | [RM0090](https://www.st.com/resource/en/reference_manual/dm00031020.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f429-439.html) |
| stm32f446 | STM32F446 | [RM0390](https://www.st.com/resource/en/reference_manual/dm00135183.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html) |
| stm32f469 | STM32F469, STM32F479 | [RM0386](https://www.st.com/resource/en/reference_manual/dm00127514.pdf), [st.com](https://www.st.com/en/microcontrollers-microprocessors/stm32f469-479.html) |
35 changes: 35 additions & 0 deletions collector/benchmarks/stm32f4-0.14.0/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
if env::var_os("CARGO_FEATURE_RT").is_some() {
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
println!("cargo:rustc-link-search={}", out.display());
let device_file = if env::var_os("CARGO_FEATURE_STM32F401").is_some() {
"src/stm32f401/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F405").is_some() {
"src/stm32f405/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F407").is_some() {
"src/stm32f407/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F410").is_some() {
"src/stm32f410/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F411").is_some() {
"src/stm32f411/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F412").is_some() {
"src/stm32f412/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F413").is_some() {
"src/stm32f413/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F427").is_some() {
"src/stm32f427/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F429").is_some() {
"src/stm32f429/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F446").is_some() {
"src/stm32f446/device.x"
} else if env::var_os("CARGO_FEATURE_STM32F469").is_some() {
"src/stm32f469/device.x"
} else { panic!("No device features selected"); };
fs::copy(device_file, out.join("device.x")).unwrap();
println!("cargo:rerun-if-changed={}", device_file);
}
println!("cargo:rerun-if-changed=build.rs");
}
4 changes: 4 additions & 0 deletions collector/benchmarks/stm32f4-0.14.0/perf-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"cargo_opts": "--features=stm32f405",
"category": "primary"
}
Loading