From ae239a242f729bb55a1cbc482afaca90540ea671 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 10 May 2024 11:46:16 +0300 Subject: [PATCH 01/77] implement Debug for Field/BitReader --- CHANGELOG.md | 2 ++ src/generate/generic.rs | 14 +++++++++++++- src/generate/register.rs | 6 ++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54a911bf..ca83e615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Yet more clean field `Debug` + ## [v0.33.2] - 2024-05-07 - Remove unneeded `format_args` in register `Debug` impl diff --git a/src/generate/generic.rs b/src/generate/generic.rs index d1b0ca0c..df2913a4 100644 --- a/src/generate/generic.rs +++ b/src/generate/generic.rs @@ -53,7 +53,7 @@ pub trait RegisterSpec { /// Raw field type pub trait FieldSpec: Sized { /// Raw field type (`u8`, `u16`, `u32`, ...). - type Ux: Copy + PartialEq + From; + type Ux: Copy + core::fmt::Debug + PartialEq + From; } /// Marker for fields with fixed values @@ -433,6 +433,12 @@ impl FieldReader { } } +impl core::fmt::Debug for FieldReader { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::Debug::fmt(&self.bits, f) + } +} + impl PartialEq for FieldReader where FI: FieldSpec + Copy, @@ -472,6 +478,12 @@ impl BitReader { } } +impl core::fmt::Debug for BitReader { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::Debug::fmt(&self.bits, f) + } +} + /// Marker for register/field writers which can take any value of specified width pub struct Safe; /// You should check that value is allowed to pass to register/field writer marked with this diff --git a/src/generate/register.rs b/src/generate/register.rs index b40d8a60..9ff29340 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -467,8 +467,6 @@ fn render_register_mod_debug( Some(a) => a, None => access, }; - let bit_or_bits = if f.bit_width() > 1 { "bits" } else { "bit" }; - let bit_or_bits = syn::Ident::new(bit_or_bits, span); log::debug!("register={} field={}", name, f.name); if field_access.can_read() && f.read_action.is_none() { if let Field::Array(_, de) = &f { @@ -476,7 +474,7 @@ fn render_register_mod_debug( let f_name_n = field_accessor(&f.name.expand_dim(&suffix), config, span); let f_name_n_s = format!("{f_name_n}"); r_debug_impl.extend(quote! { - .field(#f_name_n_s, &self.#f_name_n().#bit_or_bits()) + .field(#f_name_n_s, &self.#f_name_n()) }); } } else { @@ -484,7 +482,7 @@ fn render_register_mod_debug( let f_name = field_accessor(&f_name, config, span); let f_name_s = format!("{f_name}"); r_debug_impl.extend(quote! { - .field(#f_name_s, &self.#f_name().#bit_or_bits()) + .field(#f_name_s, &self.#f_name()) }); } } From 05bc3536f20e1351620f175514a11c8ffd2e6c2b Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 10 May 2024 12:50:33 +0300 Subject: [PATCH 02/77] generic register Debug --- CHANGELOG.md | 2 +- src/generate/generic.rs | 9 +++++++++ src/generate/register.rs | 14 -------------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca83e615..abf6b827 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] -- Yet more clean field `Debug` +- Yet more clean field & register `Debug` ## [v0.33.2] - 2024-05-07 diff --git a/src/generate/generic.rs b/src/generate/generic.rs index df2913a4..6921b5ab 100644 --- a/src/generate/generic.rs +++ b/src/generate/generic.rs @@ -258,6 +258,15 @@ impl Reg { } } +impl core::fmt::Debug for crate::generic::Reg +where + R: core::fmt::Debug +{ + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::Debug::fmt(&self.read(), f) + } +} + #[doc(hidden)] pub mod raw { use super::{marker, BitM, FieldSpec, RegisterSpec, Unsafe, Writable}; diff --git a/src/generate/register.rs b/src/generate/register.rs index 9ff29340..20f749a3 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -331,12 +331,6 @@ pub fn render_register_mod( write!(f, "{}", self.bits()) } } - #debug_feature - impl core::fmt::Debug for crate::generic::Reg<#regspec_ty> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - core::fmt::Debug::fmt(&self.read(), f) - } - } }); } @@ -492,14 +486,6 @@ fn render_register_mod_debug( #close #close }); - r_debug_impl.extend(quote! { - #debug_feature - impl core::fmt::Debug for crate::generic::Reg<#regspec_ty> { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - core::fmt::Debug::fmt(&self.read(), f) - } - } - }); } else if !access.can_read() || register.read_action.is_some() { r_debug_impl.extend(quote! { #debug_feature From b807632f6ece3646c77a4956a004e26a436f1c83 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 10 May 2024 17:13:11 +0300 Subject: [PATCH 03/77] release 0.33.3 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abf6b827..98a8f44f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [v0.33.3] - 2024-05-10 + - Yet more clean field & register `Debug` ## [v0.33.2] - 2024-05-07 @@ -889,7 +891,8 @@ peripheral.register.write(|w| w.field().set()); - Initial version of the `svd2rust` tool -[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.2...HEAD +[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...HEAD +[v0.33.3]: https://github.com/rust-embedded/svd2rust/compare/v0.33.2...v0.33.3 [v0.33.2]: https://github.com/rust-embedded/svd2rust/compare/v0.33.1...v0.33.2 [v0.33.1]: https://github.com/rust-embedded/svd2rust/compare/v0.33.0...v0.33.1 [v0.33.0]: https://github.com/rust-embedded/svd2rust/compare/v0.32.0...v0.33.0 diff --git a/Cargo.lock b/Cargo.lock index 7ae4fb73..ddd7927c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1220,7 +1220,7 @@ dependencies = [ [[package]] name = "svd2rust" -version = "0.33.2" +version = "0.33.3" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 500a61c1..38fb5b1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ license = "MIT OR Apache-2.0" name = "svd2rust" repository = "https://github.com/rust-embedded/svd2rust/" -version = "0.33.2" +version = "0.33.3" readme = "README.md" rust-version = "1.74" From 1a1204c10fe87aa038f3044f266f97a34ccc4991 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 17 May 2024 19:30:01 +0300 Subject: [PATCH 04/77] refactor-accessors --- src/generate/peripheral.rs | 118 ++++++------ src/generate/peripheral/accessor.rs | 273 ++++++++++------------------ 2 files changed, 149 insertions(+), 242 deletions(-) diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 382b3436..f7ea1520 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -294,7 +294,7 @@ struct RegisterBlockField { syn_field: syn::Field, offset: u32, size: u32, - accessors: Vec, + accessors: Vec, } #[derive(Clone, Debug)] @@ -1003,17 +1003,18 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result { @@ -1059,28 +1060,18 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result::with_capacity((array_info.dim + 1) as _); - accessors.push(if array_convertible { - ArrayAccessor { - doc, - name: accessor_name.clone(), - ty: ty.clone(), - offset: unsuffixed(info.address_offset), - dim: unsuffixed(array_info.dim), - increment: unsuffixed(array_info.dim_increment), - } - .into() - } else { - RawArrayAccessor { + let mut accessors = Vec::with_capacity((array_info.dim + 1) as _); + accessors.push( + Accessor::Array(ArrayAccessor { doc, name: accessor_name.clone(), ty: ty.clone(), offset: unsuffixed(info.address_offset), dim: unsuffixed(array_info.dim), increment: unsuffixed(array_info.dim_increment), - } - .into() - }); + }) + .raw_if(!array_convertible), + ); if !sequential_indexes_from0 || !ends_with_index { for (i, ci) in svd::cluster::expand(info, array_info).enumerate() { let idx_name = ident(&ci.name, config, "cluster_accessor", span); @@ -1091,14 +1082,14 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result Result { @@ -1250,28 +1243,18 @@ fn expand_register( info.address_offset, &description, ); - let mut accessors = Vec::::with_capacity((array_info.dim + 1) as _); - accessors.push(if array_convertible { - ArrayAccessor { - doc, - name: accessor_name.clone(), - ty: ty.clone(), - offset: unsuffixed(info.address_offset), - dim: unsuffixed(array_info.dim), - increment: unsuffixed(array_info.dim_increment), - } - .into() - } else { - RawArrayAccessor { + let mut accessors = Vec::with_capacity((array_info.dim + 1) as _); + accessors.push( + Accessor::Array(ArrayAccessor { doc, name: accessor_name.clone(), ty: ty.clone(), offset: unsuffixed(info.address_offset), dim: unsuffixed(array_info.dim), increment: unsuffixed(array_info.dim_increment), - } - .into() - }); + }) + .raw_if(!array_convertible), + ); if !sequential_indexes_from0 || !ends_with_index { for (i, ri) in svd::register::expand(info, array_info).enumerate() { let idx_name = ident( @@ -1287,14 +1270,14 @@ fn expand_register( ); let i = unsuffixed(i as u64); accessors.push( - ArrayElemAccessor { + Accessor::ArrayElem(ArrayElemAccessor { doc, name: idx_name, ty: ty.clone(), basename: accessor_name.clone(), i, - } - .into(), + }) + .raw_if(false), ); } }; @@ -1324,17 +1307,18 @@ fn expand_register( let name = ident(&ri.name, config, "register_accessor", span); let syn_field = new_syn_field(name.clone(), ty.clone()); + let accessor = Accessor::Reg(RegAccessor { + doc, + name, + ty: ty.clone(), + offset: unsuffixed(info.address_offset), + }) + .raw_if(false); register_expanded.push(RegisterBlockField { syn_field, offset: ri.address_offset, size: register_size, - accessors: vec![RegAccessor { - doc, - name, - ty: ty.clone(), - offset: unsuffixed(info.address_offset), - } - .into()], + accessors: vec![accessor], }); } } diff --git a/src/generate/peripheral/accessor.rs b/src/generate/peripheral/accessor.rs index d074117b..d30576c0 100644 --- a/src/generate/peripheral/accessor.rs +++ b/src/generate/peripheral/accessor.rs @@ -4,121 +4,118 @@ use quote::{quote, ToTokens}; #[derive(Clone, Debug)] pub enum Accessor { Reg(RegAccessor), - RawReg(RawRegAccessor), Array(ArrayAccessor), - RawArray(RawArrayAccessor), ArrayElem(ArrayElemAccessor), } +#[derive(Clone, Debug)] +pub enum AccessType { + Ref(Accessor), + RawRef(Accessor), +} + impl Accessor { - pub fn raw(self) -> Self { - match self { - Self::RawReg(_) | Self::RawArray(_) | Self::ArrayElem(_) => self, - Self::Reg(a) => RawRegAccessor { - doc: a.doc, - name: a.name, - ty: a.ty, - offset: a.offset, - } - .into(), - Self::Array(a) => RawArrayAccessor { - doc: a.doc, - name: a.name, - ty: a.ty, - offset: a.offset, - dim: a.dim, - increment: a.increment, - } - .into(), + pub fn raw_if(self, flag: bool) -> AccessType { + if flag { + AccessType::RawRef(self) + } else { + AccessType::Ref(self) } } } -impl ToTokens for Accessor { - fn to_tokens(&self, tokens: &mut TokenStream) { +impl AccessType { + pub fn raw(self) -> Self { match self { - Self::Reg(a) => a.to_tokens(tokens), - Self::RawReg(a) => a.to_tokens(tokens), - Self::Array(a) => a.to_tokens(tokens), - Self::RawArray(a) => a.to_tokens(tokens), - Self::ArrayElem(a) => a.to_tokens(tokens), + Self::RawRef(_) => self, + Self::Ref(a) => Self::RawRef(a), } } } -impl From for Accessor { - fn from(value: RegAccessor) -> Self { - Self::Reg(value) - } -} - -impl From for Accessor { - fn from(value: RawRegAccessor) -> Self { - Self::RawReg(value) - } -} - -impl From for Accessor { - fn from(value: ArrayAccessor) -> Self { - Self::Array(value) - } -} - -impl From for Accessor { - fn from(value: RawArrayAccessor) -> Self { - Self::RawArray(value) - } -} - -impl From for Accessor { - fn from(value: ArrayElemAccessor) -> Self { - Self::ArrayElem(value) - } -} - -#[derive(Clone, Debug)] -pub struct RegAccessor { - pub doc: String, - pub name: Ident, - pub ty: syn::Type, - pub offset: syn::LitInt, -} - -impl ToTokens for RegAccessor { +impl ToTokens for AccessType { fn to_tokens(&self, tokens: &mut TokenStream) { - let Self { doc, name, ty, .. } = self; - quote! { - #[doc = #doc] - #[inline(always)] - pub const fn #name(&self) -> &#ty { - &self.#name + match self { + Self::Ref(Accessor::Reg(RegAccessor { doc, name, ty, .. })) => { + quote! { + #[doc = #doc] + #[inline(always)] + pub const fn #name(&self) -> &#ty { + &self.#name + } + } } - } - .to_tokens(tokens); - } -} - -#[derive(Clone, Debug)] -pub struct RawRegAccessor { - pub doc: String, - pub name: Ident, - pub ty: syn::Type, - pub offset: syn::LitInt, -} - -impl ToTokens for RawRegAccessor { - fn to_tokens(&self, tokens: &mut TokenStream) { - let Self { - doc, - name, - ty, - offset, - } = self; - quote! { - #[doc = #doc] - #[inline(always)] - pub const fn #name(&self) -> &#ty { - unsafe { &*(self as *const Self).cast::().add(#offset).cast() } + Self::RawRef(Accessor::Reg(RegAccessor { + doc, + name, + ty, + offset, + })) => { + quote! { + #[doc = #doc] + #[inline(always)] + pub const fn #name(&self) -> &#ty { + unsafe { &*(self as *const Self).cast::().add(#offset).cast() } + } + } + } + Self::Ref(Accessor::Array(ArrayAccessor { doc, name, ty, .. })) => { + let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site()); + quote! { + #[doc = #doc] + #[inline(always)] + pub const fn #name(&self, n: usize) -> &#ty { + &self.#name[n] + } + #[doc = "Iterator for array of:"] + #[doc = #doc] + #[inline(always)] + pub fn #name_iter(&self) -> impl Iterator { + self.#name.iter() + } + } + } + Self::RawRef(Accessor::Array(ArrayAccessor { + doc, + name, + ty, + offset, + dim, + increment, + })) => { + let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site()); + let cast = quote! { unsafe { &*(self as *const Self).cast::().add(#offset).add(#increment * n).cast() } }; + quote! { + #[doc = #doc] + #[inline(always)] + pub const fn #name(&self, n: usize) -> &#ty { + #[allow(clippy::no_effect)] + [(); #dim][n]; + #cast + } + #[doc = "Iterator for array of:"] + #[doc = #doc] + #[inline(always)] + pub fn #name_iter(&self) -> impl Iterator { + (0..#dim).map(move |n| #cast) + } + } + } + Self::RawRef(Accessor::ArrayElem(elem)) | Self::Ref(Accessor::ArrayElem(elem)) => { + let ArrayElemAccessor { + doc, + name, + ty, + basename, + i, + } = elem; + quote! { + #[doc = #doc] + #[inline(always)] + pub const fn #name(&self) -> &#ty { + self.#basename(#i) + } + } } } .to_tokens(tokens); @@ -126,38 +123,15 @@ impl ToTokens for RawRegAccessor { } #[derive(Clone, Debug)] -pub struct ArrayAccessor { +pub struct RegAccessor { pub doc: String, pub name: Ident, pub ty: syn::Type, pub offset: syn::LitInt, - pub dim: syn::LitInt, - pub increment: syn::LitInt, -} - -impl ToTokens for ArrayAccessor { - fn to_tokens(&self, tokens: &mut TokenStream) { - let Self { doc, name, ty, .. } = self; - let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site()); - quote! { - #[doc = #doc] - #[inline(always)] - pub const fn #name(&self, n: usize) -> &#ty { - &self.#name[n] - } - #[doc = "Iterator for array of:"] - #[doc = #doc] - #[inline(always)] - pub fn #name_iter(&self) -> impl Iterator { - self.#name.iter() - } - } - .to_tokens(tokens); - } } #[derive(Clone, Debug)] -pub struct RawArrayAccessor { +pub struct ArrayAccessor { pub doc: String, pub name: Ident, pub ty: syn::Type, @@ -166,37 +140,6 @@ pub struct RawArrayAccessor { pub increment: syn::LitInt, } -impl ToTokens for RawArrayAccessor { - fn to_tokens(&self, tokens: &mut TokenStream) { - let Self { - doc, - name, - ty, - offset, - dim, - increment, - } = self; - let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site()); - let cast = quote! { unsafe { &*(self as *const Self).cast::().add(#offset).add(#increment * n).cast() } }; - quote! { - #[doc = #doc] - #[inline(always)] - pub const fn #name(&self, n: usize) -> &#ty { - #[allow(clippy::no_effect)] - [(); #dim][n]; - #cast - } - #[doc = "Iterator for array of:"] - #[doc = #doc] - #[inline(always)] - pub fn #name_iter(&self) -> impl Iterator { - (0..#dim).map(move |n| #cast) - } - } - .to_tokens(tokens); - } -} - #[derive(Clone, Debug)] pub struct ArrayElemAccessor { pub doc: String, @@ -205,23 +148,3 @@ pub struct ArrayElemAccessor { pub basename: Ident, pub i: syn::LitInt, } - -impl ToTokens for ArrayElemAccessor { - fn to_tokens(&self, tokens: &mut TokenStream) { - let Self { - doc, - name, - ty, - basename, - i, - } = &self; - quote! { - #[doc = #doc] - #[inline(always)] - pub const fn #name(&self) -> &#ty { - self.#basename(#i) - } - } - .to_tokens(tokens); - } -} From 62bb3be033ade3b16f0072fe9bcfa3d72dfc3b47 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 18 May 2024 10:20:54 +0300 Subject: [PATCH 05/77] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98a8f44f..878d2f1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Refactor `Accessor` + ## [v0.33.3] - 2024-05-10 - Yet more clean field & register `Debug` From 90ea9f1fb05ca54d16d673b7199e4c39c9f294ac Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Wed, 29 May 2024 21:24:26 +0300 Subject: [PATCH 06/77] little cleanups --- src/generate/register.rs | 40 ++++++++++++++++++---------------------- src/util.rs | 20 +++++--------------- 2 files changed, 23 insertions(+), 37 deletions(-) diff --git a/src/generate/register.rs b/src/generate/register.rs index 20f749a3..b547139c 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -119,11 +119,9 @@ pub fn render( register.read_action, )? ); - if mod_ty != "cfg" { - alias_doc += - format!("\n\nFor information about available fields see [`mod@{mod_ty}`] module") - .as_str(); - } + alias_doc += + format!("\n\nFor information about available fields see [`mod@{mod_ty}`] module") + .as_str(); let mut out = TokenStream::new(); out.extend(quote! { #[doc = #alias_doc] @@ -158,7 +156,7 @@ fn api_docs( read_action: Option, ) -> Result { fn method(s: &str) -> String { - format!("[`{s}`](crate::generic::Reg::{s})") + format!("[`{s}`](crate::Reg::{s})") } let mut doc = String::new(); @@ -166,13 +164,13 @@ fn api_docs( if can_read { write!( doc, - "You can {} this register and get [`{module}::R`]{}. ", + "You can {} this register and get [`{module}::R`]{}.", method("read"), if inmodule { "(R)" } else { "" }, )?; if let Some(action) = read_action { - doc.push_str("WARN: "); + doc.push_str(" WARN: "); doc.push_str(match action { ReadAction::Clear => "The register is **cleared** (set to zero) following a read operation.", ReadAction::Set => "The register is **set** (set to ones) following a read operation.", @@ -203,7 +201,7 @@ fn api_docs( } if can_read && can_write { - write!(doc, "You can also {} this register. ", method("modify"),)?; + write!(doc, "You can also {} this register. ", method("modify"))?; } doc.push_str("See [API](https://docs.rs/svd2rust/#read--modify--write-api)."); @@ -220,12 +218,13 @@ pub fn render_register_mod( ) -> Result { let properties = ®ister.properties; let name = util::name_of(register, config.ignore_groups); + let rname = ®ister.name; let span = Span::call_site(); let regspec_ty = regspec(&name, config, span); let mod_ty = ident(&name, config, "register_mod", span); let rsize = properties .size - .ok_or_else(|| anyhow!("Register {} has no `size` field", register.name))?; + .ok_or_else(|| anyhow!("Register {rname} has no `size` field"))?; let rsize = if rsize < 8 { 8 } else if rsize.is_power_of_two() { @@ -236,7 +235,7 @@ pub fn render_register_mod( let rty = rsize.to_ty()?; let description = util::escape_special_chars( util::respace(®ister.description.clone().unwrap_or_else(|| { - warn!("Missing description for register {}", register.name); + warn!("Missing description for register {rname}"); Default::default() })) .as_ref(), @@ -249,7 +248,7 @@ pub fn render_register_mod( let can_reset = properties.reset_value.is_some(); if can_read { - let desc = format!("Register `{}` reader", register.name); + let desc = format!("Register `{rname}` reader"); mod_items.extend(quote! { #[doc = #desc] pub type R = crate::R<#regspec_ty>; @@ -257,7 +256,7 @@ pub fn render_register_mod( } if can_write { - let desc = format!("Register `{}` writer", register.name); + let desc = format!("Register `{rname}` writer"); mod_items.extend(quote! { #[doc = #desc] pub type W = crate::W<#regspec_ty>; @@ -663,15 +662,11 @@ pub fn fields( let rv = properties.reset_value.map(|rv| (rv >> offset) & mask); let fty = width.to_ty()?; - let use_mask; - let use_cast; - if let Some(size) = properties.size { + let (use_cast, use_mask) = if let Some(size) = properties.size { let size = size.to_ty_width()?; - use_cast = size != width.to_ty_width()?; - use_mask = size != width; + (size != width.to_ty_width()?, size != width) } else { - use_cast = true; - use_mask = true; + (true, true) }; let mut lookup_results = Vec::new(); @@ -724,7 +719,8 @@ pub fn fields( let brief_suffix = if let Field::Array(_, de) = &f { if let Some(range) = de.indexes_as_range() { - format!("({}-{})", *range.start(), *range.end()) + let (start, end) = range.into_inner(); + format!("({start}-{end})") } else { let suffixes: Vec<_> = de.indexes().collect(); format!("({})", suffixes.join(",")) @@ -1420,7 +1416,7 @@ impl Variant { .ok_or_else(|| anyhow!("EnumeratedValue {} has no `` entry", ev.name))?; Self::from_value(value, ev, config) }) - .collect::>>() + .collect() } fn from_value(value: u64, ev: &EnumeratedValue, config: &Config) -> Result { let span = Span::call_site(); diff --git a/src/util.rs b/src/util.rs index 4910e6a7..6f72a30b 100644 --- a/src/util.rs +++ b/src/util.rs @@ -356,12 +356,7 @@ impl U32Ext for u32 { 16 => "u16", 32 => "u32", 64 => "u64", - _ => { - return Err(anyhow!( - "can't convert {} bits into register size type", - *self - )) - } + _ => return Err(anyhow!("can't convert {self} bits into register size type")), }) } fn to_ty(&self) -> Result { @@ -374,8 +369,7 @@ impl U32Ext for u32 { 33..=64 => "u64", _ => { return Err(anyhow!( - "can't convert {} bits into a Rust integral type", - *self + "can't convert {self} bits into a Rust integral type" )) } }, @@ -392,8 +386,7 @@ impl U32Ext for u32 { 33..=64 => 64, _ => { return Err(anyhow!( - "can't convert {} bits into a Rust integral type width", - *self + "can't convert {self} bits into a Rust integral type width" )) } }) @@ -437,11 +430,8 @@ pub trait DimSuffix { impl DimSuffix for str { fn expand_dim(&self, suffix: &str) -> Cow { if self.contains("%s") { - if self.contains("[%s]") { - self.replace("[%s]", suffix).into() - } else { - self.replace("%s", suffix).into() - } + self.replace(if self.contains("[%s]") { "[%s]" } else { "%s" }, suffix) + .into() } else { self.into() } From e7ee5235cdab849214e060c3822415ae8ca25231 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 2 Jun 2024 06:54:27 +0300 Subject: [PATCH 07/77] readAction warning --- CHANGELOG.md | 1 + src/generate/register.rs | 69 ++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 878d2f1f..f365da9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Use `warning` class in docs - Refactor `Accessor` ## [v0.33.3] - 2024-05-10 diff --git a/src/generate/register.rs b/src/generate/register.rs index b547139c..1c1c6512 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -109,15 +109,15 @@ pub fn render( }; let mut alias_doc = format!( - "{name} ({accs}) register accessor: {description}\n\n{}", + "{name} ({accs}) register accessor: {description}{}{}", api_docs( access.can_read(), access.can_write(), register.properties.reset_value.is_some(), &mod_ty, false, - register.read_action, - )? + )?, + read_action_docs(access.can_read(), register.read_action), ); alias_doc += format!("\n\nFor information about available fields see [`mod@{mod_ty}`] module") @@ -147,38 +147,43 @@ pub fn render( } } +fn read_action_docs(can_read: bool, read_action: Option) -> String { + let mut doc = String::new(); + if can_read { + if let Some(action) = read_action { + doc.push_str("\n\n
"); + doc.push_str(match action { + ReadAction::Clear => "The register is cleared (set to zero) following a read operation.", + ReadAction::Set => "The register is set (set to ones) following a read operation.", + ReadAction::Modify => "The register is modified in some way after a read operation.", + ReadAction::ModifyExternal => "One or more dependent resources other than the current register are immediately affected by a read operation.", + }); + doc.push_str("
"); + } + } + doc +} + fn api_docs( can_read: bool, can_write: bool, can_reset: bool, module: &Ident, inmodule: bool, - read_action: Option, ) -> Result { fn method(s: &str) -> String { format!("[`{s}`](crate::Reg::{s})") } - let mut doc = String::new(); + let mut doc = String::from("\n\n"); if can_read { write!( doc, - "You can {} this register and get [`{module}::R`]{}.", + "You can {} this register and get [`{module}::R`]{}. ", method("read"), if inmodule { "(R)" } else { "" }, )?; - - if let Some(action) = read_action { - doc.push_str(" WARN: "); - doc.push_str(match action { - ReadAction::Clear => "The register is **cleared** (set to zero) following a read operation.", - ReadAction::Set => "The register is **set** (set to ones) following a read operation.", - ReadAction::Modify => "The register is **modified** in some way after a read operation.", - ReadAction::ModifyExternal => "One or more dependent resources other than the current register are immediately affected by a read operation.", - }); - } - doc.push(' '); } if can_write { @@ -355,15 +360,9 @@ pub fn render_register_mod( } let doc = format!( - "{description}\n\n{}", - api_docs( - can_read, - can_write, - can_reset, - &mod_ty, - true, - register.read_action, - )? + "{description}{}{}", + api_docs(can_read, can_write, can_reset, &mod_ty, true)?, + read_action_docs(access.can_read(), register.read_action), ); mod_items.extend(quote! { @@ -951,12 +950,14 @@ pub fn fields( }; let mut readerdoc = field_reader_brief.clone(); if let Some(action) = f.read_action { - readerdoc += match action { - ReadAction::Clear => "\n\nThe field is **cleared** (set to zero) following a read operation.", - ReadAction::Set => "\n\nThe field is **set** (set to ones) following a read operation.", - ReadAction::Modify => "\n\nThe field is **modified** in some way after a read operation.", - ReadAction::ModifyExternal => "\n\nOne or more dependent resources other than the current field are immediately affected by a read operation.", - }; + readerdoc.push_str("\n\n
"); + readerdoc.push_str(match action { + ReadAction::Clear => "The field is cleared (set to zero) following a read operation.", + ReadAction::Set => "The field is set (set to ones) following a read operation.", + ReadAction::Modify => "The field is modified in some way after a read operation.", + ReadAction::ModifyExternal => "One or more dependent resources other than the current field are immediately affected by a read operation.", + }); + readerdoc.push_str("
"); } mod_items.extend(quote! { #[doc = #readerdoc] @@ -992,7 +993,7 @@ pub fn fields( let increment = de.dim_increment; let doc = description.expand_dim(&brief_suffix); let first_name = svd::array::names(f, de).next().unwrap(); - let note = format!("NOTE: `n` is number of field in register. `n == 0` corresponds to `{first_name}` field"); + let note = format!("
`n` is number of field in register. `n == 0` corresponds to `{first_name}` field.
"); let offset_calc = calculate_offset(increment, offset, true); let value = quote! { ((self.bits >> #offset_calc) & #hexmask) #cast }; let dim = unsuffixed(de.dim); @@ -1279,7 +1280,7 @@ pub fn fields( let offset_calc = calculate_offset(increment, offset, false); let doc = &description.expand_dim(&brief_suffix); let first_name = svd::array::names(f, de).next().unwrap(); - let note = format!("NOTE: `n` is number of field in register. `n == 0` corresponds to `{first_name}` field"); + let note = format!("
`n` is number of field in register. `n == 0` corresponds to `{first_name}` field.
"); let dim = unsuffixed(de.dim); w_impl_items.extend(quote! { #[doc = #doc] From 57e8adfd7f4162874f0a15a806e6691d14e29b35 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Mon, 3 Jun 2024 22:04:57 +0300 Subject: [PATCH 08/77] Move Reg in separate file --- CHANGELOG.md | 1 + src/generate/device.rs | 11 +- src/generate/generic.rs | 172 ------------------------------ src/generate/generic_reg_vcell.rs | 171 +++++++++++++++++++++++++++++ 4 files changed, 177 insertions(+), 178 deletions(-) create mode 100644 src/generate/generic_reg_vcell.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index f365da9d..503ac041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Move `Reg` in separate file - Use `warning` class in docs - Refactor `Accessor` diff --git a/src/generate/device.rs b/src/generate/device.rs index 25d6bdd2..dd601ada 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -140,6 +140,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Result Result Result { for p_name in names(p, dim_element) { @@ -263,9 +264,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { - register: vcell::VolatileCell, - _marker: marker::PhantomData, -} - -unsafe impl Send for Reg where REG::Ux: Send {} - -impl Reg { - /// Returns the underlying memory address of register. - /// - /// ```ignore - /// let reg_ptr = periph.reg.as_ptr(); - /// ``` - #[inline(always)] - pub fn as_ptr(&self) -> *mut REG::Ux { - self.register.as_ptr() - } -} - -impl Reg { - /// Reads the contents of a `Readable` register. - /// - /// You can read the raw contents of a register by using `bits`: - /// ```ignore - /// let bits = periph.reg.read().bits(); - /// ``` - /// or get the content of a particular field of a register: - /// ```ignore - /// let reader = periph.reg.read(); - /// let bits = reader.field1().bits(); - /// let flag = reader.field2().bit_is_set(); - /// ``` - #[inline(always)] - pub fn read(&self) -> R { - R { - bits: self.register.get(), - _reg: marker::PhantomData, - } - } -} - -impl Reg { - /// Writes the reset value to `Writable` register. - /// - /// Resets the register to its initial state. - #[inline(always)] - pub fn reset(&self) { - self.register.set(REG::RESET_VALUE) - } - - /// Writes bits to a `Writable` register. - /// - /// You can write raw bits into a register: - /// ```ignore - /// periph.reg.write(|w| unsafe { w.bits(rawbits) }); - /// ``` - /// or write only the fields you need: - /// ```ignore - /// periph.reg.write(|w| w - /// .field1().bits(newfield1bits) - /// .field2().set_bit() - /// .field3().variant(VARIANT) - /// ); - /// ``` - /// or an alternative way of saying the same: - /// ```ignore - /// periph.reg.write(|w| { - /// w.field1().bits(newfield1bits); - /// w.field2().set_bit(); - /// w.field3().variant(VARIANT) - /// }); - /// ``` - /// In the latter case, other fields will be set to their reset value. - #[inline(always)] - pub fn write(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - self.register.set( - f(&mut W { - bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP - | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, - _reg: marker::PhantomData, - }) - .bits, - ); - } -} - -impl Reg { - /// Writes 0 to a `Writable` register. - /// - /// Similar to `write`, but unused bits will contain 0. - /// - /// # Safety - /// - /// Unsafe to use with registers which don't allow to write 0. - #[inline(always)] - pub unsafe fn write_with_zero(&self, f: F) - where - F: FnOnce(&mut W) -> &mut W, - { - self.register.set( - f(&mut W { - bits: REG::Ux::default(), - _reg: marker::PhantomData, - }) - .bits, - ); - } -} - -impl Reg { - /// Modifies the contents of the register by reading and then writing it. - /// - /// E.g. to do a read-modify-write sequence to change parts of a register: - /// ```ignore - /// periph.reg.modify(|r, w| unsafe { w.bits( - /// r.bits() | 3 - /// ) }); - /// ``` - /// or - /// ```ignore - /// periph.reg.modify(|_, w| w - /// .field1().bits(newfield1bits) - /// .field2().set_bit() - /// .field3().variant(VARIANT) - /// ); - /// ``` - /// or an alternative way of saying the same: - /// ```ignore - /// periph.reg.modify(|_, w| { - /// w.field1().bits(newfield1bits); - /// w.field2().set_bit(); - /// w.field3().variant(VARIANT) - /// }); - /// ``` - /// Other fields will have the value they had before the call to `modify`. - #[inline(always)] - pub fn modify(&self, f: F) - where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, - { - let bits = self.register.get(); - self.register.set( - f( - &R { - bits, - _reg: marker::PhantomData, - }, - &mut W { - bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP - | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, - _reg: marker::PhantomData, - }, - ) - .bits, - ); - } -} - -impl core::fmt::Debug for crate::generic::Reg -where - R: core::fmt::Debug -{ - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - core::fmt::Debug::fmt(&self.read(), f) - } -} - #[doc(hidden)] pub mod raw { use super::{marker, BitM, FieldSpec, RegisterSpec, Unsafe, Writable}; diff --git a/src/generate/generic_reg_vcell.rs b/src/generate/generic_reg_vcell.rs new file mode 100644 index 00000000..5081ae20 --- /dev/null +++ b/src/generate/generic_reg_vcell.rs @@ -0,0 +1,171 @@ +/// This structure provides volatile access to registers. +#[repr(transparent)] +pub struct Reg { + register: vcell::VolatileCell, + _marker: marker::PhantomData, +} + +unsafe impl Send for Reg where REG::Ux: Send {} + +impl Reg { + /// Returns the underlying memory address of register. + /// + /// ```ignore + /// let reg_ptr = periph.reg.as_ptr(); + /// ``` + #[inline(always)] + pub fn as_ptr(&self) -> *mut REG::Ux { + self.register.as_ptr() + } +} + +impl Reg { + /// Reads the contents of a `Readable` register. + /// + /// You can read the raw contents of a register by using `bits`: + /// ```ignore + /// let bits = periph.reg.read().bits(); + /// ``` + /// or get the content of a particular field of a register: + /// ```ignore + /// let reader = periph.reg.read(); + /// let bits = reader.field1().bits(); + /// let flag = reader.field2().bit_is_set(); + /// ``` + #[inline(always)] + pub fn read(&self) -> R { + R { + bits: self.register.get(), + _reg: marker::PhantomData, + } + } +} + +impl Reg { + /// Writes the reset value to `Writable` register. + /// + /// Resets the register to its initial state. + #[inline(always)] + pub fn reset(&self) { + self.register.set(REG::RESET_VALUE) + } + + /// Writes bits to a `Writable` register. + /// + /// You can write raw bits into a register: + /// ```ignore + /// periph.reg.write(|w| unsafe { w.bits(rawbits) }); + /// ``` + /// or write only the fields you need: + /// ```ignore + /// periph.reg.write(|w| w + /// .field1().bits(newfield1bits) + /// .field2().set_bit() + /// .field3().variant(VARIANT) + /// ); + /// ``` + /// or an alternative way of saying the same: + /// ```ignore + /// periph.reg.write(|w| { + /// w.field1().bits(newfield1bits); + /// w.field2().set_bit(); + /// w.field3().variant(VARIANT) + /// }); + /// ``` + /// In the latter case, other fields will be set to their reset value. + #[inline(always)] + pub fn write(&self, f: F) + where + F: FnOnce(&mut W) -> &mut W, + { + self.register.set( + f(&mut W { + bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }) + .bits, + ); + } +} + +impl Reg { + /// Writes 0 to a `Writable` register. + /// + /// Similar to `write`, but unused bits will contain 0. + /// + /// # Safety + /// + /// Unsafe to use with registers which don't allow to write 0. + #[inline(always)] + pub unsafe fn write_with_zero(&self, f: F) + where + F: FnOnce(&mut W) -> &mut W, + { + self.register.set( + f(&mut W { + bits: REG::Ux::default(), + _reg: marker::PhantomData, + }) + .bits, + ); + } +} + +impl Reg { + /// Modifies the contents of the register by reading and then writing it. + /// + /// E.g. to do a read-modify-write sequence to change parts of a register: + /// ```ignore + /// periph.reg.modify(|r, w| unsafe { w.bits( + /// r.bits() | 3 + /// ) }); + /// ``` + /// or + /// ```ignore + /// periph.reg.modify(|_, w| w + /// .field1().bits(newfield1bits) + /// .field2().set_bit() + /// .field3().variant(VARIANT) + /// ); + /// ``` + /// or an alternative way of saying the same: + /// ```ignore + /// periph.reg.modify(|_, w| { + /// w.field1().bits(newfield1bits); + /// w.field2().set_bit(); + /// w.field3().variant(VARIANT) + /// }); + /// ``` + /// Other fields will have the value they had before the call to `modify`. + #[inline(always)] + pub fn modify(&self, f: F) + where + for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, + { + let bits = self.register.get(); + self.register.set( + f( + &R { + bits, + _reg: marker::PhantomData, + }, + &mut W { + bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }, + ) + .bits, + ); + } +} + +impl core::fmt::Debug for crate::generic::Reg +where + R: core::fmt::Debug +{ + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::Debug::fmt(&self.read(), f) + } +} From 4a1847c6f474cb0944263b23a91412f4d5b329ef Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 9 Jun 2024 17:09:44 +0300 Subject: [PATCH 09/77] peripheral to tokens closure --- src/generate/peripheral.rs | 144 +++++++++++++++++-------------------- 1 file changed, 65 insertions(+), 79 deletions(-) diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index f7ea1520..23bf309e 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -5,6 +5,7 @@ use std::fmt; use svd_parser::expand::{ derive_cluster, derive_peripheral, derive_register, BlockPath, Index, RegisterPath, }; +use syn::LitInt; use crate::config::Config; use crate::svd::{ @@ -80,6 +81,54 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result } }; + let per_to_tokens = |out: &mut TokenStream, + feature_attribute: &TokenStream, + description: &str, + p_ty: &Ident, + doc_alias: Option, + address: LitInt| { + out.extend(quote! { + #[doc = #description] + #doc_alias + #feature_attribute + pub struct #p_ty { _marker: PhantomData<*const ()> } + + #feature_attribute + unsafe impl Send for #p_ty {} + + #feature_attribute + impl #p_ty { + ///Pointer to the register block + pub const PTR: *const #base::RegisterBlock = #address as *const _; + + ///Return the pointer to the register block + #[inline(always)] + pub const fn ptr() -> *const #base::RegisterBlock { + Self::PTR + } + + #steal_fn + } + + #feature_attribute + impl Deref for #p_ty { + type Target = #base::RegisterBlock; + + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } + } + + #feature_attribute + impl core::fmt::Debug for #p_ty { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct(#name_str).finish() + } + } + }); + }; + match &p { Peripheral::Array(p, dim) => { let mut feature_names = Vec::with_capacity(dim.dim as _); @@ -97,46 +146,14 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result feature_attribute_n.extend(quote! { #[cfg(feature = #p_feature)] }) }; // Insert the peripherals structure - out.extend(quote! { - #[doc = #description] - #doc_alias - #feature_attribute_n - pub struct #p_ty { _marker: PhantomData<*const ()> } - - #feature_attribute_n - unsafe impl Send for #p_ty {} - - #feature_attribute_n - impl #p_ty { - ///Pointer to the register block - pub const PTR: *const #base::RegisterBlock = #address as *const _; - - ///Return the pointer to the register block - #[inline(always)] - pub const fn ptr() -> *const #base::RegisterBlock { - Self::PTR - } - - #steal_fn - } - - #feature_attribute_n - impl Deref for #p_ty { - type Target = #base::RegisterBlock; - - #[inline(always)] - fn deref(&self) -> &Self::Target { - unsafe { &*Self::PTR } - } - } - - #feature_attribute_n - impl core::fmt::Debug for #p_ty { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct(#name_str).finish() - } - } - }); + per_to_tokens( + &mut out, + &feature_attribute_n, + description, + &p_ty, + doc_alias, + address, + ); } let feature_any_attribute = quote! {#[cfg(any(#(feature = #feature_names),*))]}; @@ -159,45 +176,14 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result feature_attribute.extend(quote! { #[cfg(feature = #p_feature)] }) }; // Insert the peripheral structure - out.extend(quote! { - #[doc = #description] - #feature_attribute - pub struct #p_ty { _marker: PhantomData<*const ()> } - - #feature_attribute - unsafe impl Send for #p_ty {} - - #feature_attribute - impl #p_ty { - ///Pointer to the register block - pub const PTR: *const #base::RegisterBlock = #address as *const _; - - ///Return the pointer to the register block - #[inline(always)] - pub const fn ptr() -> *const #base::RegisterBlock { - Self::PTR - } - - #steal_fn - } - - #feature_attribute - impl Deref for #p_ty { - type Target = #base::RegisterBlock; - - #[inline(always)] - fn deref(&self) -> &Self::Target { - unsafe { &*Self::PTR } - } - } - - #feature_attribute - impl core::fmt::Debug for #p_ty { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct(#name_str).finish() - } - } - }); + per_to_tokens( + &mut out, + &feature_attribute, + &description, + &p_ty, + None, + address, + ); // Derived peripherals may not require re-implementation, and will instead // use a single definition of the non-derived version. From 68d69b637ba45072e39e24695e90c05cfbdb3c24 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 9 Jun 2024 19:03:15 +0300 Subject: [PATCH 10/77] html-url --- CHANGELOG.md | 1 + Cargo.lock | 2 ++ Cargo.toml | 1 + src/config.rs | 1 + src/generate/peripheral.rs | 6 ++++++ src/generate/register.rs | 43 +++++++++++++++++++++++++++++--------- src/main.rs | 8 +++++++ 7 files changed, 52 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 503ac041..4c35b266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Add `html-url` option to access `svdtools html` files from docs - Move `Reg` in separate file - Use `warning` class in docs - Refactor `Accessor` diff --git a/Cargo.lock b/Cargo.lock index ddd7927c..109572a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,6 +1239,7 @@ dependencies = [ "svd-rs", "syn 2.0.42", "thiserror", + "url", ] [[package]] @@ -1547,6 +1548,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 38fb5b1b..790bf34e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,6 +57,7 @@ serde_json = { version = "1.0.85", optional = true } serde_yaml = { version = "0.9.11", optional = true } regex = "1.10.0" html-escape = "0.2" +url = { version = "2.5", features = ["serde"] } [dependencies.svd-parser] features = ["expand"] diff --git a/src/config.rs b/src/config.rs index e53a2e33..79522ecd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -35,6 +35,7 @@ pub struct Config { pub ident_formats_theme: Option, pub field_names_for_enums: bool, pub base_address_shift: u64, + pub html_url: Option, } #[allow(clippy::upper_case_acronyms)] diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 23bf309e..27c54bbe 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -81,6 +81,11 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result } }; + let phtml = config.html_url.as_ref().map(|url| { + let doc = format!("See peripheral [structure]({url}#{})", &path.peripheral); + quote!(#[doc = ""] #[doc = #doc]) + }); + let per_to_tokens = |out: &mut TokenStream, feature_attribute: &TokenStream, description: &str, @@ -89,6 +94,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result address: LitInt| { out.extend(quote! { #[doc = #description] + #phtml #doc_alias #feature_attribute pub struct #p_ty { _marker: PhantomData<*const ()> } diff --git a/src/generate/register.rs b/src/generate/register.rs index 1c1c6512..569454cb 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -108,6 +108,7 @@ pub fn render( return Err(anyhow!("Incorrect access of register {}", register.name)); }; + let rpath = path.new_register(®ister.name); let mut alias_doc = format!( "{name} ({accs}) register accessor: {description}{}{}", api_docs( @@ -116,6 +117,9 @@ pub fn render( register.properties.reset_value.is_some(), &mod_ty, false, + ®ister, + &rpath, + config, )?, read_action_docs(access.can_read(), register.read_action), ); @@ -128,13 +132,7 @@ pub fn render( #doc_alias pub type #reg_ty = crate::Reg<#mod_ty::#regspec_ty>; }); - let mod_items = render_register_mod( - register, - access, - &path.new_register(®ister.name), - index, - config, - )?; + let mod_items = render_register_mod(register, access, &rpath, index, config)?; out.extend(quote! { #[doc = #description] @@ -170,6 +168,9 @@ fn api_docs( can_reset: bool, module: &Ident, inmodule: bool, + register: &Register, + rpath: &RegisterPath, + config: &Config, ) -> Result { fn method(s: &str) -> String { format!("[`{s}`](crate::Reg::{s})") @@ -211,13 +212,35 @@ fn api_docs( doc.push_str("See [API](https://docs.rs/svd2rust/#read--modify--write-api)."); + if let Some(url) = config.html_url.as_ref() { + let first_idx = if let Register::Array(_, dim) = ®ister { + dim.indexes().next() + } else { + None + }; + let rname = if let Some(idx) = first_idx { + let idx = format!("[{idx}]"); + rpath.name.replace("[%s]", &idx).replace("%s", &idx) + } else { + rpath.name.to_string() + }; + // TODO: support html_urls for registers in cluster + if rpath.block.path.is_empty() { + doc.push_str(&format!( + "\n\nSee register [structure]({url}#{}:{})", + rpath.peripheral(), + rname + )); + } + } + Ok(doc) } pub fn render_register_mod( register: &Register, access: Access, - path: &RegisterPath, + rpath: &RegisterPath, index: &Index, config: &Config, ) -> Result { @@ -312,7 +335,7 @@ pub fn render_register_mod( access, properties, &mut mod_items, - path, + rpath, index, config, )?; @@ -361,7 +384,7 @@ pub fn render_register_mod( let doc = format!( "{description}{}{}", - api_docs(can_read, can_write, can_reset, &mod_ty, true)?, + api_docs(can_read, can_write, can_reset, &mod_ty, true, register, rpath, config)?, read_action_docs(access.can_read(), register.read_action), ); diff --git a/src/main.rs b/src/main.rs index be54cbb3..aabec8f6 100755 --- a/src/main.rs +++ b/src/main.rs @@ -267,6 +267,14 @@ Allowed cases are `unchanged` (''), `pascal` ('p'), `constant` ('c') and `snake` Useful for soft-cores where the peripheral address range isn't necessarily fixed. Ignore this option if you are not building your own FPGA based soft-cores."), ) + .arg( + Arg::new("html_url") + .long("html-url") + .alias("html_url") + .help("Path to chip HTML generated by svdtools") + .action(ArgAction::Set) + .value_name("URL"), + ) .arg( Arg::new("log_level") .long("log") From f6b6da63014206564c46aa1c8963b0fbc0f973fd Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 16 Jun 2024 07:25:06 +0300 Subject: [PATCH 11/77] release 0.33.4 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 19 ++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c35b266..58e212da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [v0.33.4] - 2024-06-16 + - Add `html-url` option to access `svdtools html` files from docs - Move `Reg` in separate file - Use `warning` class in docs @@ -896,7 +898,8 @@ peripheral.register.write(|w| w.field().set()); - Initial version of the `svd2rust` tool -[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...HEAD +[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.4...HEAD +[v0.33.4]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...v0.33.4 [v0.33.3]: https://github.com/rust-embedded/svd2rust/compare/v0.33.2...v0.33.3 [v0.33.2]: https://github.com/rust-embedded/svd2rust/compare/v0.33.1...v0.33.2 [v0.33.1]: https://github.com/rust-embedded/svd2rust/compare/v0.33.0...v0.33.1 diff --git a/Cargo.lock b/Cargo.lock index 109572a1..91c5d200 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1220,7 +1220,7 @@ dependencies = [ [[package]] name = "svd2rust" -version = "0.33.3" +version = "0.33.4" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 790bf34e..d1cce330 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,17 +13,11 @@ categories = [ ] description = "Generate Rust register maps (`struct`s) from SVD files" documentation = "https://docs.rs/svd2rust" -keywords = [ - "svd", - "embedded", - "register", - "map", - "generator", -] +keywords = ["svd", "embedded", "register", "map", "generator"] license = "MIT OR Apache-2.0" name = "svd2rust" repository = "https://github.com/rust-embedded/svd2rust/" -version = "0.33.3" +version = "0.33.4" readme = "README.md" rust-version = "1.74" @@ -44,7 +38,10 @@ yaml = ["dep:serde_yaml"] [dependencies] clap = { version = "4.0", optional = true } -irx-config = { version = "=3.3.0", features = ["cmd", "toml-parser"], optional = true } +irx-config = { version = "=3.3.0", features = [ + "cmd", + "toml-parser", +], optional = true } env_logger = { version = "0.11", optional = true } inflections = "1.1" log = { version = "~0.4", features = ["std"] } @@ -69,7 +66,7 @@ version = "0.14.8" [dependencies.syn] version = "2.0" -features = ["full","extra-traits"] +features = ["full", "extra-traits"] [workspace] members = ["ci/svd2rust-regress"] @@ -79,5 +76,5 @@ exclude = [ # workaround for https://github.com/rust-lang/cargo/pull/12779, doesn't work for output though # see https://github.com/rust-lang/cargo/issues/6009#issuecomment-1925445245 "output/baseline/**", - "output/current/**" + "output/current/**", ] From f703c0fe219cc635c5ad9eb379c0850b898d9ca5 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Tue, 18 Jun 2024 09:02:06 +0300 Subject: [PATCH 12/77] fix enumeratedValues with isDefault only --- CHANGELOG.md | 2 ++ src/generate/register.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58e212da..4ca2152d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Fix `enumeratedValues` with `isDefault` only + ## [v0.33.4] - 2024-06-16 - Add `html-url` option to access `svdtools html` files from docs diff --git a/src/generate/register.rs b/src/generate/register.rs index 569454cb..37d39d92 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -805,7 +805,7 @@ pub fn fields( // if there's no variant defined in enumeratedValues, generate enumeratedValues with new-type // wrapper struct, and generate From conversation only. // else, generate enumeratedValues into a Rust enum with functions for each variant. - if variants.is_empty() { + if variants.is_empty() && def.is_none() { // generate struct VALUE_READ_TY_A(fty) and From for VALUE_READ_TY_A. add_with_no_variants( mod_items, From 1ef222c05424a57ed3ef480f4027955448b028e2 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Wed, 25 Sep 2024 08:05:24 +0300 Subject: [PATCH 13/77] Fix STM32-patched CI --- CHANGELOG.md | 1 + ci/script.sh | 11 ++++++++++- ci/svd2rust-regress/tests.yml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca2152d..62b03688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Fix STM32-patched CI - Fix `enumeratedValues` with `isDefault` only ## [v0.33.4] - 2024-06-16 diff --git a/ci/script.sh b/ci/script.sh index fcb1199e..9474a753 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -503,7 +503,7 @@ main() { echo '[dependencies.riscv-rt]' >> $td/Cargo.toml echo 'version = "0.8.0"' >> $td/Cargo.toml - test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x.svd + test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x/e310x.svd test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/k210-pac/master/k210.svd test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/fu540-pac/master/fu540.svd ;; @@ -572,6 +572,15 @@ main() { ;; STM32-patched) + echo '[dependencies.critical-section]' >> $td/Cargo.toml + echo 'version = "1.0"' >> $td/Cargo.toml + echo 'optional = true' >> $td/Cargo.toml + + echo '[features]' >> $td/Cargo.toml + echo 'default = ["critical-section", "rt"]' >> $td/Cargo.toml + echo 'rt = ["cortex-m-rt/device"]' >> $td/Cargo.toml + echo 'atomics = []' >> $td/Cargo.toml + # OK test_patched_stm32 stm32f0x2 test_patched_stm32 stm32f103 diff --git a/ci/svd2rust-regress/tests.yml b/ci/svd2rust-regress/tests.yml index a1dadb4a..6ed7ebbe 100644 --- a/ci/svd2rust-regress/tests.yml +++ b/ci/svd2rust-regress/tests.yml @@ -2102,7 +2102,7 @@ - arch: riscv mfgr: SiFive chip: E310x - svd_url: https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x.svd + svd_url: https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x/e310x.svd should_pass: false run_when: never - arch: msp430 From f5bd09f9b29261fd596debd65949e9dae2bc15db Mon Sep 17 00:00:00 2001 From: rmsyn Date: Thu, 10 Oct 2024 01:23:13 +0000 Subject: [PATCH 14/77] generate: use groups for delimited tokens Uses `proc_macro2::Group` for token streams delimited with braces. Resolves: #863 Authored-by: rmsyn Co-authored-by: Jan Niehusmann --- CHANGELOG.md | 1 + src/generate/peripheral.rs | 15 ++++++------- src/generate/register.rs | 45 +++++++++++++++++--------------------- 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62b03688..be3cfad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Fix STM32-patched CI - Fix `enumeratedValues` with `isDefault` only +- Fix invalid `Punct` error from `proc_macro2` ## [v0.33.4] - 2024-06-16 diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 27c54bbe..e58a61ec 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -12,7 +12,7 @@ use crate::svd::{ self, Cluster, ClusterInfo, MaybeArray, Peripheral, Register, RegisterCluster, RegisterInfo, }; use log::{debug, trace, warn}; -use proc_macro2::{Ident, Punct, Spacing, Span, TokenStream}; +use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream}; use quote::{quote, ToTokens}; use syn::{punctuated::Punctuated, Token}; @@ -245,19 +245,18 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result let reg_block = register_or_cluster_block(&ercs, &derive_infos, None, "Register block", None, config)?; - let open = Punct::new('{', Spacing::Alone); - let close = Punct::new('}', Spacing::Alone); - out.extend(quote! { #[doc = #description] #feature_attribute - pub mod #mod_ty #open + pub mod #mod_ty }); - out.extend(reg_block); - out.extend(mod_items); + let mut out_items = TokenStream::new(); + out_items.extend(reg_block); + out_items.extend(mod_items); - close.to_tokens(&mut out); + let out_group = Group::new(Delimiter::Brace, out_items); + out.extend(quote! { #out_group }); p.registers = Some(ercs); diff --git a/src/generate/register.rs b/src/generate/register.rs index 37d39d92..be5fc5b2 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -5,8 +5,8 @@ use crate::svd::{ }; use core::u64; use log::warn; -use proc_macro2::{Ident, Punct, Spacing, Span, TokenStream}; -use quote::{quote, ToTokens}; +use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream}; +use quote::quote; use std::collections::HashSet; use std::fmt::Write; use std::{borrow::Cow, collections::BTreeMap}; @@ -297,9 +297,6 @@ pub fn render_register_mod( let mut zero_to_modify_fields_bitmap = 0; let mut one_to_modify_fields_bitmap = 0; - let open = Punct::new('{', Spacing::Alone); - let close = Punct::new('}', Spacing::Alone); - let debug_feature = config .impl_debug_feature .as_ref() @@ -362,24 +359,16 @@ pub fn render_register_mod( } if can_read && !r_impl_items.is_empty() { - mod_items.extend(quote! { - impl R #open #r_impl_items #close - }); + mod_items.extend(quote! { impl R { #r_impl_items }}); } if !r_debug_impl.is_empty() { - mod_items.extend(quote! { - #r_debug_impl - }); + mod_items.extend(quote! { #r_debug_impl }); } if can_write { mod_items.extend(quote! { - impl W #open + impl W { #w_impl_items } }); - - mod_items.extend(w_impl_items); - - close.to_tokens(&mut mod_items); } let doc = format!( @@ -461,8 +450,6 @@ fn render_register_mod_debug( let name = util::name_of(register, config.ignore_groups); let span = Span::call_site(); let regspec_ty = regspec(&name, config, span); - let open = Punct::new('{', Spacing::Alone); - let close = Punct::new('}', Spacing::Alone); let mut r_debug_impl = TokenStream::new(); let debug_feature = config .impl_debug_feature @@ -473,8 +460,14 @@ fn render_register_mod_debug( if access.can_read() && register.read_action.is_none() { r_debug_impl.extend(quote! { #debug_feature - impl core::fmt::Debug for R #open - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result #open + impl core::fmt::Debug for R + }); + let mut fmt_outer_impl = TokenStream::new(); + fmt_outer_impl.extend(quote! { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result + }); + let mut fmt_inner_impl = TokenStream::new(); + fmt_inner_impl.extend(quote! { f.debug_struct(#name) }); for &f in cur_fields.iter() { @@ -488,7 +481,7 @@ fn render_register_mod_debug( for suffix in de.indexes() { let f_name_n = field_accessor(&f.name.expand_dim(&suffix), config, span); let f_name_n_s = format!("{f_name_n}"); - r_debug_impl.extend(quote! { + fmt_inner_impl.extend(quote! { .field(#f_name_n_s, &self.#f_name_n()) }); } @@ -496,17 +489,19 @@ fn render_register_mod_debug( let f_name = f.name.remove_dim(); let f_name = field_accessor(&f_name, config, span); let f_name_s = format!("{f_name}"); - r_debug_impl.extend(quote! { + fmt_inner_impl.extend(quote! { .field(#f_name_s, &self.#f_name()) }); } } } - r_debug_impl.extend(quote! { + fmt_inner_impl.extend(quote! { .finish() - #close - #close }); + let fmt_inner_group = Group::new(Delimiter::Brace, fmt_inner_impl); + fmt_outer_impl.extend(quote! { #fmt_inner_group }); + let fmt_outer_group = Group::new(Delimiter::Brace, fmt_outer_impl); + r_debug_impl.extend(quote! { #fmt_outer_group }); } else if !access.can_read() || register.read_action.is_some() { r_debug_impl.extend(quote! { #debug_feature From 06c975143760abafb26e132e6c11ce8bf0479359 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Wed, 9 Oct 2024 16:04:39 +0000 Subject: [PATCH 15/77] Run espressif tests on nightly-2024-09-25 Workaround for incompatibility of latest nightly with `asm!` in naked functions. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e9807ac..e63e963a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,8 +89,8 @@ jobs: - { rust: nightly, vendor: MSP430, options: "--atomics" } - { rust: nightly, vendor: MSP430, options: "" } # Workaround for _1token0 - - { rust: nightly, vendor: Espressif, options: "--atomics --ident-formats-theme legacy" } - - { rust: nightly, vendor: Espressif, options: "--ident-format register:::Reg" } + - { rust: nightly-2024-09-25, vendor: Espressif, options: "--atomics --ident-formats-theme legacy" } + - { rust: nightly-2024-09-25, vendor: Espressif, options: "--ident-format register:::Reg" } steps: - uses: actions/checkout@v4 From fc3388018c19ec3ae03f53baaeb39a025da24d7d Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Wed, 9 Oct 2024 16:09:06 +0000 Subject: [PATCH 16/77] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be3cfad2..35fca8c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Fix STM32-patched CI - Fix `enumeratedValues` with `isDefault` only - Fix invalid `Punct` error from `proc_macro2` +- Run espressif tests on nightly-2024-09-25 to workaround CI failures ## [v0.33.4] - 2024-06-16 From 00b701cd3bfe0588d013fe7cf5af24bf762a7917 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 12 Oct 2024 13:34:46 +0300 Subject: [PATCH 17/77] release 0.33.5 --- CHANGELOG.md | 5 ++++- Cargo.lock | 14 +++++++------- Cargo.toml | 6 +++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35fca8c2..8eac3f99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [v0.33.5] - 2024-10-12 + - Fix STM32-patched CI - Fix `enumeratedValues` with `isDefault` only - Fix invalid `Punct` error from `proc_macro2` @@ -903,7 +905,8 @@ peripheral.register.write(|w| w.field().set()); - Initial version of the `svd2rust` tool -[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.4...HEAD +[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.5...HEAD +[v0.33.5]: https://github.com/rust-embedded/svd2rust/compare/v0.33.4...v0.33.5 [v0.33.4]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...v0.33.4 [v0.33.3]: https://github.com/rust-embedded/svd2rust/compare/v0.33.2...v0.33.3 [v0.33.2]: https://github.com/rust-embedded/svd2rust/compare/v0.33.1...v0.33.2 diff --git a/Cargo.lock b/Cargo.lock index 91c5d200..aa09d2cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1022,9 +1022,9 @@ dependencies = [ [[package]] name = "roxmltree" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" +checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rustc-demangle" @@ -1196,9 +1196,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "svd-parser" -version = "0.14.5" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d17a2c2ef5aa450e80d714232a5932e7d8a39cac092e9e9ef8411bc833de3c4" +checksum = "39ba83b8a290ee3a180051e10a043691bb91d1b6be2053a570936fbdbec5ee2b" dependencies = [ "anyhow", "roxmltree", @@ -1208,9 +1208,9 @@ dependencies = [ [[package]] name = "svd-rs" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aea8090314157cc490b559da0c66f2228c066b56154f0321ad83b459a0a8278" +checksum = "3e49a90f3c4d03d81687e81d41b00f349fd44ccf9c26e0185ee926968de093bb" dependencies = [ "once_cell", "regex", @@ -1220,7 +1220,7 @@ dependencies = [ [[package]] name = "svd2rust" -version = "0.33.4" +version = "0.33.5" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index d1cce330..dbeceb60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["svd", "embedded", "register", "map", "generator"] license = "MIT OR Apache-2.0" name = "svd2rust" repository = "https://github.com/rust-embedded/svd2rust/" -version = "0.33.4" +version = "0.33.5" readme = "README.md" rust-version = "1.74" @@ -58,11 +58,11 @@ url = { version = "2.5", features = ["serde"] } [dependencies.svd-parser] features = ["expand"] -version = "0.14.5" +version = "0.14.7" [dependencies.svd-rs] features = ["serde"] -version = "0.14.8" +version = "0.14.9" [dependencies.syn] version = "2.0" From 4d48e4f9430cb7d26734fb3d1eb258c9eb0700ea Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Wed, 16 Oct 2024 20:10:22 +0300 Subject: [PATCH 18/77] move must_use from methods to generic type --- CHANGELOG.md | 2 ++ src/generate/generic.rs | 2 ++ src/generate/register.rs | 3 --- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8eac3f99..bffc3bce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- move `must_use` from methods to generic type + ## [v0.33.5] - 2024-10-12 - Fix STM32-patched CI diff --git a/src/generate/generic.rs b/src/generate/generic.rs index 2f8d6f7b..706b7e12 100644 --- a/src/generate/generic.rs +++ b/src/generate/generic.rs @@ -147,6 +147,7 @@ pub mod raw { } } + #[must_use = "after creating `FieldWriter` you need to call field value setting method"] pub struct FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> where REG: Writable + RegisterSpec, @@ -174,6 +175,7 @@ pub mod raw { } } + #[must_use = "after creating `BitWriter` you need to call bit setting method"] pub struct BitWriter<'a, REG, FI = bool, M = BitM> where REG: Writable + RegisterSpec, diff --git a/src/generate/register.rs b/src/generate/register.rs index be5fc5b2..84ea9e07 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -1305,7 +1305,6 @@ pub fn fields( #[doc = ""] #[doc = #note] #inline - #[must_use] pub fn #name_snake_case(&mut self, n: u8) -> #writer_ty<#regspec_ty> { #[allow(clippy::no_effect)] [(); #dim][n as usize]; @@ -1326,7 +1325,6 @@ pub fn fields( w_impl_items.extend(quote! { #[doc = #doc] #inline - #[must_use] pub fn #name_snake_case_n(&mut self) -> #writer_ty<#regspec_ty> { #writer_ty::new(self, #sub_offset) } @@ -1338,7 +1336,6 @@ pub fn fields( w_impl_items.extend(quote! { #[doc = #doc] #inline - #[must_use] pub fn #name_snake_case(&mut self) -> #writer_ty<#regspec_ty> { #writer_ty::new(self, #offset) } From f682b0b509cc78fa9c38ac81076bc16db10eaf8a Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Wed, 28 Feb 2024 08:21:34 +0300 Subject: [PATCH 19/77] use core::ptr::from_ref --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 5 ++--- README.md | 4 ++-- src/generate/peripheral/accessor.rs | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e63e963a..d6dec204 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ jobs: - { rust: stable, vendor: Toshiba, options: all } - { rust: stable, vendor: Toshiba, options: "" } # Test MSRV - - { rust: 1.74.0, vendor: Nordic, options: "" } + - { rust: 1.76.0, vendor: Nordic, options: "" } # Use nightly for architectures which don't support stable - { rust: nightly, vendor: MSP430, options: "--atomics" } - { rust: nightly, vendor: MSP430, options: "" } diff --git a/CHANGELOG.md b/CHANGELOG.md index bffc3bce..6cfe7b61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Bump MSRV of generated code to 1.76 - move `must_use` from methods to generic type ## [v0.33.5] - 2024-10-12 @@ -907,9 +908,7 @@ peripheral.register.write(|w| w.field().set()); - Initial version of the `svd2rust` tool -[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.5...HEAD -[v0.33.5]: https://github.com/rust-embedded/svd2rust/compare/v0.33.4...v0.33.5 -[v0.33.4]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...v0.33.4 +[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...HEAD [v0.33.3]: https://github.com/rust-embedded/svd2rust/compare/v0.33.2...v0.33.3 [v0.33.2]: https://github.com/rust-embedded/svd2rust/compare/v0.33.1...v0.33.2 [v0.33.1]: https://github.com/rust-embedded/svd2rust/compare/v0.33.0...v0.33.1 diff --git a/README.md b/README.md index f1f02e9e..d0bf6fb5 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ This project is developed and maintained by the [Tools team][team]. ## Minimum Supported Rust Version (MSRV) -The **generated code** is guaranteed to compile on stable Rust 1.65.0 and up. +The **generated code** is guaranteed to compile on stable Rust 1.76.0 and up. -If you encounter compilation errors on any stable version newer than 1.65.0, please open an issue. +If you encounter compilation errors on any stable version newer than 1.76.0, please open an issue. # Testing Locally diff --git a/src/generate/peripheral/accessor.rs b/src/generate/peripheral/accessor.rs index d30576c0..11897be0 100644 --- a/src/generate/peripheral/accessor.rs +++ b/src/generate/peripheral/accessor.rs @@ -55,7 +55,7 @@ impl ToTokens for AccessType { #[doc = #doc] #[inline(always)] pub const fn #name(&self) -> &#ty { - unsafe { &*(self as *const Self).cast::().add(#offset).cast() } + unsafe { &*core::ptr::from_ref(self).cast::().add(#offset).cast() } } } } @@ -84,7 +84,7 @@ impl ToTokens for AccessType { increment, })) => { let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site()); - let cast = quote! { unsafe { &*(self as *const Self).cast::().add(#offset).add(#increment * n).cast() } }; + let cast = quote! { unsafe { &*core::ptr::from_ref(self).cast::().add(#offset).add(#increment * n).cast() } }; quote! { #[doc = #doc] #[inline(always)] From 228bfc4ae962c4fba6e430cd8f793ca8a5de7f18 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 18 Oct 2024 19:46:51 +0300 Subject: [PATCH 20/77] rm repeated traits --- src/generate/generic_atomic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generate/generic_atomic.rs b/src/generate/generic_atomic.rs index f0c436f6..54c491c3 100644 --- a/src/generate/generic_atomic.rs +++ b/src/generate/generic_atomic.rs @@ -39,7 +39,7 @@ mod atomic { impl Reg where - REG::Ux: AtomicOperations + Default + core::ops::Not, + REG::Ux: AtomicOperations { /// Set high every bit in the register that was set in the write proxy. Leave other bits /// untouched. The write is done in a single atomic instruction. From cb66cd423646e684f7cd01b0b313241788a91dca Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 18 Oct 2024 21:52:16 +0300 Subject: [PATCH 21/77] clippy --- src/generate/register.rs | 4 ++-- src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/generate/register.rs b/src/generate/register.rs index 84ea9e07..b4600dc7 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -3,7 +3,6 @@ use crate::svd::{ ModifiedWriteValues, ReadAction, Register, RegisterProperties, Usage, WriteConstraint, WriteConstraintRange, }; -use core::u64; use log::warn; use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream}; use quote::quote; @@ -117,7 +116,7 @@ pub fn render( register.properties.reset_value.is_some(), &mod_ty, false, - ®ister, + register, &rpath, config, )?, @@ -162,6 +161,7 @@ fn read_action_docs(can_read: bool, read_action: Option) -> String { doc } +#[allow(clippy::too_many_arguments)] fn api_docs( can_read: bool, can_write: bool, diff --git a/src/lib.rs b/src/lib.rs index 6a0b754f..ec574c98 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,7 +37,7 @@ //! //! - `build.rs`, build script that places `device.x` somewhere the linker can find. //! - `device.x`, linker script that weakly aliases all the interrupt handlers to the default -//! exception handler (`DefaultHandler`). +//! exception handler (`DefaultHandler`). //! - `lib.rs`, the generated code. //! //! All these files must be included in the same device crate. The `lib.rs` file contains several @@ -95,7 +95,7 @@ //! //! - `build.rs`, build script that places `device.x` somewhere the linker can find. //! - `device.x`, linker script that weakly aliases all the interrupt handlers to the default -//! exception handler (`DefaultHandler`). +//! exception handler (`DefaultHandler`). //! - `lib.rs`, the generated code. //! //! All these files must be included in the same device crate. The `lib.rs` file contains several From dbd8734071d577b77fa08cb77a06808cdb83c9ae Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 19 Oct 2024 10:13:28 +0300 Subject: [PATCH 22/77] clean accessors --- CHANGELOG.md | 1 + src/generate/peripheral.rs | 22 ++++++++++------------ src/generate/peripheral/accessor.rs | 21 ++++++++++++++------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cfe7b61..cbe26557 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Skip generating `.add(0)` and `1 *` in accessors - Bump MSRV of generated code to 1.76 - move `must_use` from methods to generic type diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index e58a61ec..65ca041a 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -998,7 +998,7 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result Result Result Result { + let offset = (*offset != 0).then(|| unsuffixed(*offset)).map(|o| quote!(.add(#o))); quote! { #[doc = #doc] #[inline(always)] pub const fn #name(&self) -> &#ty { - unsafe { &*core::ptr::from_ref(self).cast::().add(#offset).cast() } + unsafe { &*core::ptr::from_ref(self).cast::() #offset .cast() } } } } @@ -84,7 +87,10 @@ impl ToTokens for AccessType { increment, })) => { let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site()); - let cast = quote! { unsafe { &*core::ptr::from_ref(self).cast::().add(#offset).add(#increment * n).cast() } }; + let offset = (*offset != 0).then(|| unsuffixed(*offset)).map(|o| quote!(.add(#o))); + let dim = unsuffixed(*dim); + let increment = (*increment != 1).then(|| unsuffixed(*increment)).map(|i| quote!(#i *)); + let cast = quote! { unsafe { &*core::ptr::from_ref(self).cast::() #offset .add(#increment n).cast() } }; quote! { #[doc = #doc] #[inline(always)] @@ -109,6 +115,7 @@ impl ToTokens for AccessType { basename, i, } = elem; + let i = unsuffixed(*i as u64); quote! { #[doc = #doc] #[inline(always)] @@ -127,7 +134,7 @@ pub struct RegAccessor { pub doc: String, pub name: Ident, pub ty: syn::Type, - pub offset: syn::LitInt, + pub offset: u32, } #[derive(Clone, Debug)] @@ -135,9 +142,9 @@ pub struct ArrayAccessor { pub doc: String, pub name: Ident, pub ty: syn::Type, - pub offset: syn::LitInt, - pub dim: syn::LitInt, - pub increment: syn::LitInt, + pub offset: u32, + pub dim: u32, + pub increment: u32, } #[derive(Clone, Debug)] @@ -146,5 +153,5 @@ pub struct ArrayElemAccessor { pub name: Ident, pub ty: syn::Type, pub basename: Ident, - pub i: syn::LitInt, + pub i: usize, } From c13b87d2cbc20c878096aa7ae5780ddfd8e55b26 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 19 Oct 2024 13:06:09 +0300 Subject: [PATCH 23/77] strings --- src/generate/interrupt.rs | 8 ++++---- src/generate/peripheral.rs | 10 +++++----- src/generate/register.rs | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/generate/interrupt.rs b/src/generate/interrupt.rs index 10d9bdde..7417c382 100644 --- a/src/generate/interrupt.rs +++ b/src/generate/interrupt.rs @@ -62,10 +62,10 @@ pub fn render( interrupt .0 .description - .as_ref() - .map(|s| util::respace(s)) - .as_ref() - .map(|s| util::escape_special_chars(s)) + .as_deref() + .map(util::respace) + .as_deref() + .map(util::escape_special_chars) .unwrap_or_else(|| interrupt.0.name.clone()) ); diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 65ca041a..6a183557 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -305,7 +305,7 @@ impl Region { let mut idents: Vec<_> = self .rbfs .iter() - .filter_map(|f| f.syn_field.ident.as_ref().map(|ident| ident.to_string())) + .filter_map(|f| f.syn_field.ident.as_ref().map(ToString::to_string)) .collect(); if idents.is_empty() { return None; @@ -343,7 +343,7 @@ impl Region { let idents: Vec<_> = self .rbfs .iter() - .filter_map(|f| f.syn_field.ident.as_ref().map(|ident| ident.to_string())) + .filter_map(|f| f.syn_field.ident.as_ref().map(ToString::to_string)) .collect(); if idents.is_empty() { @@ -726,7 +726,7 @@ fn check_erc_derive_infos( }; match register { Register::Single(_) => { - let ty_name = info_name.to_string(); + let ty_name = info_name.clone(); *derive_info = match explicit_rpath { None => { match compare_this_against_prev( @@ -758,7 +758,7 @@ fn check_erc_derive_infos( let re = Regex::new(format!("^{re_string}$").as_str()).map_err(|_| { anyhow!("Error creating regex for register {}", register.name) })?; - let ty_name = info_name.to_string(); // keep suffix for regex matching + let ty_name = info_name.clone(); // keep suffix for regex matching *derive_info = match explicit_rpath { None => { match compare_this_against_prev( @@ -787,7 +787,7 @@ fn check_erc_derive_infos( } RegisterCluster::Cluster(cluster) => { *derive_info = DeriveInfo::Cluster; - ercs_type_info.push((cluster.name.to_string(), None, erc, derive_info)); + ercs_type_info.push((cluster.name.clone(), None, erc, derive_info)); } }; } diff --git a/src/generate/register.rs b/src/generate/register.rs index b4600dc7..0747b9a4 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -222,7 +222,7 @@ fn api_docs( let idx = format!("[{idx}]"); rpath.name.replace("[%s]", &idx).replace("%s", &idx) } else { - rpath.name.to_string() + rpath.name.clone() }; // TODO: support html_urls for registers in cluster if rpath.block.path.is_empty() { From 8aadb82fe81a5db9481ea91ccca6d77315417345 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 19 Oct 2024 13:25:56 +0300 Subject: [PATCH 24/77] Add warning about indexing register arrays --- CHANGELOG.md | 1 + src/generate/peripheral.rs | 10 ++++++++++ src/generate/peripheral/accessor.rs | 14 +++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbe26557..6eb4b26b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Add warning about indexing register arrays - Skip generating `.add(0)` and `1 *` in accessors - Bump MSRV of generated code to 1.76 - move `must_use` from methods to generic type diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 6a183557..9e3101ec 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -1052,6 +1052,10 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result`n` is the index of {0} in the array. `n == 0` corresponds to `{first_name}` {0}.", "cluster") + ); accessors.push( Accessor::Array(ArrayAccessor { doc, @@ -1060,6 +1064,7 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result`n` is the index of {0} in the array. `n == 0` corresponds to `{first_name}` {0}.", "register") + ); accessors.push( Accessor::Array(ArrayAccessor { doc, @@ -1242,6 +1251,7 @@ fn expand_register( offset: info.address_offset, dim: array_info.dim, increment: array_info.dim_increment, + note, }) .raw_if(!array_convertible), ); diff --git a/src/generate/peripheral/accessor.rs b/src/generate/peripheral/accessor.rs index 85f663d4..5bb91718 100644 --- a/src/generate/peripheral/accessor.rs +++ b/src/generate/peripheral/accessor.rs @@ -62,10 +62,15 @@ impl ToTokens for AccessType { } } } - Self::Ref(Accessor::Array(ArrayAccessor { doc, name, ty, .. })) => { + Self::Ref(Accessor::Array(ArrayAccessor { doc, name, ty, note, .. })) => { let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site()); + let note = note.as_ref().map(|note| quote! { + #[doc = ""] + #[doc = #note] + }); quote! { #[doc = #doc] + #note #[inline(always)] pub const fn #name(&self, n: usize) -> &#ty { &self.#name[n] @@ -85,14 +90,20 @@ impl ToTokens for AccessType { offset, dim, increment, + note, })) => { let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site()); let offset = (*offset != 0).then(|| unsuffixed(*offset)).map(|o| quote!(.add(#o))); let dim = unsuffixed(*dim); let increment = (*increment != 1).then(|| unsuffixed(*increment)).map(|i| quote!(#i *)); + let note = note.as_ref().map(|note| quote! { + #[doc = ""] + #[doc = #note] + }); let cast = quote! { unsafe { &*core::ptr::from_ref(self).cast::() #offset .add(#increment n).cast() } }; quote! { #[doc = #doc] + #note #[inline(always)] pub const fn #name(&self, n: usize) -> &#ty { #[allow(clippy::no_effect)] @@ -145,6 +156,7 @@ pub struct ArrayAccessor { pub offset: u32, pub dim: u32, pub increment: u32, + pub note: Option, } #[derive(Clone, Debug)] From 90ef2a6988b8ad15120bf93d2b22c6110c8996f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20C=C3=A1rdenas=20Rodr=C3=ADguez?= Date: Mon, 1 Jul 2024 09:14:43 +0200 Subject: [PATCH 25/77] settings.yaml file for target-specific configurations. We use setting.yaml to support riscv 0.12.0 and riscv-rt 0.13.0 This feature also allows RISC-V targets to use standard peripheral implementations with the riscv-peripheral crate. --- CHANGELOG.md | 4 + Cargo.lock | 623 +++++++++++++++++++++-------------------- Cargo.toml | 1 + src/config.rs | 13 + src/config/riscv.rs | 48 ++++ src/generate/device.rs | 38 ++- src/generate/mod.rs | 1 + src/generate/riscv.rs | 306 ++++++++++++++++++++ src/lib.rs | 18 +- src/main.rs | 13 +- 10 files changed, 744 insertions(+), 321 deletions(-) create mode 100644 src/config/riscv.rs create mode 100644 src/generate/riscv.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eb4b26b..25439d50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Compatibility with `riscv` 0.12 and `riscv-rt` 0.13 +- Add `riscv_config` section in `settings.yaml` + It uses `riscv-pac` traits and standard `riscv-peripheral` peripherals. +- Add `settings.yaml` file for target-specific settings. - Add warning about indexing register arrays - Skip generating `.add(0)` and `1 *` in accessors - Bump MSRV of generated code to 1.76 diff --git a/Cargo.lock b/Cargo.lock index aa09d2cd..6f55c94c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -19,56 +19,57 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -76,33 +77,33 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.76" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -115,9 +116,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bitflags" @@ -127,9 +128,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake2b_simd" @@ -144,23 +145,23 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.83" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" dependencies = [ - "libc", + "shlex", ] [[package]] @@ -171,9 +172,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.11" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -181,39 +182,39 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.75", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "constant_time_eq" @@ -233,41 +234,34 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.16" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", ] [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "darling" @@ -289,7 +283,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] @@ -337,24 +331,24 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ "log", "regex", @@ -362,9 +356,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ "anstream", "anstyle", @@ -381,9 +375,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -391,9 +385,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fnv" @@ -427,42 +421,42 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", @@ -475,15 +469,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "h2" -version = "0.3.22" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -500,21 +494,21 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "home" @@ -536,9 +530,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -558,9 +552,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -576,9 +570,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -629,9 +623,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown", @@ -665,44 +659,50 @@ dependencies = [ "toml", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchers" @@ -715,18 +715,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -736,31 +727,31 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -782,21 +773,11 @@ dependencies = [ "winapi", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" -version = "0.32.1" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -809,11 +790,11 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.62" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -830,7 +811,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.75", ] [[package]] @@ -841,9 +822,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.98" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -865,9 +846,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -877,43 +858,43 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.42", + "syn 2.0.75", ] [[package]] name = "proc-macro2" -version = "1.0.71" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -921,33 +902,24 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" -version = "1.10.3" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -961,13 +933,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] @@ -978,15 +950,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64", "bytes", @@ -1006,9 +978,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -1028,45 +1002,54 @@ checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -1075,9 +1058,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -1085,40 +1068,41 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.193" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.75", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -1137,9 +1121,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.29" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15e0ef66bf939a7c890a0bf6d5a733c70202225f9888a89ed5c62298b019129" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ "indexmap", "itoa", @@ -1163,6 +1147,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "slab" version = "0.4.9" @@ -1174,18 +1164,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1194,6 +1184,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "svd-parser" version = "0.14.7" @@ -1237,7 +1233,7 @@ dependencies = [ "serde_yaml", "svd-parser", "svd-rs", - "syn 2.0.42", + "syn 2.0.75", "thiserror", "url", ] @@ -1256,7 +1252,7 @@ dependencies = [ "serde_yaml", "shell-words", "svd2rust", - "syn 2.0.42", + "syn 2.0.75", "thiserror", "tracing", "tracing-subscriber", @@ -1277,15 +1273,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.42" +version = "2.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -1309,42 +1311,42 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", + "once_cell", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.51" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.51" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.75", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -1352,9 +1354,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -1367,18 +1369,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "socket2", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1393,16 +1394,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -1419,9 +1419,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -1441,9 +1441,9 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -1464,7 +1464,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.75", ] [[package]] @@ -1514,9 +1514,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -1526,24 +1526,24 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -1559,9 +1559,9 @@ checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" @@ -1592,34 +1592,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.75", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -1629,9 +1630,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1639,28 +1640,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.75", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -1681,9 +1682,9 @@ dependencies = [ [[package]] name = "wildmatch" -version = "2.2.0" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffa44a4268d649eba546544ed45fd9591059d9653a0e584efe030b56d8172b58" +checksum = "3928939971918220fed093266b809d1ee4ec6c1a2d72692ff6876898f3b16c19" [[package]] name = "winapi" @@ -1722,7 +1723,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -1742,17 +1752,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -1763,9 +1774,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -1775,9 +1786,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -1787,9 +1798,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -1799,9 +1816,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -1811,9 +1828,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -1823,9 +1840,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -1835,15 +1852,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.30" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index dbeceb60..cd408230 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,6 +41,7 @@ clap = { version = "4.0", optional = true } irx-config = { version = "=3.3.0", features = [ "cmd", "toml-parser", + "yaml", ], optional = true } env_logger = { version = "0.11", optional = true } inflections = "1.1" diff --git a/src/config.rs b/src/config.rs index 79522ecd..5a48105c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -36,6 +36,8 @@ pub struct Config { pub field_names_for_enums: bool, pub base_address_shift: u64, pub html_url: Option, + /// Path to YAML file with chip-specific settings + pub settings: Option, } #[allow(clippy::upper_case_acronyms)] @@ -312,3 +314,14 @@ impl DerefMut for IdentFormats { pub enum IdentFormatsTheme { Legacy, } + +#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] +#[derive(Clone, PartialEq, Eq, Debug, Default)] +#[non_exhaustive] +/// Chip-specific settings +pub struct Settings { + /// RISC-V specific settings + pub riscv_config: Option, +} + +pub mod riscv; diff --git a/src/config/riscv.rs b/src/config/riscv.rs new file mode 100644 index 00000000..2091bc2f --- /dev/null +++ b/src/config/riscv.rs @@ -0,0 +1,48 @@ +#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] +#[derive(Clone, PartialEq, Eq, Debug, Default)] +#[non_exhaustive] +pub struct RiscvConfig { + pub core_interrupts: Vec, + pub exceptions: Vec, + pub priorities: Vec, + pub harts: Vec, + pub clint: Option, + pub plic: Option, +} + +#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] +#[derive(Clone, PartialEq, Eq, Debug, Default)] +#[non_exhaustive] +pub struct RiscvEnumItem { + pub name: String, + pub value: usize, + pub description: Option, +} + +impl RiscvEnumItem { + pub fn description(&self) -> String { + let description = match &self.description { + Some(d) => d, + None => &self.name, + }; + format!("{} - {}", self.value, description) + } +} + +#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] +#[derive(Clone, PartialEq, Eq, Debug, Default)] +#[non_exhaustive] +pub struct RiscvClintConfig { + pub name: String, + pub freq: Option, + pub async_delay: bool, +} + +#[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] +#[derive(Clone, PartialEq, Eq, Debug, Default)] +#[non_exhaustive] +pub struct RiscvPlicConfig { + pub name: String, + pub core_interrupt: Option, + pub hart_id: Option, +} diff --git a/src/generate/device.rs b/src/generate/device.rs index dd601ada..64ced875 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -7,11 +7,11 @@ use std::fs::File; use std::io::Write; use std::path::Path; -use crate::config::{Config, Target}; +use crate::config::{Config, Settings, Target}; use crate::util::{self, ident}; use anyhow::{Context, Result}; -use crate::generate::{interrupt, peripheral}; +use crate::generate::{interrupt, peripheral, riscv}; /// Whole device generation pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { @@ -28,6 +28,14 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { + let file = std::fs::read_to_string(settings).context("could not read settings file")?; + serde_yaml::from_str(&file).context("could not parse settings file")? + } + None => Settings::default(), + }; + if config.target == Target::Msp430 { out.extend(quote! { #![feature(abi_msp430_interrupt)] @@ -187,13 +195,21 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { + debug!("Rendering RISC-V specific code"); + out.extend(riscv::render(&d.peripherals, device_x, &settings)?); + } + _ => { + debug!("Rendering interrupts"); + out.extend(interrupt::render( + config.target, + &d.peripherals, + device_x, + config, + )?); + } + } let feature_format = config.ident_formats.get("peripheral_feature").unwrap(); for p in &d.peripherals { @@ -203,6 +219,10 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result bool { + // TODO cleaner implementation of this + match &s.riscv_config { + Some(c) => { + c.clint.as_ref().is_some_and(|clint| clint.name == p.name) + || c.plic.as_ref().is_some_and(|plic| plic.name == p.name) + } + _ => false, + } +} + +/// Whole RISC-V generation +pub fn render( + peripherals: &[Peripheral], + device_x: &mut String, + settings: &Settings, +) -> Result { + let mut mod_items = TokenStream::new(); + + if let Some(c) = settings.riscv_config.as_ref() { + if !c.core_interrupts.is_empty() { + debug!("Rendering target-specific core interrupts"); + writeln!(device_x, "/* Core interrupt sources and trap handlers */")?; + let mut interrupts = vec![]; + for interrupt in c.core_interrupts.iter() { + let name = TokenStream::from_str(&interrupt.name).unwrap(); + let value = TokenStream::from_str(&format!("{}", interrupt.value)).unwrap(); + let description = interrupt.description(); + + writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?; + writeln!( + device_x, + "PROVIDE(_start_{name}_trap = _start_DefaultHandler_trap);" + )?; + + interrupts.push(quote! { + #[doc = #description] + #name = #value, + }); + } + mod_items.extend(quote! { + /// Core interrupts. These interrupts are handled by the core itself. + #[riscv::pac_enum(unsafe CoreInterruptNumber)] + #[derive(Debug, Clone, Copy, PartialEq, Eq)] + pub enum CoreInterrupt { + #(#interrupts)* + } + }); + } else { + // when no interrupts are defined, we re-export the standard riscv interrupts + mod_items.extend(quote! {pub use riscv::interrupt::Interrupt as CoreInterrupt;}); + } + + if !c.exceptions.is_empty() { + debug!("Rendering target-specific exceptions"); + writeln!(device_x, "/* Exception sources */")?; + let mut exceptions = vec![]; + for exception in c.exceptions.iter() { + let name = TokenStream::from_str(&exception.name).unwrap(); + let value = TokenStream::from_str(&format!("{}", exception.value)).unwrap(); + let description = exception.description(); + + writeln!(device_x, "PROVIDE({name} = ExceptionHandler);")?; + + exceptions.push(quote! { + #[doc = #description] + #name = #value, + }); + } + mod_items.extend(quote! { + /// Exception sources in the device. + #[riscv::pac_enum(unsafe ExceptionNumber)] + #[derive(Debug, Clone, Copy, PartialEq, Eq)] + pub enum Exception { + #(#exceptions)* + } + }); + } else { + // when no exceptions are defined, we re-export the standard riscv exceptions + mod_items.extend(quote! { pub use riscv::interrupt::Exception; }); + } + + if !c.priorities.is_empty() { + debug!("Rendering target-specific priority levels"); + let priorities = c.priorities.iter().map(|priority| { + let name = TokenStream::from_str(&priority.name).unwrap(); + let value = TokenStream::from_str(&format!("{}", priority.value)).unwrap(); + let description = priority.description(); + + quote! { + #[doc = #description] + #name = #value, + } + }); + mod_items.extend(quote! { + /// Priority levels in the device + #[riscv::pac_enum(unsafe PriorityNumber)] + #[derive(Debug, Clone, Copy, PartialEq, Eq)] + pub enum Priority { + #(#priorities)* + } + }); + } + + if !c.harts.is_empty() { + debug!("Rendering target-specific HART IDs"); + let harts = c.harts.iter().map(|hart| { + let name = TokenStream::from_str(&hart.name).unwrap(); + let value = TokenStream::from_str(&format!("{}", hart.value)).unwrap(); + let description = hart.description(); + + quote! { + #[doc = #description] + #name = #value, + } + }); + mod_items.extend(quote! { + /// HARTs in the device + #[riscv::pac_enum(unsafe HartIdNumber)] + #[derive(Debug, Clone, Copy, PartialEq, Eq)] + pub enum Hart { + #(#harts)* + } + }); + } + } else { + // when no riscv block is defined, we re-export the standard riscv interrupt and exception enums + mod_items.extend(quote! { + pub use riscv::interrupt::{Interrupt as CoreInterrupt, Exception}; + }); + } + + mod_items.extend(quote! { + pub use riscv::{ + InterruptNumber, ExceptionNumber, PriorityNumber, HartIdNumber, + interrupt::{enable, disable, free, nested} + }; + + pub type Trap = riscv::interrupt::Trap; + + /// Retrieves the cause of a trap in the current hart. + /// + /// If the raw cause is not a valid interrupt or exception for the target, it returns an error. + #[inline] + pub fn try_cause() -> riscv::result::Result { + riscv::interrupt::try_cause() + } + + /// Retrieves the cause of a trap in the current hart (machine mode). + /// + /// If the raw cause is not a valid interrupt or exception for the target, it panics. + #[inline] + pub fn cause() -> Trap { + try_cause().unwrap() + } + }); + + let external_interrupts = peripherals + .iter() + .flat_map(|p| p.interrupt.iter()) + .map(|i| (i.value, i)) + .collect::>(); + let mut external_interrupts = external_interrupts.into_values().collect::>(); + external_interrupts.sort_by_key(|i| i.value); + if !external_interrupts.is_empty() { + debug!("Rendering target-specific external interrupts"); + writeln!(device_x, "/* External interrupt sources */")?; + let mut interrupts = vec![]; + for i in external_interrupts.iter() { + let name = TokenStream::from_str(&i.name).unwrap(); + let value = TokenStream::from_str(&format!("{}", i.value)).unwrap(); + let description = format!( + "{} - {}", + i.value, + i.description + .as_ref() + .map(|s| util::respace(s)) + .as_ref() + .map(|s| util::escape_special_chars(s)) + .unwrap_or_else(|| i.name.clone()) + ); + + writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?; + + interrupts.push(quote! { + #[doc = #description] + #name = #value, + }) + } + mod_items.extend(quote! { + /// External interrupts. These interrupts are handled by the external peripherals. + #[riscv::pac_enum(unsafe ExternalInterruptNumber)] + #[derive(Debug, Clone, Copy, PartialEq, Eq)] + pub enum ExternalInterrupt { + #(#interrupts)* + } + }); + } + + let mut riscv_peripherals = TokenStream::new(); + if let Some(c) = &settings.riscv_config { + let harts = match c.harts.is_empty() { + true => vec![], + false => c + .harts + .iter() + .map(|h| (TokenStream::from_str(&h.name).unwrap(), h.value)) + .collect::>(), + }; + if let Some(clint) = &c.clint { + let p = peripherals.iter().find(|&p| p.name == clint.name).unwrap(); + let base = TokenStream::from_str(&format!("base 0x{:X},", p.base_address)).unwrap(); + let freq = match clint.freq { + Some(clk) => match clint.async_delay { + true => TokenStream::from_str(&format!("freq {clk}, async_delay,")).unwrap(), + false => TokenStream::from_str(&format!("freq {clk},")).unwrap(), + }, + None => quote! {}, + }; + let mtimecmps = harts + .iter() + .map(|(name, value)| { + let mtimecmp_name = TokenStream::from_str(&format!("mtimecmp{value}")).unwrap(); + let doc = format!("[{value}](crate::interrupt::Hart::{name})"); + quote! {#mtimecmp_name = (crate::interrupt::Hart::#name, #doc)} + }) + .collect::>(); + let mtimecmps = match mtimecmps.len() { + 0 => quote! {}, + _ => quote! {mtimecmps [ #(#mtimecmps),* ],}, + }; + let msips = harts + .iter() + .map(|(name, value)| { + let msip_name = TokenStream::from_str(&format!("msip{value}")).unwrap(); + let doc = format!("[{value}](crate::interrupt::Hart::{name})"); + quote! {#msip_name = (crate::interrupt::Hart::#name, #doc)} + }) + .collect::>(); + let msips = match msips.len() { + 0 => quote! {}, + _ => quote! {msips [ #(#msips),* ],}, + }; + + riscv_peripherals.extend(quote! { + riscv_peripheral::clint_codegen!(#base #freq #mtimecmps #msips); + }); + } + if let Some(plic) = &c.plic { + let p = peripherals.iter().find(|&p| p.name == plic.name).unwrap(); + let base = TokenStream::from_str(&format!("base 0x{:X},", p.base_address)).unwrap(); + let ctxs = harts + .iter() + .map(|(name, value)| { + let ctx_name = TokenStream::from_str(&format!("ctx{value}")).unwrap(); + let doc = format!("[{value}](crate::interrupt::Hart::{name})"); + quote! {#ctx_name = (crate::interrupt::Hart::#name, #doc)} + }) + .collect::>(); + let ctxs = match ctxs.len() { + 0 => quote! {}, + _ => quote! {ctxs [ #(#ctxs),* ],}, + }; + + riscv_peripherals.extend(quote! { + riscv_peripheral::plic_codegen!(#base #ctxs); + }); + + if let Some(core_interrupt) = &plic.core_interrupt { + let core_interrupt = TokenStream::from_str(core_interrupt).unwrap(); + let ctx = match &plic.hart_id { + Some(hart_id) => { + TokenStream::from_str(&format!("ctx(Hart::{hart_id})")).unwrap() + } + None => quote! { ctx_mhartid() }, + }; + mod_items.extend(quote! { + #[cfg(feature = "rt")] + #[riscv_rt::core_interrupt(CoreInterrupt::#core_interrupt)] + fn plic_handler() { + let claim = crate::PLIC::#ctx.claim(); + if let Some(s) = claim.claim::() { + unsafe { _dispatch_external_interrupt(s.number()) } + claim.complete(s); + } + } + }); + } + } + } + + Ok(quote! { + /// Interrupt numbers, priority levels, and HART IDs. + pub mod interrupt { + #mod_items + } + #riscv_peripherals + }) +} diff --git a/src/lib.rs b/src/lib.rs index ec574c98..edec886e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,22 +149,26 @@ //! The resulting crate must provide an opt-in `rt` feature and depend on these crates: //! //! - [`critical-section`](https://crates.io/crates/critical-section) v1.x -//! - [`riscv`](https://crates.io/crates/riscv) v0.9.x (if target is RISC-V) -//! - [`riscv-rt`](https://crates.io/crates/riscv-rt) v0.9.x (if target is RISC-V) +//! - [`riscv`](https://crates.io/crates/riscv) v0.12.x (if target is RISC-V) +//! - [`riscv-peripheral`](https://crates.io/crates/riscv-peripheral) v0.2.x (if target is RISC-V and has standard peripherals) +//! - [`riscv-rt`](https://crates.io/crates/riscv-rt) v0.13.x (if target is RISC-V) //! - [`vcell`](https://crates.io/crates/vcell) v0.1.x //! -//! The `*-rt` dependencies must be optional only enabled when the `rt` feature is enabled. The -//! `Cargo.toml` of the device crate will look like this for a RISC-V target: +//! The `*-rt` dependencies must be optional only enabled when the `rt` feature is enabled. +//! If target is RISC-V and supports vectored mode, you must include a feature `v-trap` to activate `riscv-rt/v-trap`. +//! The `Cargo.toml` of the device crate will look like this for a RISC-V target: //! //! ``` toml //! [dependencies] //! critical-section = { version = "1.0", optional = true } -//! riscv = "0.9.0" -//! riscv-rt = { version = "0.9.0", optional = true } +//! riscv = "0.12.1" +//! riscv-peripheral = "0.2.0" +//! riscv-rt = { version = "0.13.0", optional = true } //! vcell = "0.1.0" //! //! [features] //! rt = ["riscv-rt"] +//! v-trap = ["rt", "riscv-rt/v-trap"] //! ``` //! //! # Peripheral API @@ -593,7 +597,7 @@ pub mod config; pub mod generate; pub mod util; -pub use config::{Config, Target}; +pub use config::{Config, Settings, Target}; #[non_exhaustive] pub struct Generation { diff --git a/src/main.rs b/src/main.rs index aabec8f6..880bb4ab 100755 --- a/src/main.rs +++ b/src/main.rs @@ -29,10 +29,12 @@ fn parse_configs(app: Command) -> Result { .path_option("config") .ignore_missing_file(true) .build()?, - ) - .load()?; + ); + + let irxconfig = irxconfig.load()?; let mut config: Config = irxconfig.get()?; + let mut idf = match config.ident_formats_theme { Some(IdentFormatsTheme::Legacy) => IdentFormats::legacy_theme(), _ => IdentFormats::default_theme(), @@ -98,6 +100,13 @@ fn run() -> Result<()> { .action(ArgAction::Set) .value_name("TOML_FILE"), ) + .arg( + Arg::new("settings") + .long("settings") + .help("Target-specific settings YAML file") + .action(ArgAction::Set) + .value_name("YAML_FILE"), + ) .arg( Arg::new("target") .long("target") From 7468bd60b848313c68d1f3558e7aa514c1c0a966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20C=C3=A1rdenas=20Rodr=C3=ADguez?= Date: Mon, 21 Oct 2024 17:24:32 +0200 Subject: [PATCH 26/77] Update riscv CI to 0.12.1 --- ci/script.sh | 4 ++-- ci/svd2rust-regress/src/svd_test.rs | 2 +- src/generate/device.rs | 32 ++++++++++++++++++++++------- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/ci/script.sh b/ci/script.sh index 9474a753..b0da0e4b 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -498,10 +498,10 @@ main() { echo 'version = "1.0.0"' >> $td/Cargo.toml echo '[dependencies.riscv]' >> $td/Cargo.toml - echo 'version = "0.6.0"' >> $td/Cargo.toml + echo 'version = "0.12.1"' >> $td/Cargo.toml echo '[dependencies.riscv-rt]' >> $td/Cargo.toml - echo 'version = "0.8.0"' >> $td/Cargo.toml + echo 'version = "0.13.0"' >> $td/Cargo.toml test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x/e310x.svd test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/k210-pac/master/k210.svd diff --git a/ci/svd2rust-regress/src/svd_test.rs b/ci/svd2rust-regress/src/svd_test.rs index 1ea01f2e..30033dbd 100644 --- a/ci/svd2rust-regress/src/svd_test.rs +++ b/ci/svd2rust-regress/src/svd_test.rs @@ -16,7 +16,7 @@ const CRATES_MSP430: &[&str] = &["msp430 = \"0.4.0\"", "msp430-rt = \"0.4.0\""]; const CRATES_ATOMICS: &[&str] = &["portable-atomic = { version = \"0.3.16\", default-features = false }"]; const CRATES_CORTEX_M: &[&str] = &["cortex-m = \"0.7.6\"", "cortex-m-rt = \"0.6.13\""]; -const CRATES_RISCV: &[&str] = &["riscv = \"0.9.0\"", "riscv-rt = \"0.9.0\""]; +const CRATES_RISCV: &[&str] = &["riscv = \"0.12.1\"", "riscv-rt = \"0.13.0\""]; const CRATES_XTENSALX: &[&str] = &["xtensa-lx-rt = \"0.9.0\"", "xtensa-lx = \"0.6.0\""]; const CRATES_MIPS: &[&str] = &["mips-mcu = \"0.1.0\""]; const PROFILE_ALL: &[&str] = &["[profile.dev]", "incremental = false"]; diff --git a/src/generate/device.rs b/src/generate/device.rs index 64ced875..9f0ff909 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -2,12 +2,12 @@ use crate::svd::{array::names, Device, Peripheral}; use proc_macro2::{Span, TokenStream}; use quote::{quote, ToTokens}; -use log::debug; +use log::{debug, warn}; use std::fs::File; use std::io::Write; use std::path::Path; -use crate::config::{Config, Settings, Target}; +use crate::config::{Config, Target}; use crate::util::{self, ident}; use anyhow::{Context, Result}; @@ -31,9 +31,9 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { let file = std::fs::read_to_string(settings).context("could not read settings file")?; - serde_yaml::from_str(&file).context("could not parse settings file")? + Some(serde_yaml::from_str(&file).context("could not parse settings file")?) } - None => Settings::default(), + None => None, }; if config.target == Target::Msp430 { @@ -197,8 +197,23 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { - debug!("Rendering RISC-V specific code"); - out.extend(riscv::render(&d.peripherals, device_x, &settings)?); + if settings.is_none() { + warn!("No settings file provided for RISC-V target. Using legacy interrupts rendering"); + warn!("Please, consider migrating your PAC to riscv 0.12.0 or later"); + out.extend(interrupt::render( + config.target, + &d.peripherals, + device_x, + config, + )?); + } else { + debug!("Rendering RISC-V specific code"); + out.extend(riscv::render( + &d.peripherals, + device_x, + settings.as_ref().unwrap(), + )?); + } } _ => { debug!("Rendering interrupts"); @@ -219,7 +234,10 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Date: Tue, 22 Oct 2024 08:24:09 -0700 Subject: [PATCH 27/77] arbitrary return type for register modifiers --- src/generate/generic_reg_vcell.rs | 78 +++++++++++++++++-------------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/src/generate/generic_reg_vcell.rs b/src/generate/generic_reg_vcell.rs index 5081ae20..04289050 100644 --- a/src/generate/generic_reg_vcell.rs +++ b/src/generate/generic_reg_vcell.rs @@ -74,18 +74,20 @@ impl Reg { /// ``` /// In the latter case, other fields will be set to their reset value. #[inline(always)] - pub fn write(&self, f: F) + pub fn write(&self, f: F) -> T where - F: FnOnce(&mut W) -> &mut W, + F: FnOnce(&mut W) -> T, { - self.register.set( - f(&mut W { - bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP - | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, - _reg: marker::PhantomData, - }) - .bits, - ); + let mut writer = W { + bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }; + let result = f(&mut writer); + + self.register.set(writer.bits); + + result } } @@ -98,17 +100,20 @@ impl Reg { /// /// Unsafe to use with registers which don't allow to write 0. #[inline(always)] - pub unsafe fn write_with_zero(&self, f: F) + pub unsafe fn write_with_zero(&self, f: F) -> T where - F: FnOnce(&mut W) -> &mut W, + F: FnOnce(&mut W) -> T, { - self.register.set( - f(&mut W { - bits: REG::Ux::default(), - _reg: marker::PhantomData, - }) - .bits, - ); + let mut writer = W { + bits: REG::Ux::default(), + _reg: marker::PhantomData, + }; + + let result = f(&mut writer); + + self.register.set(writer.bits); + + result } } @@ -139,31 +144,34 @@ impl Reg { /// ``` /// Other fields will have the value they had before the call to `modify`. #[inline(always)] - pub fn modify(&self, f: F) + pub fn modify(&self, f: F) -> T where - for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, + for<'w> F: FnOnce(&R, &'w mut W) -> T, { let bits = self.register.get(); - self.register.set( - f( - &R { - bits, - _reg: marker::PhantomData, - }, - &mut W { - bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP - | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, - _reg: marker::PhantomData, - }, - ) - .bits, + + let mut writer = W { + bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }; + + let result = f( + &R { + bits, + _reg: marker::PhantomData, + }, + &mut writer, ); + + self.register.set(writer.bits); + + result } } impl core::fmt::Debug for crate::generic::Reg where - R: core::fmt::Debug + R: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt(&self.read(), f) From 294e211054b3150c42a2abd97b7962d6354dce45 Mon Sep 17 00:00:00 2001 From: Adin Ackerman Date: Tue, 22 Oct 2024 08:35:47 -0700 Subject: [PATCH 28/77] Revert "arbitrary return type for register modifiers" This reverts commit 456ce21563fa289b726285d820cf6ea0b4d76dd3. --- src/generate/generic_reg_vcell.rs | 78 ++++++++++++++----------------- 1 file changed, 35 insertions(+), 43 deletions(-) diff --git a/src/generate/generic_reg_vcell.rs b/src/generate/generic_reg_vcell.rs index 04289050..5081ae20 100644 --- a/src/generate/generic_reg_vcell.rs +++ b/src/generate/generic_reg_vcell.rs @@ -74,20 +74,18 @@ impl Reg { /// ``` /// In the latter case, other fields will be set to their reset value. #[inline(always)] - pub fn write(&self, f: F) -> T + pub fn write(&self, f: F) where - F: FnOnce(&mut W) -> T, + F: FnOnce(&mut W) -> &mut W, { - let mut writer = W { - bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP - | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, - _reg: marker::PhantomData, - }; - let result = f(&mut writer); - - self.register.set(writer.bits); - - result + self.register.set( + f(&mut W { + bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }) + .bits, + ); } } @@ -100,20 +98,17 @@ impl Reg { /// /// Unsafe to use with registers which don't allow to write 0. #[inline(always)] - pub unsafe fn write_with_zero(&self, f: F) -> T + pub unsafe fn write_with_zero(&self, f: F) where - F: FnOnce(&mut W) -> T, + F: FnOnce(&mut W) -> &mut W, { - let mut writer = W { - bits: REG::Ux::default(), - _reg: marker::PhantomData, - }; - - let result = f(&mut writer); - - self.register.set(writer.bits); - - result + self.register.set( + f(&mut W { + bits: REG::Ux::default(), + _reg: marker::PhantomData, + }) + .bits, + ); } } @@ -144,34 +139,31 @@ impl Reg { /// ``` /// Other fields will have the value they had before the call to `modify`. #[inline(always)] - pub fn modify(&self, f: F) -> T + pub fn modify(&self, f: F) where - for<'w> F: FnOnce(&R, &'w mut W) -> T, + for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); - - let mut writer = W { - bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, - _reg: marker::PhantomData, - }; - - let result = f( - &R { - bits, - _reg: marker::PhantomData, - }, - &mut writer, + self.register.set( + f( + &R { + bits, + _reg: marker::PhantomData, + }, + &mut W { + bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }, + ) + .bits, ); - - self.register.set(writer.bits); - - result } } impl core::fmt::Debug for crate::generic::Reg where - R: core::fmt::Debug, + R: core::fmt::Debug { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt(&self.read(), f) From 6cd9ead15fef820c1f03cce307c8f90c7c89246c Mon Sep 17 00:00:00 2001 From: Adin Ackerman Date: Tue, 22 Oct 2024 08:45:11 -0700 Subject: [PATCH 29/77] add `write_and`, `write_with_zero_and`, and `modify_and` --- src/generate/generic_reg_vcell.rs | 127 +++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) diff --git a/src/generate/generic_reg_vcell.rs b/src/generate/generic_reg_vcell.rs index 5081ae20..dc6445f0 100644 --- a/src/generate/generic_reg_vcell.rs +++ b/src/generate/generic_reg_vcell.rs @@ -87,6 +87,51 @@ impl Reg { .bits, ); } + + /// Writes bits to a `Writable` register and produce a value. + /// + /// You can write raw bits into a register: + /// ```ignore + /// periph.reg.write_and(|w| unsafe { w.bits(rawbits); }); + /// ``` + /// or write only the fields you need: + /// ```ignore + /// periph.reg.write_and(|w| { + /// w.field1().bits(newfield1bits) + /// .field2().set_bit() + /// .field3().variant(VARIANT); + /// }); + /// ``` + /// or an alternative way of saying the same: + /// ```ignore + /// periph.reg.write_and(|w| { + /// w.field1().bits(newfield1bits); + /// w.field2().set_bit(); + /// w.field3().variant(VARIANT); + /// }); + /// ``` + /// In the latter case, other fields will be set to their reset value. + /// + /// Values can be returned from the closure: + /// ```ignore + /// let state = periph.reg.write_and(|w| State::set(w.field1())); + /// ``` + #[inline(always)] + pub fn write_and(&self, f: F) -> T + where + F: FnOnce(&mut W) -> T, + { + let mut writer = W { + bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }; + let result = f(&mut writer); + + self.register.set(writer.bits); + + result + } } impl Reg { @@ -110,6 +155,30 @@ impl Reg { .bits, ); } + + /// Writes 0 to a `Writable` register and produces a value. + /// + /// Similar to `write`, but unused bits will contain 0. + /// + /// # Safety + /// + /// Unsafe to use with registers which don't allow to write 0. + #[inline(always)] + pub unsafe fn write_with_zero(&self, f: F) -> T + where + F: FnOnce(&mut W) -> T, + { + let mut writer = W { + bits: REG::Ux::default(), + _reg: marker::PhantomData, + }; + + let result = f(&mut writer); + + self.register.set(writer.bits); + + result + } } impl Reg { @@ -159,11 +228,67 @@ impl Reg { .bits, ); } + + /// Modifies the contents of the register by reading and then writing it + /// and produces a value. + /// + /// E.g. to do a read-modify-write sequence to change parts of a register: + /// ```ignore + /// let bits = periph.reg.modify(|r, w| { + /// let new_bits = r.bits() | 3; + /// unsafe { + /// w.bits(new_bits); + /// } + /// + /// new_bits + /// }); + /// ``` + /// or + /// ```ignore + /// periph.reg.modify(|_, w| { + /// w.field1().bits(newfield1bits) + /// .field2().set_bit() + /// .field3().variant(VARIANT); + /// }); + /// ``` + /// or an alternative way of saying the same: + /// ```ignore + /// periph.reg.modify(|_, w| { + /// w.field1().bits(newfield1bits); + /// w.field2().set_bit(); + /// w.field3().variant(VARIANT); + /// }); + /// ``` + /// Other fields will have the value they had before the call to `modify`. + #[inline(always)] + pub fn modify_and(&self, f: F) -> T + where + for<'w> F: FnOnce(&R, &'w mut W) -> T, + { + let bits = self.register.get(); + + let mut writer = W { + bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }; + + let result = f( + &R { + bits, + _reg: marker::PhantomData, + }, + &mut writer, + ); + + self.register.set(writer.bits); + + result + } } impl core::fmt::Debug for crate::generic::Reg where - R: core::fmt::Debug + R: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt(&self.read(), f) From d0739ece626f32f8b70390715720398580d29c97 Mon Sep 17 00:00:00 2001 From: Adin Ackerman Date: Tue, 22 Oct 2024 08:53:05 -0700 Subject: [PATCH 30/77] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25439d50..13974e2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Skip generating `.add(0)` and `1 *` in accessors - Bump MSRV of generated code to 1.76 - move `must_use` from methods to generic type +- Add `write_and`, `write_with_zero_and`, and `modify_and` register modifiers ## [v0.33.5] - 2024-10-12 From 8b2cab5c1c4966d8f571ac4579b003293ff0d9c0 Mon Sep 17 00:00:00 2001 From: Adin Ackerman Date: Tue, 22 Oct 2024 08:59:30 -0700 Subject: [PATCH 31/77] fix typo --- src/generate/generic_reg_vcell.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generate/generic_reg_vcell.rs b/src/generate/generic_reg_vcell.rs index dc6445f0..36148635 100644 --- a/src/generate/generic_reg_vcell.rs +++ b/src/generate/generic_reg_vcell.rs @@ -164,7 +164,7 @@ impl Reg { /// /// Unsafe to use with registers which don't allow to write 0. #[inline(always)] - pub unsafe fn write_with_zero(&self, f: F) -> T + pub unsafe fn write_with_zero_and(&self, f: F) -> T where F: FnOnce(&mut W) -> T, { From 69f2444886a8dde437909dcba953a89f8a802441 Mon Sep 17 00:00:00 2001 From: Adin Ackerman Date: Tue, 22 Oct 2024 12:33:33 -0700 Subject: [PATCH 32/77] change names --- src/generate/generic_reg_vcell.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generate/generic_reg_vcell.rs b/src/generate/generic_reg_vcell.rs index 36148635..585c6e0c 100644 --- a/src/generate/generic_reg_vcell.rs +++ b/src/generate/generic_reg_vcell.rs @@ -117,7 +117,7 @@ impl Reg { /// let state = periph.reg.write_and(|w| State::set(w.field1())); /// ``` #[inline(always)] - pub fn write_and(&self, f: F) -> T + pub fn from_write(&self, f: F) -> T where F: FnOnce(&mut W) -> T, { @@ -164,7 +164,7 @@ impl Reg { /// /// Unsafe to use with registers which don't allow to write 0. #[inline(always)] - pub unsafe fn write_with_zero_and(&self, f: F) -> T + pub unsafe fn from_write_with_zero(&self, f: F) -> T where F: FnOnce(&mut W) -> T, { @@ -261,7 +261,7 @@ impl Reg { /// ``` /// Other fields will have the value they had before the call to `modify`. #[inline(always)] - pub fn modify_and(&self, f: F) -> T + pub fn from_modify(&self, f: F) -> T where for<'w> F: FnOnce(&R, &'w mut W) -> T, { From a0e833cc556f52890b16f4f3cb1d7e989f0f28f5 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Wed, 23 Oct 2024 15:59:24 +0000 Subject: [PATCH 33/77] Fix building without yaml feature --- CHANGELOG.md | 1 + src/generate/device.rs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25439d50..942676c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Fix building without `yaml` feature - Compatibility with `riscv` 0.12 and `riscv-rt` 0.13 - Add `riscv_config` section in `settings.yaml` It uses `riscv-pac` traits and standard `riscv-peripheral` peripherals. diff --git a/src/generate/device.rs b/src/generate/device.rs index 9f0ff909..4acf6609 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -9,7 +9,7 @@ use std::path::Path; use crate::config::{Config, Target}; use crate::util::{self, ident}; -use anyhow::{Context, Result}; +use anyhow::{anyhow, Context, Result}; use crate::generate::{interrupt, peripheral, riscv}; @@ -29,10 +29,15 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { let file = std::fs::read_to_string(settings).context("could not read settings file")?; Some(serde_yaml::from_str(&file).context("could not parse settings file")?) } + #[cfg(not(feature = "yaml"))] + Some(_) => { + return Err(anyhow!("Support for yaml config files is not available because svd2rust was compiled without the yaml feature")); + } None => None, }; From dfb10b1b2fbaab5a19ea1835b0890c9dded8869b Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Wed, 23 Oct 2024 16:12:58 +0000 Subject: [PATCH 34/77] Fix warning about unused import --- src/generate/device.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generate/device.rs b/src/generate/device.rs index 4acf6609..fdecb54b 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -9,7 +9,7 @@ use std::path::Path; use crate::config::{Config, Target}; use crate::util::{self, ident}; -use anyhow::{anyhow, Context, Result}; +use anyhow::{Context, Result}; use crate::generate::{interrupt, peripheral, riscv}; @@ -36,7 +36,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { - return Err(anyhow!("Support for yaml config files is not available because svd2rust was compiled without the yaml feature")); + return Err(anyhow::anyhow!("Support for yaml config files is not available because svd2rust was compiled without the yaml feature")); } None => None, }; From 224fc9de84040b03d9b98c93125a3cbe8f67069a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Wed, 23 Oct 2024 16:18:34 +0000 Subject: [PATCH 35/77] check compilation with no features --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6dec204..a7ec6239 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,9 @@ jobs: with: key: ${{ matrix.TARGET }} + - run: cargo check --target ${{ matrix.TARGET }} --no-default-features + env: + RUSTFLAGS: -D warnings - run: cargo check --target ${{ matrix.TARGET }} env: RUSTFLAGS: -D warnings From 5572cbd2746d7a2c9707fd78cdd7cf67fcad0db6 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Thu, 24 Oct 2024 08:29:42 +0300 Subject: [PATCH 36/77] Fix calculating mwv bitmasks with field arrays --- CHANGELOG.md | 1 + src/generate/register.rs | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34f493f6..5947100d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Fix calculating `modifiedWriteValues` bitmasks with field arrays - Fix building without `yaml` feature - Compatibility with `riscv` 0.12 and `riscv-rt` 0.13 - Add `riscv_config` section in `settings.yaml` diff --git a/src/generate/register.rs b/src/generate/register.rs index 0747b9a4..62984d3a 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -1343,15 +1343,23 @@ pub fn fields( } // Update register modify bit masks - let bitmask = (u64::MAX >> (64 - width)) << offset; - use ModifiedWriteValues::*; - match mwv { - Modify | Set | Clear => {} - OneToSet | OneToClear | OneToToggle => { - one_to_modify_fields_bitmap |= bitmask; - } - ZeroToClear | ZeroToSet | ZeroToToggle => { - zero_to_modify_fields_bitmap |= bitmask; + let offsets = match f { + MaybeArray::Array(info, dim) => (0..dim.dim) + .map(|i| i * dim.dim_increment + info.bit_offset()) + .collect(), + MaybeArray::Single(info) => vec![info.bit_offset()], + }; + for o in offsets { + let bitmask = (u64::MAX >> (64 - width)) << o; + use ModifiedWriteValues::*; + match mwv { + Modify | Set | Clear => {} + OneToSet | OneToClear | OneToToggle => { + one_to_modify_fields_bitmap |= bitmask; + } + ZeroToClear | ZeroToSet | ZeroToToggle => { + zero_to_modify_fields_bitmap |= bitmask; + } } } } From aebd7dce57d58ecb19f094567b79d854b2e59db7 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 20 Oct 2024 12:40:44 +0300 Subject: [PATCH 37/77] rm html_escape --- CHANGELOG.md | 1 + Cargo.lock | 16 ---------------- Cargo.toml | 1 - src/generate/interrupt.rs | 2 +- src/generate/peripheral.rs | 17 +++++++++-------- src/generate/register.rs | 36 ++++++++++++++++++------------------ src/generate/riscv.rs | 2 +- src/util.rs | 10 ++++++---- 8 files changed, 36 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5947100d..7b2d3295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Revert #711 - Fix calculating `modifiedWriteValues` bitmasks with field arrays - Fix building without `yaml` feature - Compatibility with `riscv` 0.12 and `riscv-rt` 0.13 diff --git a/Cargo.lock b/Cargo.lock index 6f55c94c..3c834cc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -519,15 +519,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "html-escape" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" -dependencies = [ - "utf8-width", -] - [[package]] name = "http" version = "0.2.12" @@ -1221,7 +1212,6 @@ dependencies = [ "anyhow", "clap", "env_logger", - "html-escape", "inflections", "irx-config", "log", @@ -1551,12 +1541,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utf8-width" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" - [[package]] name = "utf8parse" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index cd408230..897e6848 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ serde = { version = "1.0", optional = true } serde_json = { version = "1.0.85", optional = true } serde_yaml = { version = "0.9.11", optional = true } regex = "1.10.0" -html-escape = "0.2" url = { version = "2.5", features = ["serde"] } [dependencies.svd-parser] diff --git a/src/generate/interrupt.rs b/src/generate/interrupt.rs index 7417c382..2b8e59de 100644 --- a/src/generate/interrupt.rs +++ b/src/generate/interrupt.rs @@ -66,7 +66,7 @@ pub fn render( .map(util::respace) .as_deref() .map(util::escape_special_chars) - .unwrap_or_else(|| interrupt.0.name.clone()) + .unwrap_or_else(|| interrupt.0.name.as_str().into()) ); let value = util::unsuffixed(interrupt.0.value); diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 9e3101ec..407415f9 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -205,8 +205,8 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result } } - let description = - util::escape_special_chars(util::respace(p.description.as_ref().unwrap_or(&name)).as_ref()); + let description = util::respace(p.description.as_ref().unwrap_or(&name)); + let description = util::escape_special_chars(&description); // Build up an alternate erc list by expanding any derived registers/clusters // erc: *E*ither *R*egister or *C*luster @@ -511,7 +511,8 @@ impl FieldRegions { } fn make_comment(size: u32, offset: u32, description: &str) -> String { - let desc = util::escape_special_chars(&util::respace(description)); + let desc = util::respace(description); + let desc = util::escape_special_chars(&desc); if size > 32 { let end = offset + size / 8; format!("0x{offset:02x}..0x{end:02x} - {desc}") @@ -1149,7 +1150,7 @@ fn expand_register( .properties .size .ok_or_else(|| anyhow!("Register {} has no `size` field", register.name))?; - let description = register.description.clone().unwrap_or_default(); + let description = register.description.as_deref().unwrap_or_default(); let info_name = register.fullname(config.ignore_groups); let mut ty_name = if register.is_single() { @@ -1161,7 +1162,7 @@ fn expand_register( match register { Register::Single(info) => { - let doc = make_comment(register_size, info.address_offset, &description); + let doc = make_comment(register_size, info.address_offset, description); let span = Span::call_site(); let ty = name_to_ty(ident(&ty_str, config, "register", span)); let name: Ident = ident(&ty_name, config, "register_accessor", span); @@ -1236,7 +1237,7 @@ fn expand_register( let doc = make_comment( register_size * array_info.dim, info.address_offset, - &description, + description, ); let mut accessors = Vec::with_capacity((array_info.dim + 1) as _); let first_name = svd::array::names(info, array_info).next().unwrap(); @@ -1380,8 +1381,8 @@ fn cluster_block( index: &Index, config: &Config, ) -> Result { - let description = - util::escape_special_chars(&util::respace(c.description.as_ref().unwrap_or(&c.name))); + let description = util::respace(c.description.as_ref().unwrap_or(&c.name)); + let description = util::escape_special_chars(&description); let mod_name = c.name.remove_dim().to_string(); // name_snake_case needs to take into account array type. diff --git a/src/generate/register.rs b/src/generate/register.rs index 62984d3a..8ab2eeb3 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -65,13 +65,11 @@ pub fn render( let reg_ty = ident(&name, config, "register", span); let doc_alias = (reg_ty.to_string().as_str() != name).then(|| quote!(#[doc(alias = #name)])); let mod_ty = ident(&name, config, "register_mod", span); - let description = util::escape_special_chars( - util::respace(®ister.description.clone().unwrap_or_else(|| { - warn!("Missing description for register {}", register.name); - Default::default() - })) - .as_ref(), - ); + let description = util::respace(register.description.as_deref().unwrap_or_else(|| { + warn!("Missing description for register {}", register.name); + "" + })); + let description = util::escape_special_chars(&description); if let Some(dpath) = dpath.as_ref() { let mut derived = if &dpath.block == path { @@ -261,13 +259,11 @@ pub fn render_register_mod( rsize.next_power_of_two() }; let rty = rsize.to_ty()?; - let description = util::escape_special_chars( - util::respace(®ister.description.clone().unwrap_or_else(|| { - warn!("Missing description for register {rname}"); - Default::default() - })) - .as_ref(), - ); + let description = util::respace(®ister.description.as_deref().unwrap_or_else(|| { + warn!("Missing description for register {rname}"); + "" + })); + let description = util::escape_special_chars(&description); let mut mod_items = TokenStream::new(); @@ -898,7 +894,8 @@ pub fn fields( let pc = &v.pc; let is_variant = &v.is_sc; - let doc = util::escape_special_chars(&util::respace(&v.doc)); + let doc = util::respace(&v.doc); + let doc = util::escape_special_chars(&doc); enum_items.extend(quote! { #[doc = #doc] #inline @@ -911,7 +908,8 @@ pub fn fields( let pc = &v.pc; let is_variant = &v.is_sc; - let doc = util::escape_special_chars(&util::respace(&v.doc)); + let doc = util::respace(&v.doc); + let doc = util::escape_special_chars(&doc); enum_items.extend(quote! { #[doc = #doc] #inline @@ -1174,7 +1172,8 @@ pub fn fields( for v in &variants { let pc = &v.pc; let sc = &v.sc; - let doc = util::escape_special_chars(&util::respace(&v.doc)); + let doc = util::respace(&v.doc); + let doc = util::escape_special_chars(&doc); proxy_items.extend(quote! { #[doc = #doc] #inline @@ -1545,7 +1544,8 @@ fn add_from_variants<'a>( let mut vars = TokenStream::new(); for v in variants.map(|v| { - let desc = util::escape_special_chars(&util::respace(&format!("{}: {}", v.value, v.doc))); + let desc = util::respace(&format!("{}: {}", v.value, v.doc)); + let desc = util::escape_special_chars(&desc); let pcv = &v.pc; let pcval = &unsuffixed(v.value); quote! { diff --git a/src/generate/riscv.rs b/src/generate/riscv.rs index 9c834117..6911d76f 100644 --- a/src/generate/riscv.rs +++ b/src/generate/riscv.rs @@ -184,7 +184,7 @@ pub fn render( .map(|s| util::respace(s)) .as_ref() .map(|s| util::escape_special_chars(s)) - .unwrap_or_else(|| i.name.clone()) + .unwrap_or_else(|| i.name.as_str().into()) ); writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?; diff --git a/src/util.rs b/src/util.rs index 6f72a30b..3520bcf3 100644 --- a/src/util.rs +++ b/src/util.rs @@ -5,7 +5,6 @@ use crate::{ svd::{Access, Device, Field, RegisterInfo, RegisterProperties}, Config, }; -use html_escape::encode_text_minimal; use inflections::Inflect; use proc_macro2::{Ident, Span, TokenStream}; use quote::quote; @@ -179,9 +178,12 @@ pub fn escape_brackets(s: &str) -> String { } /// Escape basic html tags and brackets -pub fn escape_special_chars(s: &str) -> String { - let html_escaped = encode_text_minimal(s); - escape_brackets(&html_escaped) +pub fn escape_special_chars(s: &str) -> Cow<'_, str> { + if s.contains('[') { + escape_brackets(&s).into() + } else { + s.into() + } } pub fn name_of(maybe_array: &MaybeArray, ignore_group: bool) -> String { From 607e4b8125cb79066ab53b7487771126ee35e53f Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 20 Oct 2024 13:29:40 +0300 Subject: [PATCH 38/77] return raw value from write/modify --- CHANGELOG.md | 4 +- src/generate/generic_reg_vcell.rs | 63 +++++++++++++++---------------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b2d3295..88adc971 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Skip generating `.add(0)` and `1 *` in accessors - Bump MSRV of generated code to 1.76 - move `must_use` from methods to generic type -- Add `write_and`, `write_with_zero_and`, and `modify_and` register modifiers +- *breaking change* Return raw writtened value +- Add `from_write`, `from_write_with_zero`, and `from_modify` register modifiers + with generic return value ## [v0.33.5] - 2024-10-12 diff --git a/src/generate/generic_reg_vcell.rs b/src/generate/generic_reg_vcell.rs index 585c6e0c..b0ca0d5e 100644 --- a/src/generate/generic_reg_vcell.rs +++ b/src/generate/generic_reg_vcell.rs @@ -74,18 +74,18 @@ impl Reg { /// ``` /// In the latter case, other fields will be set to their reset value. #[inline(always)] - pub fn write(&self, f: F) + pub fn write(&self, f: F) -> REG::Ux where F: FnOnce(&mut W) -> &mut W, { - self.register.set( - f(&mut W { - bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP - | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, - _reg: marker::PhantomData, - }) - .bits, - ); + let value = f(&mut W { + bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }) + .bits; + self.register.set(value); + value } /// Writes bits to a `Writable` register and produce a value. @@ -143,17 +143,17 @@ impl Reg { /// /// Unsafe to use with registers which don't allow to write 0. #[inline(always)] - pub unsafe fn write_with_zero(&self, f: F) + pub unsafe fn write_with_zero(&self, f: F) -> REG::Ux where F: FnOnce(&mut W) -> &mut W, { - self.register.set( - f(&mut W { - bits: REG::Ux::default(), - _reg: marker::PhantomData, - }) - .bits, - ); + let value = f(&mut W { + bits: REG::Ux::default(), + _reg: marker::PhantomData, + }) + .bits; + self.register.set(value); + value } /// Writes 0 to a `Writable` register and produces a value. @@ -208,25 +208,24 @@ impl Reg { /// ``` /// Other fields will have the value they had before the call to `modify`. #[inline(always)] - pub fn modify(&self, f: F) + pub fn modify(&self, f: F) -> REG::Ux where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); - self.register.set( - f( - &R { - bits, - _reg: marker::PhantomData, - }, - &mut W { - bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP - | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, - _reg: marker::PhantomData, - }, - ) - .bits, - ); + let value = f( + &R { + bits, + _reg: marker::PhantomData, + }, + &mut W { + bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }, + ) + .bits; + self.register.set(value); + value } /// Modifies the contents of the register by reading and then writing it From 394a38907efc3f74e7fae23e3735ea1a787271f6 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 3 Nov 2024 11:10:51 +0300 Subject: [PATCH 39/77] broken link --- ci/script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/script.sh b/ci/script.sh index b0da0e4b..9f634458 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -589,7 +589,7 @@ main() { test_patched_stm32 stm32f7x3 test_patched_stm32 stm32g070 test_patched_stm32 stm32g473 - test_patched_stm32 stm32h753 + test_patched_stm32 stm32h743 test_patched_stm32 stm32l0x3 test_patched_stm32 stm32l162 test_patched_stm32 stm32l4x6 From df9ae4da6b649187e1195fd7b729da82d1ccb5a2 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 3 Nov 2024 09:57:28 +0300 Subject: [PATCH 40/77] add missing defmt impls --- CHANGELOG.md | 1 + src/generate/device.rs | 1 + src/generate/interrupt.rs | 2 ++ src/generate/riscv.rs | 13 ++++++++++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88adc971..db74a328 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] - Revert #711 +- Add `defmt` impls for `TryFromInterruptError`, riscv interrupt enums - Fix calculating `modifiedWriteValues` bitmasks with field arrays - Fix building without `yaml` feature - Compatibility with `riscv` 0.12 and `riscv-rt` 0.13 diff --git a/src/generate/device.rs b/src/generate/device.rs index fdecb54b..ec2ef6c6 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -217,6 +217,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Result { let mut mod_items = TokenStream::new(); + let defmt = config + .impl_defmt + .as_ref() + .map(|feature| quote!(#[cfg_attr(feature = #feature, derive(defmt::Format))])); + if let Some(c) = settings.riscv_config.as_ref() { if !c.core_interrupts.is_empty() { debug!("Rendering target-specific core interrupts"); @@ -48,6 +54,7 @@ pub fn render( mod_items.extend(quote! { /// Core interrupts. These interrupts are handled by the core itself. #[riscv::pac_enum(unsafe CoreInterruptNumber)] + #defmt #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum CoreInterrupt { #(#interrupts)* @@ -77,6 +84,7 @@ pub fn render( mod_items.extend(quote! { /// Exception sources in the device. #[riscv::pac_enum(unsafe ExceptionNumber)] + #defmt #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Exception { #(#exceptions)* @@ -102,6 +110,7 @@ pub fn render( mod_items.extend(quote! { /// Priority levels in the device #[riscv::pac_enum(unsafe PriorityNumber)] + #defmt #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Priority { #(#priorities)* @@ -124,6 +133,7 @@ pub fn render( mod_items.extend(quote! { /// HARTs in the device #[riscv::pac_enum(unsafe HartIdNumber)] + #defmt #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Hart { #(#harts)* @@ -197,6 +207,7 @@ pub fn render( mod_items.extend(quote! { /// External interrupts. These interrupts are handled by the external peripherals. #[riscv::pac_enum(unsafe ExternalInterruptNumber)] + #defmt #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ExternalInterrupt { #(#interrupts)* From bfe48e24926ad1444b08b8dd2cf573f6c18013d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Tue, 5 Nov 2024 14:28:33 +0100 Subject: [PATCH 41/77] Do not implement InterruptNumber for XtensaLx --- CHANGELOG.md | 1 + src/generate/interrupt.rs | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db74a328..6fdad6f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - *breaking change* Return raw writtened value - Add `from_write`, `from_write_with_zero`, and `from_modify` register modifiers with generic return value +- `InterruptNumber` is no longer implemented for Xtensa peripheral interrupts ## [v0.33.5] - 2024-10-12 diff --git a/src/generate/interrupt.rs b/src/generate/interrupt.rs index eb5cb711..498bdece 100644 --- a/src/generate/interrupt.rs +++ b/src/generate/interrupt.rs @@ -308,13 +308,6 @@ pub fn render( root.extend(quote! { #interrupt_enum - unsafe impl xtensa_lx::interrupt::InterruptNumber for Interrupt { - #[inline(always)] - fn number(#self_token) -> u16 { - #nr_expr - } - } - /// TryFromInterruptError #defmt #[derive(Debug, Copy, Clone)] From 8b2f7addb26410ccfa4c3f1bcf5f508b26815902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Tue, 5 Nov 2024 17:56:28 +0100 Subject: [PATCH 42/77] Remove unnecessary Espressif dependencies --- ci/script.sh | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/ci/script.sh b/ci/script.sh index 9f634458..3d71b080 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -613,23 +613,6 @@ main() { ;; Espressif) - echo '[dependencies.bare-metal]' >> $td/Cargo.toml - echo 'version = "1.0.0"' >> $td/Cargo.toml - - echo '[dependencies.riscv]' >> $td/Cargo.toml - echo 'version = "0.6.0"' >> $td/Cargo.toml - - echo '[dependencies.riscv-rt]' >> $td/Cargo.toml - echo 'version = "0.8.0"' >> $td/Cargo.toml - - echo '[dependencies.xtensa-lx]' >> $td/Cargo.toml - echo 'version = "0.6.0"' >> $td/Cargo.toml - echo 'features = ["esp32"]' >> $td/Cargo.toml - - echo '[dependencies.xtensa-lx-rt]' >> $td/Cargo.toml - echo 'version = "0.9.0"' >> $td/Cargo.toml - echo 'features = ["esp32"]' >> $td/Cargo.toml - test_svd_for_target riscv https://raw.githubusercontent.com/espressif/svd/main/svd/esp32c3.svd test_svd_for_target xtensa-lx https://raw.githubusercontent.com/espressif/svd/main/svd/esp32.svd From ae753d0eab2c494246fbda4a1d34fe5f1e2e92b0 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 3 Nov 2024 19:03:05 +0300 Subject: [PATCH 43/77] release 0.34.0 --- .github/workflows/ci.yml | 4 ++-- CHANGELOG.md | 7 ++++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7ec6239..bfde64b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,11 +153,11 @@ jobs: - name: Cache uses: Swatinem/rust-cache@v2 with: - key: svdtools-0.2.3 + key: svdtools-0.3.19 - name: Install svdtools run: | - cargo install svdtools --version 0.2.3 --target-dir target + cargo install svdtools --version 0.3.19 --target-dir target - name: Run CI script run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fdad6f3..64475b5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [v0.34.0] - 2024-11-05 + - Revert #711 - Add `defmt` impls for `TryFromInterruptError`, riscv interrupt enums - Fix calculating `modifiedWriteValues` bitmasks with field arrays @@ -922,7 +924,10 @@ peripheral.register.write(|w| w.field().set()); - Initial version of the `svd2rust` tool -[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...HEAD +[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.34.0...HEAD +[v0.34.0]: https://github.com/rust-embedded/svd2rust/compare/v0.33.5...v0.34.0 +[v0.33.5]: https://github.com/rust-embedded/svd2rust/compare/v0.33.4...v0.33.5 +[v0.33.4]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...v0.33.4 [v0.33.3]: https://github.com/rust-embedded/svd2rust/compare/v0.33.2...v0.33.3 [v0.33.2]: https://github.com/rust-embedded/svd2rust/compare/v0.33.1...v0.33.2 [v0.33.1]: https://github.com/rust-embedded/svd2rust/compare/v0.33.0...v0.33.1 diff --git a/Cargo.lock b/Cargo.lock index 3c834cc6..f235d118 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1207,7 +1207,7 @@ dependencies = [ [[package]] name = "svd2rust" -version = "0.33.5" +version = "0.34.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 897e6848..1d3e1a93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["svd", "embedded", "register", "map", "generator"] license = "MIT OR Apache-2.0" name = "svd2rust" repository = "https://github.com/rust-embedded/svd2rust/" -version = "0.33.5" +version = "0.34.0" readme = "README.md" rust-version = "1.74" From a371c1e4b939a60b8c3e60652eb86bd839919a27 Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Mon, 11 Nov 2024 01:25:54 -0500 Subject: [PATCH 44/77] Do not emit inner attributes for MSP430 with make_mod option active. --- CHANGELOG.md | 2 ++ src/generate/device.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64475b5a..56d6f7e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Fix MSP430 PAC inner attribute generation when used with the `-m` switch. + ## [v0.34.0] - 2024-11-05 - Revert #711 diff --git a/src/generate/device.rs b/src/generate/device.rs index ec2ef6c6..677b7e8d 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -41,7 +41,8 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result None, }; - if config.target == Target::Msp430 { + // make_mod option explicitly disables inner attributes. + if config.target == Target::Msp430 && !config.make_mod { out.extend(quote! { #![feature(abi_msp430_interrupt)] }); From dc9db51dae0d938f675648a3b6726ec1b0ae972a Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Mon, 11 Nov 2024 17:40:48 +0300 Subject: [PATCH 45/77] inline Settings into Config --- CHANGELOG.md | 1 + src/config.rs | 18 ++++++++++++++++-- src/generate/device.rs | 27 +++------------------------ src/generate/peripheral.rs | 2 +- src/generate/register.rs | 2 +- src/generate/riscv.rs | 5 ++--- src/lib.rs | 16 ++++++++++++++++ src/main.rs | 25 ++++++++++++++++--------- 8 files changed, 56 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56d6f7e9..2da11759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Inline `Settings` into `Config`, add `settings_file` - Fix MSP430 PAC inner attribute generation when used with the `-m` switch. ## [v0.34.0] - 2024-11-05 diff --git a/src/config.rs b/src/config.rs index 5a48105c..b206d075 100644 --- a/src/config.rs +++ b/src/config.rs @@ -35,9 +35,10 @@ pub struct Config { pub ident_formats_theme: Option, pub field_names_for_enums: bool, pub base_address_shift: u64, - pub html_url: Option, /// Path to YAML file with chip-specific settings - pub settings: Option, + pub settings_file: Option, + /// Chip-specific settings + pub settings: Settings, } #[allow(clippy::upper_case_acronyms)] @@ -320,8 +321,21 @@ pub enum IdentFormatsTheme { #[non_exhaustive] /// Chip-specific settings pub struct Settings { + /// Path to chip HTML generated by svdtools + pub html_url: Option, /// RISC-V specific settings pub riscv_config: Option, } +impl Settings { + pub fn update_from(&mut self, source: Self) { + if source.html_url.is_some() { + self.html_url = source.html_url; + } + if source.riscv_config.is_some() { + self.riscv_config = source.riscv_config; + } + } +} + pub mod riscv; diff --git a/src/generate/device.rs b/src/generate/device.rs index 677b7e8d..d2b3ee9c 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -28,19 +28,6 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { - let file = std::fs::read_to_string(settings).context("could not read settings file")?; - Some(serde_yaml::from_str(&file).context("could not parse settings file")?) - } - #[cfg(not(feature = "yaml"))] - Some(_) => { - return Err(anyhow::anyhow!("Support for yaml config files is not available because svd2rust was compiled without the yaml feature")); - } - None => None, - }; - // make_mod option explicitly disables inner attributes. if config.target == Target::Msp430 && !config.make_mod { out.extend(quote! { @@ -203,7 +190,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { - if settings.is_none() { + if config.settings.riscv_config.is_none() { warn!("No settings file provided for RISC-V target. Using legacy interrupts rendering"); warn!("Please, consider migrating your PAC to riscv 0.12.0 or later"); out.extend(interrupt::render( @@ -214,12 +201,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { @@ -241,10 +223,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Result } }; - let phtml = config.html_url.as_ref().map(|url| { + let phtml = config.settings.html_url.as_ref().map(|url| { let doc = format!("See peripheral [structure]({url}#{})", &path.peripheral); quote!(#[doc = ""] #[doc = #doc]) }); diff --git a/src/generate/register.rs b/src/generate/register.rs index 8ab2eeb3..f5abfa65 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -210,7 +210,7 @@ fn api_docs( doc.push_str("See [API](https://docs.rs/svd2rust/#read--modify--write-api)."); - if let Some(url) = config.html_url.as_ref() { + if let Some(url) = config.settings.html_url.as_ref() { let first_idx = if let Register::Array(_, dim) = ®ister { dim.indexes().next() } else { diff --git a/src/generate/riscv.rs b/src/generate/riscv.rs index 9436ef9d..fff9e970 100644 --- a/src/generate/riscv.rs +++ b/src/generate/riscv.rs @@ -20,7 +20,6 @@ pub fn is_riscv_peripheral(p: &Peripheral, s: &Settings) -> bool { pub fn render( peripherals: &[Peripheral], device_x: &mut String, - settings: &Settings, config: &Config, ) -> Result { let mut mod_items = TokenStream::new(); @@ -30,7 +29,7 @@ pub fn render( .as_ref() .map(|feature| quote!(#[cfg_attr(feature = #feature, derive(defmt::Format))])); - if let Some(c) = settings.riscv_config.as_ref() { + if let Some(c) = config.settings.riscv_config.as_ref() { if !c.core_interrupts.is_empty() { debug!("Rendering target-specific core interrupts"); writeln!(device_x, "/* Core interrupt sources and trap handlers */")?; @@ -216,7 +215,7 @@ pub fn render( } let mut riscv_peripherals = TokenStream::new(); - if let Some(c) = &settings.riscv_config { + if let Some(c) = config.settings.riscv_config.as_ref() { let harts = match c.harts.is_empty() { true => vec![], false => c diff --git a/src/lib.rs b/src/lib.rs index edec886e..b5d5c4ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -628,6 +628,22 @@ pub fn generate(input: &str, config: &Config) -> Result { use std::fmt::Write; let mut config = config.clone(); + + match config.settings_file.as_ref() { + #[cfg(feature = "yaml")] + Some(settings) => { + let file = std::fs::read_to_string(settings).context("could not read settings file")?; + config + .settings + .update_from(serde_yaml::from_str(&file).context("could not parse settings file")?) + } + #[cfg(not(feature = "yaml"))] + Some(_) => { + return Err(anyhow::anyhow!("Support for yaml config files is not available because svd2rust was compiled without the yaml feature")); + } + None => {} + }; + let mut ident_formats = match config.ident_formats_theme { Some(IdentFormatsTheme::Legacy) => IdentFormats::legacy_theme(), _ => IdentFormats::default_theme(), diff --git a/src/main.rs b/src/main.rs index 880bb4ab..27607bfc 100755 --- a/src/main.rs +++ b/src/main.rs @@ -101,7 +101,7 @@ fn run() -> Result<()> { .value_name("TOML_FILE"), ) .arg( - Arg::new("settings") + Arg::new("settings_file") .long("settings") .help("Target-specific settings YAML file") .action(ArgAction::Set) @@ -276,14 +276,6 @@ Allowed cases are `unchanged` (''), `pascal` ('p'), `constant` ('c') and `snake` Useful for soft-cores where the peripheral address range isn't necessarily fixed. Ignore this option if you are not building your own FPGA based soft-cores."), ) - .arg( - Arg::new("html_url") - .long("html-url") - .alias("html_url") - .help("Path to chip HTML generated by svdtools") - .action(ArgAction::Set) - .value_name("URL"), - ) .arg( Arg::new("log_level") .long("log") @@ -330,6 +322,21 @@ Ignore this option if you are not building your own FPGA based soft-cores."), } } + match config.settings_file.as_ref() { + #[cfg(feature = "yaml")] + Some(settings) => { + let file = std::fs::read_to_string(settings).context("could not read settings file")?; + config + .settings + .update_from(serde_yaml::from_str(&file).context("could not parse settings file")?) + } + #[cfg(not(feature = "yaml"))] + Some(_) => { + return Err(anyhow::anyhow!("Support for yaml config files is not available because svd2rust was compiled without the yaml feature")); + } + None => {} + }; + if let Some(file) = config.input.as_ref() { config.source_type = SourceType::from_path(file) } From 8776231b9de4a42fe929609b9d8c9a34379a9ba9 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Mon, 11 Nov 2024 18:51:21 +0300 Subject: [PATCH 46/77] crate_path --- CHANGELOG.md | 1 + src/config.rs | 41 +++++++++++++++++++++++++++++++++++++++++ src/util.rs | 10 +++++----- 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2da11759..ceff291e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Add `crate_path` setting - Inline `Settings` into `Config`, add `settings_file` - Fix MSP430 PAC inner attribute generation when used with the `-m` switch. diff --git a/src/config.rs b/src/config.rs index b206d075..dc4d0803 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,9 +1,14 @@ use anyhow::{bail, Result}; +use proc_macro2::Span; use std::{ collections::HashMap, ops::{Deref, DerefMut}, path::{Path, PathBuf}, + str::FromStr, }; +use syn::{punctuated::Punctuated, Ident}; + +use crate::util::path_segment; #[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] #[derive(Clone, PartialEq, Eq, Debug, Default)] @@ -323,6 +328,7 @@ pub enum IdentFormatsTheme { pub struct Settings { /// Path to chip HTML generated by svdtools pub html_url: Option, + pub crate_path: Option, /// RISC-V specific settings pub riscv_config: Option, } @@ -332,10 +338,45 @@ impl Settings { if source.html_url.is_some() { self.html_url = source.html_url; } + if source.crate_path.is_some() { + self.crate_path = source.crate_path; + } if source.riscv_config.is_some() { self.riscv_config = source.riscv_config; } } } +#[derive(Clone, PartialEq, Eq, Debug)] +pub struct CratePath(pub syn::Path); + +impl Default for CratePath { + fn default() -> Self { + let mut segments = Punctuated::new(); + segments.push(path_segment(Ident::new("crate", Span::call_site()))); + Self(syn::Path { + leading_colon: None, + segments, + }) + } +} + +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CratePath { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap()) + } +} + +impl FromStr for CratePath { + type Err = syn::Error; + fn from_str(s: &str) -> std::result::Result { + syn::parse_str(&s).map(Self) + } +} + pub mod riscv; diff --git a/src/util.rs b/src/util.rs index 3520bcf3..b1d7ee45 100644 --- a/src/util.rs +++ b/src/util.rs @@ -293,18 +293,18 @@ pub fn block_path_to_ty( config: &Config, span: Span, ) -> TypePath { - let mut segments = Punctuated::new(); - segments.push(path_segment(Ident::new("crate", span))); - segments.push(path_segment(ident( + let mut path = config.settings.crate_path.clone().unwrap_or_default().0; + path.segments.push(path_segment(ident( &bpath.peripheral, config, "peripheral_mod", span, ))); for ps in &bpath.path { - segments.push(path_segment(ident(ps, config, "cluster_mod", span))); + path.segments + .push(path_segment(ident(ps, config, "cluster_mod", span))); } - type_path(segments) + TypePath { qself: None, path } } pub fn register_path_to_ty( From 5da48b9759f7acb57111194e9ae4993c77b34a2c Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Tue, 12 Nov 2024 16:50:18 +0300 Subject: [PATCH 47/77] release 0.35.0 --- CHANGELOG.md | 5 +- Cargo.lock | 612 +++++++++++++++++++++++++++------------ Cargo.toml | 2 +- src/config.rs | 2 +- src/generate/register.rs | 2 +- src/util.rs | 2 +- 6 files changed, 431 insertions(+), 194 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ceff291e..1eb5bc5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [v0.35.0] - 2024-11-12 + - Add `crate_path` setting - Inline `Settings` into `Config`, add `settings_file` - Fix MSP430 PAC inner attribute generation when used with the `-m` switch. @@ -928,7 +930,8 @@ peripheral.register.write(|w| w.field().set()); - Initial version of the `svd2rust` tool -[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.34.0...HEAD +[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.35.0...HEAD +[v0.35.0]: https://github.com/rust-embedded/svd2rust/compare/v0.34.0...v0.35.0 [v0.34.0]: https://github.com/rust-embedded/svd2rust/compare/v0.33.5...v0.34.0 [v0.33.5]: https://github.com/rust-embedded/svd2rust/compare/v0.33.4...v0.33.5 [v0.33.4]: https://github.com/rust-embedded/svd2rust/compare/v0.33.3...v0.33.4 diff --git a/Cargo.lock b/Cargo.lock index f235d118..9dc97544 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -43,49 +43,49 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -95,23 +95,23 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -151,15 +151,15 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.13" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" dependencies = [ "shlex", ] @@ -172,9 +172,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.16" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -182,9 +182,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -194,14 +194,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.87", ] [[package]] @@ -212,15 +212,15 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" @@ -329,6 +329,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" version = "1.13.0" @@ -337,9 +348,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -385,9 +396,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "fnv" @@ -421,42 +432,42 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-io", @@ -469,9 +480,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" @@ -494,9 +505,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" [[package]] name = "heck" @@ -543,9 +554,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -561,9 +572,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -596,6 +607,124 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -604,19 +733,30 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] name = "indexmap" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown", @@ -630,9 +770,9 @@ checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "irx-config" @@ -664,9 +804,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -679,9 +819,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "linux-raw-sys" @@ -689,6 +829,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "log" version = "0.4.22" @@ -718,11 +864,11 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -766,24 +912,24 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -802,7 +948,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.87", ] [[package]] @@ -813,9 +959,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -837,9 +983,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -849,34 +995,34 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.75", + "syn 2.0.87", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -903,14 +1049,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] @@ -924,13 +1070,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -941,9 +1087,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" @@ -999,9 +1145,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags 2.6.0", "errno", @@ -1027,11 +1173,11 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1049,9 +1195,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -1059,29 +1205,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.208" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -1091,9 +1237,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -1169,6 +1315,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.10.0" @@ -1207,7 +1359,7 @@ dependencies = [ [[package]] name = "svd2rust" -version = "0.34.0" +version = "0.35.0" dependencies = [ "anyhow", "clap", @@ -1223,7 +1375,7 @@ dependencies = [ "serde_yaml", "svd-parser", "svd-rs", - "syn 2.0.75", + "syn 2.0.87", "thiserror", "url", ] @@ -1242,7 +1394,7 @@ dependencies = [ "serde_yaml", "shell-words", "svd2rust", - "syn 2.0.75", + "syn 2.0.87", "thiserror", "tracing", "tracing-subscriber", @@ -1263,9 +1415,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -1278,6 +1430,17 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -1301,9 +1464,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -1314,22 +1477,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.87", ] [[package]] @@ -1343,25 +1506,20 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.8.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" -version = "1.39.3" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -1384,9 +1542,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -1454,7 +1612,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.87", ] [[package]] @@ -1502,26 +1660,11 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unsafe-libyaml" @@ -1531,9 +1674,9 @@ checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", @@ -1541,6 +1684,18 @@ dependencies = [ "serde", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -1576,9 +1731,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -1587,24 +1742,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -1614,9 +1769,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1624,28 +1779,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -1666,9 +1821,9 @@ dependencies = [ [[package]] name = "wildmatch" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3928939971918220fed093266b809d1ee4ec6c1a2d72692ff6876898f3b16c19" +checksum = "68ce1ab1f8c62655ebe1350f589c61e505cf94d385bc6a12899442d9081e71fd" [[package]] name = "winapi" @@ -1858,3 +2013,82 @@ dependencies = [ "cfg-if", "windows-sys 0.48.0", ] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/Cargo.toml b/Cargo.toml index 1d3e1a93..0acbc255 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["svd", "embedded", "register", "map", "generator"] license = "MIT OR Apache-2.0" name = "svd2rust" repository = "https://github.com/rust-embedded/svd2rust/" -version = "0.34.0" +version = "0.35.0" readme = "README.md" rust-version = "1.74" diff --git a/src/config.rs b/src/config.rs index dc4d0803..ca6ced37 100644 --- a/src/config.rs +++ b/src/config.rs @@ -375,7 +375,7 @@ impl<'de> serde::Deserialize<'de> for CratePath { impl FromStr for CratePath { type Err = syn::Error; fn from_str(s: &str) -> std::result::Result { - syn::parse_str(&s).map(Self) + syn::parse_str(s).map(Self) } } diff --git a/src/generate/register.rs b/src/generate/register.rs index f5abfa65..92322ebe 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -259,7 +259,7 @@ pub fn render_register_mod( rsize.next_power_of_two() }; let rty = rsize.to_ty()?; - let description = util::respace(®ister.description.as_deref().unwrap_or_else(|| { + let description = util::respace(register.description.as_deref().unwrap_or_else(|| { warn!("Missing description for register {rname}"); "" })); diff --git a/src/util.rs b/src/util.rs index b1d7ee45..5c56f3c3 100644 --- a/src/util.rs +++ b/src/util.rs @@ -180,7 +180,7 @@ pub fn escape_brackets(s: &str) -> String { /// Escape basic html tags and brackets pub fn escape_special_chars(s: &str) -> Cow<'_, str> { if s.contains('[') { - escape_brackets(&s).into() + escape_brackets(s).into() } else { s.into() } From ca77c0c0e2beff4d5f16362b5a7f9b6905e24b7d Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Wed, 11 Dec 2024 23:52:25 +0300 Subject: [PATCH 48/77] edition=2021 --- ci/script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/script.sh b/ci/script.sh index 3d71b080..6524bb60 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -39,7 +39,7 @@ main() { esac # test crate - cargo init --lib --name foo $td + cargo init --lib --name foo --edition 2021 $td echo 'cortex-m = "0.7.7"' >> $td/Cargo.toml echo 'cortex-m-rt = "0.7.3"' >> $td/Cargo.toml echo 'vcell = "0.1.3"' >> $td/Cargo.toml From 8dec06c55ea84791f208fd84fea7428c4c6f3eb2 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 14 Dec 2024 19:57:43 +0300 Subject: [PATCH 49/77] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eb5bc5c..9ee8ba46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Force using rust edition 2021 in CI + ## [v0.35.0] - 2024-11-12 - Add `crate_path` setting From a25d22c57afcaee4cba4ce9691b3418c2e16f2aa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Jan 2025 12:48:19 +0100 Subject: [PATCH 50/77] lifetime ellision for FieldWriter to fix clippy warning --- src/generate/generic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generate/generic.rs b/src/generate/generic.rs index 706b7e12..19c8230b 100644 --- a/src/generate/generic.rs +++ b/src/generate/generic.rs @@ -337,7 +337,7 @@ pub struct RangeTo; /// Write field Proxy pub type FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> = raw::FieldWriter<'a, REG, WI, FI, Safety>; -impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety> +impl FieldWriter<'_, REG, WI, FI, Safety> where REG: Writable + RegisterSpec, FI: FieldSpec, From 0aa3310904fb5015672cd5381e618319cc7f0506 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Mon, 13 Jan 2025 18:11:27 +0300 Subject: [PATCH 51/77] fix F723 url --- ci/script.sh | 2 +- ci/svd2rust-regress/tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/script.sh b/ci/script.sh index 6524bb60..01c05a89 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -586,7 +586,7 @@ main() { test_patched_stm32 stm32f103 test_patched_stm32 stm32f411 test_patched_stm32 stm32f469 - test_patched_stm32 stm32f7x3 + test_patched_stm32 stm32f723 test_patched_stm32 stm32g070 test_patched_stm32 stm32g473 test_patched_stm32 stm32h743 diff --git a/ci/svd2rust-regress/tests.yml b/ci/svd2rust-regress/tests.yml index 6ed7ebbe..06501c71 100644 --- a/ci/svd2rust-regress/tests.yml +++ b/ci/svd2rust-regress/tests.yml @@ -1863,8 +1863,8 @@ svd_url: https://stm32-rs.github.io/stm32-rs/stm32f469.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32F7x3 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32f7x3.svd.patched + chip: STM32F723 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f723.svd.patched - arch: cortex-m mfgr: STMicro chip: STM32G070 From 2ad6e0cb33c794ce99701520cbbeb3f470f5fdc9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Jan 2025 18:05:17 +0100 Subject: [PATCH 52/77] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee8ba46..c07b8cae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] - Force using rust edition 2021 in CI +- Added lifetime ellision for `FieldWriter` where the explicit lifetimes are not necessary, which + fixes the `clippy::needless_lifetimes` warning on rustc 1.84 ## [v0.35.0] - 2024-11-12 From f08aadf80114742df192ff63eafd9bc87458a36b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Jan 2025 12:46:44 +0100 Subject: [PATCH 53/77] svd2rust-regress fixes and update of its docs --- CHANGELOG.md | 1 + ci/svd2rust-regress/README.md | 49 ++++------------------------- ci/svd2rust-regress/src/diff.rs | 6 ++-- ci/svd2rust-regress/src/main.rs | 2 +- ci/svd2rust-regress/src/svd_test.rs | 15 ++++++--- 5 files changed, 22 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c07b8cae..89cbd574 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Force using rust edition 2021 in CI - Added lifetime ellision for `FieldWriter` where the explicit lifetimes are not necessary, which fixes the `clippy::needless_lifetimes` warning on rustc 1.84 +- Some fixes for the `svd2rust-regress` tool and update of its documentation ## [v0.35.0] - 2024-11-12 diff --git a/ci/svd2rust-regress/README.md b/ci/svd2rust-regress/README.md index 5c623cc7..e4f8da17 100644 --- a/ci/svd2rust-regress/README.md +++ b/ci/svd2rust-regress/README.md @@ -40,36 +40,11 @@ If all test cases passed, the return code will be `0`. If any test cases failed, ### Options -Here are the options for running `svd2rust-regress`: - +You can display options for `svd2rust-regress` by running: ```text -svd2rust-regress 0.1.0 -James Munns :The svd2rust developers - -USAGE: - svd2rust-regress [FLAGS] [OPTIONS] - -FLAGS: - -b, --bad-tests Include tests expected to fail (will cause a non-zero return code) - -f, --format Enable formatting with `rustfmt` - -h, --help Prints help information - -l, --long-test Run a long test (it's very long) - -V, --version Prints version information - -v, --verbose Use verbose output - -OPTIONS: - -a, --architecture - Filter by architecture, case sensitive, may be combined with other filters Options are: "CortexM", "RiscV", "Msp430", "Mips" and "XtensaLX" - -p, --svd2rust-path - Path to an `svd2rust` binary, relative or absolute. Defaults to `target/release/svd2rust[.exe]` of this - repository (which must be already built) - -c, --chip Filter by chip name, case sensitive, may be combined with other filters - -m, --manufacturer - Filter by manufacturer, case sensitive, may be combined with other filters - - --rustfmt_bin_path - Path to an `rustfmt` binary, relative or absolute. Defaults to `$(rustup which rustfmt)` +# in the ci/svd2rust-regress folder +cargo regress help ``` ### Filters @@ -80,28 +55,16 @@ For example, to run all `RiscV` tests: ```bash # in the ci/svd2rust-regress folder -cargo run --release -- -a RiscV - Finished release [optimized] target(s) in 0.0 secs - Running `target/release/svd2rust-regress -a RiscV` -Passed: si_five_e310x - 7 seconds +cargo regress tests --architecture riscv ``` To run against any chip named `MB9AF12xK`: ```bash -cargo run --release -- --long-test -c MB9AF12xK - Finished release [optimized] target(s) in 0.0 secs - Running `target/release/svd2rust-regress --long-test -c MB9AF12xK` -Passed: spansion_mb9af12x_k - 23 seconds -Passed: fujitsu_mb9af12x_k - 25 seconds +cargo regress test -c MB9AF12xK ``` To run against specifically the `Fujitsu` `MB9AF12xK`: ```bash -cargo run --release -- --long-test -c MB9AF12xK -m Fujitsu - Finished release [optimized] target(s) in 0.0 secs - Running `target/release/svd2rust-regress --long-test -c MB9AF12xK -m Fujitsu` -Passed: fujitsu_mb9af12x_k - 19 seconds +cargo regress test -c MB9AF12xK -m Fujitsu ``` - -Note that you may have to pass `--long-test` to enable some chips as they are known to take a long time to compile. diff --git a/ci/svd2rust-regress/src/diff.rs b/ci/svd2rust-regress/src/diff.rs index 3220157f..d155c56a 100644 --- a/ci/svd2rust-regress/src/diff.rs +++ b/ci/svd2rust-regress/src/diff.rs @@ -257,8 +257,8 @@ impl Diffing { Ok([baseline, current]) } - fn get_source_and_command<'s>(&'s self) -> [Option<(Source, Command)>; 2] { - let split = |s: &'s str| -> (Source, Command) { + fn get_source_and_command(&self) -> [Option<(Source, Command)>; 2] { + fn split(s: &str) -> (Source, Command) { if let Some(s) = s.strip_prefix('@') { if let Some((source, cmd)) = s.split_once(' ') { (Some(source), Some(cmd.trim())) @@ -268,7 +268,7 @@ impl Diffing { } else { (None, Some(s.trim())) } - }; + } let baseline = self.baseline.as_deref().map(split); diff --git a/ci/svd2rust-regress/src/main.rs b/ci/svd2rust-regress/src/main.rs index 4d32f1ac..4d0fdf77 100644 --- a/ci/svd2rust-regress/src/main.rs +++ b/ci/svd2rust-regress/src/main.rs @@ -138,7 +138,7 @@ pub struct Test { #[arg(long = "svd", group = "svd_source")] /// Path to SVD file to test pub svd_file: Option, - #[arg(long, group = "svd_source")] + #[arg(short = 'c', long, group = "svd_source")] /// Chip to use, use `--url` or `--svd-file` for another way to specify svd pub chip: Option, diff --git a/ci/svd2rust-regress/src/svd_test.rs b/ci/svd2rust-regress/src/svd_test.rs index 30033dbd..97de00da 100644 --- a/ci/svd2rust-regress/src/svd_test.rs +++ b/ci/svd2rust-regress/src/svd_test.rs @@ -11,17 +11,22 @@ use std::{ path::Path, }; -const CRATES_ALL: &[&str] = &["critical-section = \"1.0\"", "vcell = \"0.1.2\""]; +const CRATES_ALL: &[&str] = &[ + "critical-section = {version = \"1.0\", optional = true}", + "vcell = \"0.1.2\"", +]; const CRATES_MSP430: &[&str] = &["msp430 = \"0.4.0\"", "msp430-rt = \"0.4.0\""]; const CRATES_ATOMICS: &[&str] = &["portable-atomic = { version = \"0.3.16\", default-features = false }"]; -const CRATES_CORTEX_M: &[&str] = &["cortex-m = \"0.7.6\"", "cortex-m-rt = \"0.6.13\""]; +const CRATES_CORTEX_M: &[&str] = &["cortex-m = \"0.7.6\"", "cortex-m-rt = \"0.7\""]; const CRATES_RISCV: &[&str] = &["riscv = \"0.12.1\"", "riscv-rt = \"0.13.0\""]; const CRATES_XTENSALX: &[&str] = &["xtensa-lx-rt = \"0.9.0\"", "xtensa-lx = \"0.6.0\""]; const CRATES_MIPS: &[&str] = &["mips-mcu = \"0.1.0\""]; const PROFILE_ALL: &[&str] = &["[profile.dev]", "incremental = false"]; const FEATURES_ALL: &[&str] = &["[features]"]; +const FEATURES_CORTEX_M: &[&str] = &["rt = [\"cortex-m-rt/device\"]"]; const FEATURES_XTENSALX: &[&str] = &["default = [\"xtensa-lx/esp32\", \"xtensa-lx-rt/esp32\"]"]; +const WORKSPACE_EXCLUDE: &[&str] = &["[workspace]"]; fn path_helper_base(base: &Path, input: &[&str]) -> PathBuf { input @@ -210,10 +215,10 @@ impl TestCase { let svd_toml = path_helper_base(&chip_dir, &["Cargo.toml"]); let mut file = OpenOptions::new() - .write(true) .append(true) .open(svd_toml) .with_context(|| "Failed to open Cargo.toml for appending")?; + let crates = CRATES_ALL .iter() .chain(match &self.arch { @@ -233,8 +238,10 @@ impl TestCase { .chain(FEATURES_ALL.iter()) .chain(match &self.arch { Target::XtensaLX => FEATURES_XTENSALX.iter(), + Target::CortexM => FEATURES_CORTEX_M.iter(), _ => [].iter(), - }); + }) + .chain(WORKSPACE_EXCLUDE.iter()); for c in crates { writeln!(file, "{}", c).with_context(|| "Failed to append to file!")?; } From 40dc8caff952f3027d7d7de0074af121a285af09 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 15 Jan 2025 17:19:45 +0100 Subject: [PATCH 54/77] more clippy fixes --- CHANGELOG.md | 2 ++ ci/svd2rust-regress/src/github.rs | 2 +- src/generate/peripheral.rs | 2 +- src/generate/register.rs | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89cbd574..91612ace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Added lifetime ellision for `FieldWriter` where the explicit lifetimes are not necessary, which fixes the `clippy::needless_lifetimes` warning on rustc 1.84 - Some fixes for the `svd2rust-regress` tool and update of its documentation +- Other internal clippy fixes for `clippy::manual_div_ceil`, `clippy::nonminimal_bool` and + `clippy::needless_lifetimes` ## [v0.35.0] - 2024-11-12 diff --git a/ci/svd2rust-regress/src/github.rs b/ci/svd2rust-regress/src/github.rs index 1a5b0ecb..5dc68508 100644 --- a/ci/svd2rust-regress/src/github.rs +++ b/ci/svd2rust-regress/src/github.rs @@ -93,7 +93,7 @@ fn find_executable(dir: &Path, begins: &str) -> Result, anyhow:: .path() .extension() .is_some_and(|s| s == std::env::consts::EXE_EXTENSION)) - && !entry.path().extension().is_some_and(|s| s == "gz") + && entry.path().extension().is_none_or(|s| s != "gz") { Ok(Some(entry.path())) } else { diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 40372906..5fd01178 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -411,7 +411,7 @@ impl FieldRegions { let mut indices = Vec::new(); let rbf_start = rbf.offset; - let rbf_end = rbf_start + (rbf.size + BITS_PER_BYTE - 1) / BITS_PER_BYTE; + let rbf_end = rbf_start + rbf.size.div_ceil(BITS_PER_BYTE); // The region that we're going to insert let mut new_region = Region { diff --git a/src/generate/register.rs b/src/generate/register.rs index 92322ebe..56e72472 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -519,7 +519,7 @@ pub enum EV<'a> { Derived(&'a EnumeratedValues, &'a EnumPath), } -impl<'a> EV<'a> { +impl EV<'_> { fn values(&self) -> &EnumeratedValues { match self { Self::New(e) | Self::Derived(e, _) => e, From cc1bffbb0c2af8b031295d5bea3c11cc18170f50 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 31 Jan 2025 09:57:34 +0300 Subject: [PATCH 55/77] normalize paths --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 6 +++--- CHANGELOG.md | 1 + src/util.rs | 12 ++++++++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfde64b9..0244ff3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,7 +197,7 @@ jobs: runs-on: windows-latest suffix: .exe steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: @@ -213,7 +213,7 @@ jobs: - run: mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix || '' }} svd2rust-${{ matrix.target }}-$(git rev-parse --short HEAD)${{ matrix.suffix || '' }} - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifact-svd2rust-${{ matrix.target }} path: svd2rust-${{ matrix.target }}* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77ebdd1b..c9ce19be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: if: ${{ matrix.os == 'windows-latest' }} run: mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix }} svd2rust-${{ matrix.target }}${{ matrix.suffix }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: svd2rust-${{ matrix.target }} path: svd2rust-${{ matrix.target }}${{ matrix.suffix }} @@ -63,7 +63,7 @@ jobs: needs: [build] steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: path: artifacts - run: ls -R ./artifacts @@ -76,7 +76,7 @@ jobs: with: version: ${{ (github.ref_type == 'tag' && github.ref_name) || 'Unreleased' }} - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.changelog-reader.outputs.version }} name: ${{ (github.ref_type == 'tag' && steps.changelog-reader.outputs.version) || format('Prereleased {0}', env.CURRENT_DATE) }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 91612ace..312c949a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Fix reexport path when "%s" inside "derivedFrom" - Force using rust edition 2021 in CI - Added lifetime ellision for `FieldWriter` where the explicit lifetimes are not necessary, which fixes the `clippy::needless_lifetimes` warning on rustc 1.84 diff --git a/src/util.rs b/src/util.rs index 5c56f3c3..f97cb378 100644 --- a/src/util.rs +++ b/src/util.rs @@ -295,14 +295,18 @@ pub fn block_path_to_ty( ) -> TypePath { let mut path = config.settings.crate_path.clone().unwrap_or_default().0; path.segments.push(path_segment(ident( - &bpath.peripheral, + &bpath.peripheral.remove_dim(), config, "peripheral_mod", span, ))); for ps in &bpath.path { - path.segments - .push(path_segment(ident(ps, config, "cluster_mod", span))); + path.segments.push(path_segment(ident( + &ps.remove_dim(), + config, + "cluster_mod", + span, + ))); } TypePath { qself: None, path } } @@ -314,7 +318,7 @@ pub fn register_path_to_ty( ) -> TypePath { let mut p = block_path_to_ty(&rpath.block, config, span); p.path.segments.push(path_segment(ident( - &rpath.name, + &rpath.name.remove_dim(), config, "register_mod", span, From 17c74f36eceaed33af5fadf16e2c83d0b573fd75 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 2 Feb 2025 12:43:47 +0100 Subject: [PATCH 56/77] Update cargo regress tool and move CI - CI now uses the svd2rust-regress tool instead of a bash script - Fixed a bug where the workspace TOML file was still updated and changed when running the regression tool - Upgrade `portable-atomic` version for CI checks to 1. - Introduce MSRV v1.82.0 for the regress tool. - Allow passing multiple passthrough options to the regress tool. - Allow passing options using the test YAML file using the `opts` key - Allow specifying a suffix for test cases inside the YAML file using the `suffix` key. This can be used to resolve name duplications. - Allow skipping the `cargo check` for test cases with a `skip_check` key inside the YAML file --- .github/workflows/ci.yml | 102 +- ci/svd2rust-regress/Cargo.toml | 1 + ci/svd2rust-regress/all-tests.yml | 2139 ++++++++++++++++++++++++++ ci/svd2rust-regress/src/diff.rs | 13 +- ci/svd2rust-regress/src/main.rs | 38 +- ci/svd2rust-regress/src/svd_test.rs | 298 ++-- ci/svd2rust-regress/src/tests.rs | 13 +- ci/svd2rust-regress/tests.yml | 2202 +++++---------------------- src/util.rs | 2 +- 9 files changed, 2810 insertions(+), 1998 deletions(-) create mode 100644 ci/svd2rust-regress/all-tests.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0244ff3b..c7e7756e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,53 +54,47 @@ jobs: runs-on: ubuntu-latest needs: [check] strategy: + fail-fast: false matrix: - # Options are all, none, strict and const include: - - { rust: stable, vendor: Atmel, options: all } - - { rust: stable, vendor: Atmel, options: "" } - - { rust: stable, vendor: Freescale, options: all } - - { rust: stable, vendor: Freescale, options: "" } - - { rust: stable, vendor: Fujitsu, options: "" } - - { rust: stable, vendor: Fujitsu, options: "--atomics" } - - { rust: stable, vendor: GD32, options: all } - - { rust: stable, vendor: GD32, options: "" } - - { rust: stable, vendor: Holtek, options: all } - - { rust: stable, vendor: Holtek, options: "" } - - { rust: stable, vendor: Microchip, options: "" } - - { rust: stable, vendor: Microchip, options: "--atomics" } - - { rust: stable, vendor: Nordic, options: all } - - { rust: stable, vendor: Nordic, options: "" } - - { rust: stable, vendor: Nuvoton, options: "" } - - { rust: stable, vendor: Nuvoton, options: "--atomics" } - - { rust: stable, vendor: NXP, options: all } - - { rust: stable, vendor: NXP, options: "" } - - { rust: stable, vendor: RISC-V, options: "" } - - { rust: stable, vendor: RISC-V, options: "--atomics" } - - { rust: stable, vendor: SiliconLabs, options: all } - - { rust: stable, vendor: SiliconLabs, options: "" } - - { rust: stable, vendor: Spansion, options: "" } - - { rust: stable, vendor: Spansion, options: "--atomics" } - - { rust: stable, vendor: STMicro, options: "" } - - { rust: stable, vendor: STMicro, options: "--atomics" } - - { rust: stable, vendor: STM32-patched, options: "--strict -f enum_value::p: --max-cluster-size --atomics --atomics-feature atomics --impl-debug --impl-defmt defmt" } - - { rust: stable, vendor: Toshiba, options: all } - - { rust: stable, vendor: Toshiba, options: "" } - # Test MSRV - - { rust: 1.76.0, vendor: Nordic, options: "" } - # Use nightly for architectures which don't support stable - - { rust: nightly, vendor: MSP430, options: "--atomics" } - - { rust: nightly, vendor: MSP430, options: "" } - # Workaround for _1token0 - - { rust: nightly-2024-09-25, vendor: Espressif, options: "--atomics --ident-formats-theme legacy" } - - { rust: nightly-2024-09-25, vendor: Espressif, options: "--ident-format register:::Reg" } + - { vendor: Atmel } + - { vendor: Atmel, options: "-- --strict --atomics" } + - { vendor: Freescale } + - { vendor: Freescale, options: "-- --strict --atomics" } + - { vendor: Fujitsu } + - { vendor: Fujitsu, options: "-- --atomics" } + - { vendor: Holtek } + - { vendor: Holtek, options: "-- --strict --atomics" } + - { vendor: Atmel } + - { vendor: Atmel, options: "-- --strict --atomics" } + - { vendor: Microchip } + - { vendor: Microchip, options: "-- --atomics" } + - { vendor: Nordic } + - { vendor: Nordic, options: "-- --strict --atomics" } + - { vendor: Nuvoton } + - { vendor: Nuvoton, options: "-- --atomics" } + - { vendor: NXP } + - { vendor: NXP, options: "-- --strict --atomics" } + - { vendor: SiFive } + - { vendor: SiFive, options: "-- --atomics" } + - { vendor: SiliconLabs, options: "" } + - { vendor: SiliconLabs, options: "-- --strict --atomics" } + - { vendor: Spansion } + - { vendor: Spansion, options: "-- --atomics" } + - { vendor: STMicro } + - { vendor: STMicro, options: "-- --atomics" } + - { vendor: STMicro, options: "-- --strict -f enum_value::p: --max-cluster-size --atomics --atomics-feature atomics --impl-debug --impl-defmt defmt" } + - { vendor: Toshiba } + - { vendor: Toshiba, options: "-- --strict --atomics" } + - { vendor: TexasInstruments } + - { vendor: TexasInstruments, options: "-- --atomics" } + - { vendor: Espressif } + - { vendor: Espressif, options: "-- --atomics" } steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} + - uses: dtolnay/rust-toolchain@stable - name: Cache uses: Swatinem/rust-cache@v2 @@ -109,13 +103,25 @@ jobs: run: | cargo install svd2rust --path . - - name: Run CI script for `${{ matrix.vendor }}` under rust `${{ matrix.rust }}` with options=`${{ matrix.options }}` - env: - VENDOR: ${{ matrix.vendor }} - OPTIONS: ${{ matrix.options }} - COMMAND: check - RUST_TOOLCHAIN: ${{ matrix.rust }} - run: bash ci/script.sh + - name: Run regression tool + run: cargo regress tests -m ${{ matrix.vendor }} ${{ matrix.options }} + + ci-msrv-check: + runs-on: ubuntu-latest + needs: [check] + steps: + - uses: actions/checkout@v4 + + - name: Self install + run: | + cargo install svd2rust --path . + + # Install the MSRV toolchain + - uses: dtolnay/rust-toolchain@1.76.0 + - name: Run reression tool with MSRV + # The MSRV only applies to the generated crate. The regress tool should still be run with + # stable. + run: cargo +stable regress tests --toolchain 1.76.0 -m Nordic -- --strict --atomics ci-clippy: runs-on: ubuntu-latest diff --git a/ci/svd2rust-regress/Cargo.toml b/ci/svd2rust-regress/Cargo.toml index 3b882db7..bd32d497 100644 --- a/ci/svd2rust-regress/Cargo.toml +++ b/ci/svd2rust-regress/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "svd2rust-regress" version = "0.1.0" authors = ["James Munns ", "The svd2rust developers"] +rust-version = "1.82.0" [dependencies] clap = { version = "4.1", features = ["color", "derive", "string", "env"] } diff --git a/ci/svd2rust-regress/all-tests.yml b/ci/svd2rust-regress/all-tests.yml new file mode 100644 index 00000000..06501c71 --- /dev/null +++ b/ci/svd2rust-regress/all-tests.yml @@ -0,0 +1,2139 @@ +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9CN11 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9CN12 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9G09 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9G15 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9G20 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9G25 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9G35 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9M10 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9M11 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9N12 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9X25 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: AT91SAM9X35 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3A4C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3A8C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N00A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N00B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N0A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N0B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N0C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N1A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N1B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N1C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N2A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N2B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N2C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N4A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N4B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3N4C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S1A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S1B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S1C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S2A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S2B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S2C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S4A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S4B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S4C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S8B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3S8C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3SD8B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3SD8C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3U1C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3U1E + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3U2C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3U2E + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3U4C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3U4E + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3X4C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3X4E + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3X8C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM3X8E + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM4S16B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM4S16C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM4S8B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM4S8C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM4SD32B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAM4SD32C + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMA5D31 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMA5D33 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMA5D34 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMA5D35 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21E15A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21E16A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21E17A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21E18A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21G16A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21G17A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21G18A + svd_url: https://raw.githubusercontent.com/wez/atsamd21-rs/master/svd/ATSAMD21G18A.svd + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21J16A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21J17A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMD21J18A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMR21E16A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMR21E17A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMR21E18A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMR21G16A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMR21G17A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Atmel + chip: ATSAMR21G18A + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MKV56F20 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MKV56F22 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MKV56F24 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MKV58F20 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MKV58F22 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MKV58F24 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MK61F15 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MK61F15WS + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MK70F12 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MK70F15 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MK70F15WS + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Freescale + chip: MK02F12810 +- arch: cortex-m + mfgr: Freescale + chip: MK10D10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK10D5 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK10D7 +- arch: cortex-m + mfgr: Freescale + chip: MK10DZ10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK10F12 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK11D5 +- arch: cortex-m + mfgr: Freescale + chip: MK11D5WS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK11DA5 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK12D5 +- arch: cortex-m + mfgr: Freescale + chip: MK20D10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK20D5 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK20D7 +- arch: cortex-m + mfgr: Freescale + chip: MK20DZ10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK20F12 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK21D5 +- arch: cortex-m + mfgr: Freescale + chip: MK21D5WS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK21DA5 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK21F12 +- arch: cortex-m + mfgr: Freescale + chip: MK21FA12 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK22D5 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK22F12 +- arch: cortex-m + mfgr: Freescale + chip: MK22F12810 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK22F25612 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK22F51212 +- arch: cortex-m + mfgr: Freescale + chip: MK22FA12 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK24F12 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK24F25612 +- arch: cortex-m + mfgr: Freescale + chip: MK26F18 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK30D10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK30D7 +- arch: cortex-m + mfgr: Freescale + chip: MK30DZ10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK40D10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK40D7 +- arch: cortex-m + mfgr: Freescale + chip: MK40DZ10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK50D10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK50D7 +- arch: cortex-m + mfgr: Freescale + chip: MK50DZ10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK51D10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK51D7 +- arch: cortex-m + mfgr: Freescale + chip: MK51DZ10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK52D10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK52DZ10 +- arch: cortex-m + mfgr: Freescale + chip: MK53D10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK53DZ10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK60D10 +- arch: cortex-m + mfgr: Freescale + chip: MK60DZ10 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK60F15 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK63F12 +- arch: cortex-m + mfgr: Freescale + chip: MK64F12 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK65F18 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK66F18 +- arch: cortex-m + mfgr: Freescale + chip: MK80F25615 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK81F25615 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MK82F25615 +- arch: cortex-m + mfgr: Freescale + chip: MKE14F16 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKE14Z7 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKE15Z7 +- arch: cortex-m + mfgr: Freescale + chip: MKE16F16 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKE18F16 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL28T7_CORE0 +- arch: cortex-m + mfgr: Freescale + chip: MKL28T7_CORE1 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL28Z7 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL81Z7 +- arch: cortex-m + mfgr: Freescale + chip: MKL82Z7 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKS22F12 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV10Z1287 +- arch: cortex-m + mfgr: Freescale + chip: MKV10Z7 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV11Z7 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV30F12810 +- arch: cortex-m + mfgr: Freescale + chip: MKV31F12810 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV31F25612 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV31F51212 +- arch: cortex-m + mfgr: Freescale + chip: MKV40F15 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV42F16 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV43F15 +- arch: cortex-m + mfgr: Freescale + chip: MKV44F15 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV44F16 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV45F15 +- arch: cortex-m + mfgr: Freescale + chip: MKV46F15 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKV46F16 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKW20Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKW21D5 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKW21Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKW22D5 +- arch: cortex-m + mfgr: Freescale + chip: MKW24D5 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKW30Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKW31Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKW40Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKW41Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKE02Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKE04Z1284 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKE04Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKE06Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKE14D7 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKE15D7 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL02Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKL03Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL04Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL05Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKL13Z644 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL14Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL15Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKL16Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL17Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL17Z644 +- arch: cortex-m + mfgr: Freescale + chip: MKL24Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL25Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL26Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKL27Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL27Z644 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL33Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKL33Z644 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL34Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL36Z4 +- arch: cortex-m + mfgr: Freescale + chip: MKL43Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKL46Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKM14ZA5 +- arch: cortex-m + mfgr: Freescale + chip: MKM33ZA5 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKM34Z7 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: MKM34ZA5 +- arch: cortex-m + mfgr: Freescale + chip: MKW01Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: SKEAZ1284 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Freescale + chip: SKEAZN642 +- arch: cortex-m + mfgr: Freescale + chip: SKEAZN84 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF10xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF10xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF11xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF11xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF11xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF11xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF12xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF12xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF13xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF13xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF13xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF13xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF14xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF14xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF14xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF15xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF15xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF15xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF1AxL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF1AxM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF1AxN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF31xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF31xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF31xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF31xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF34xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF34xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF34xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF42xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF42xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFA3xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFA3xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFA3xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFA4xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFA4xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFA4xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFAAxL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFAAxM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFAAxN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFB4xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFB4xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFB4xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B160L +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B160R +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B360L +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B360R +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B460L +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B460R +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B560L +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B560R +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF10xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF10xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF11xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF11xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF11xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF11xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF12xJ +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF12xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF12xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF12xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF12xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF12xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF21xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF21xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF30xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF30xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF31xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF31xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF31xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF31xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF32xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF32xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF32xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF32xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF32xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF40xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF40xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF41xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF41xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF41xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF41xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF42xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF42xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF50xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF50xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF51xN +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF51xR +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF51xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF51xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF52xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF52xL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF52xM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF52xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF52xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF61xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF61xT +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BFD1xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BFD1xT +- arch: cortex-m + mfgr: Fujitsu + chip: S6E1A1 +- arch: cortex-m + mfgr: Fujitsu + chip: S6E2CC +- arch: cortex-m + mfgr: Holtek + chip: ht32f125x +- arch: cortex-m + mfgr: Holtek + chip: ht32f175x +- arch: cortex-m + mfgr: Holtek + chip: ht32f275x +- arch: cortex-m + mfgr: Nordic + chip: nrf51 +- arch: cortex-m + mfgr: Nordic + chip: nrf52 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Nuvoton + chip: M051_Series + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Nuvoton + chip: NUC100_Series + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC11Exx_v5 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC11Uxx_v7 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC11xx_v6a + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC11xx_v6 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC13Uxx_v1 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC15xx_v0.7 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC800_v0.3 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC11E6x_v0.8 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC176x5x_v0.2 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC11Cxx_v9 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC178x_7x + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC178x_7x_v0.8 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC408x_7x_v0.7 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC11Axxv0.6 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC11D14_svd_v4 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC13xx_svd_v1 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC18xx_svd_v18 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC43xx_43Sxx + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC1102_4_v4 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: LPC5410x_v0.4 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: NXP + chip: MK22F25612 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: NXP + chip: MK22F51212 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: NXP + chip: MKW41Z4 + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3C1x4_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3C1x6_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3C1x7_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3L1x4_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3L1x6_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3L1x7_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3U1x4_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3U1x6_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3U1x7_SVD + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3L1x8_SVD + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Spansion + chip: MB9AF12xK + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF12xL + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF42xK + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF42xL + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF12xJ + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF12xS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF12xT + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF16xx + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF32xS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF32xT + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF36xx + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF42xS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF42xT + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF46xx + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF52xS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF52xT + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF56xx + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF10xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF10xR +- arch: cortex-m + mfgr: Spansion + chip: MB9AF11xK + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF11xL +- arch: cortex-m + mfgr: Spansion + chip: MB9AF11xM + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF11xN +- arch: cortex-m + mfgr: Spansion + chip: MB9AF13xK + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF13xL +- arch: cortex-m + mfgr: Spansion + chip: MB9AF13xM + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF13xN +- arch: cortex-m + mfgr: Spansion + chip: MB9AF14xL + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF14xM +- arch: cortex-m + mfgr: Spansion + chip: MB9AF14xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF15xM +- arch: cortex-m + mfgr: Spansion + chip: MB9AF15xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF15xR +- arch: cortex-m + mfgr: Spansion + chip: MB9AF31xK + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF31xL +- arch: cortex-m + mfgr: Spansion + chip: MB9AF31xM + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF31xN +- arch: cortex-m + mfgr: Spansion + chip: MB9AF34xL + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AF34xM +- arch: cortex-m + mfgr: Spansion + chip: MB9AF34xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AFA3xL +- arch: cortex-m + mfgr: Spansion + chip: MB9AFA3xM + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AFA3xN +- arch: cortex-m + mfgr: Spansion + chip: MB9AFA4xL + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AFA4xM +- arch: cortex-m + mfgr: Spansion + chip: MB9AFA4xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AFB4xL +- arch: cortex-m + mfgr: Spansion + chip: MB9AFB4xM + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9AFB4xN +- arch: cortex-m + mfgr: Spansion + chip: MB9BF10xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF10xR +- arch: cortex-m + mfgr: Spansion + chip: MB9BF11xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF11xR +- arch: cortex-m + mfgr: Spansion + chip: MB9BF11xS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF11xT +- arch: cortex-m + mfgr: Spansion + chip: MB9BF12xK + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF12xL +- arch: cortex-m + mfgr: Spansion + chip: MB9BF12xM + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF21xS +- arch: cortex-m + mfgr: Spansion + chip: MB9BF21xT + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF30xN +- arch: cortex-m + mfgr: Spansion + chip: MB9BF30xR + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF31xN +- arch: cortex-m + mfgr: Spansion + chip: MB9BF31xR + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF31xS +- arch: cortex-m + mfgr: Spansion + chip: MB9BF31xT + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF32xK +- arch: cortex-m + mfgr: Spansion + chip: MB9BF32xL + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF32xM +- arch: cortex-m + mfgr: Spansion + chip: MB9BF40xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF40xR +- arch: cortex-m + mfgr: Spansion + chip: MB9BF41xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF41xR +- arch: cortex-m + mfgr: Spansion + chip: MB9BF41xS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF41xT +- arch: cortex-m + mfgr: Spansion + chip: MB9BF50xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF50xR +- arch: cortex-m + mfgr: Spansion + chip: MB9BF51xN + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF51xR +- arch: cortex-m + mfgr: Spansion + chip: MB9BF51xS + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF51xT +- arch: cortex-m + mfgr: Spansion + chip: MB9BF52xK + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF52xL +- arch: cortex-m + mfgr: Spansion + chip: MB9BF52xM + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BF61xS +- arch: cortex-m + mfgr: Spansion + chip: MB9BF61xT + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: Spansion + chip: MB9BFD1xS +- arch: cortex-m + mfgr: Spansion + chip: MB9BFD1xT + should_pass: true + run_when: not-short +- arch: cortex-m + mfgr: STMicro + chip: STM32F030 +- arch: cortex-m + mfgr: STMicro + chip: STM32F0x2 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f0x2.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32F103 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f103.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32F411 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f411.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32F469 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f469.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32F723 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f723.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32G070 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32g070.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32G473 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32g473.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32H753 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32h753.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32L0x3 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32l0x3.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32L162 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32l162.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32L4x6 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32l4x6.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32L562 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32l562.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32MP157 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32mp157.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32WB55 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32wb55.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32WLE5 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32wle5.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32C011 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32c011.svd.patched +- arch: cortex-m + mfgr: STMicro + chip: STM32F031x +- arch: cortex-m + mfgr: STMicro + chip: STM32F042x +- arch: cortex-m + mfgr: STMicro + chip: STM32F072x +- arch: cortex-m + mfgr: STMicro + chip: STM32F091x +- arch: cortex-m + mfgr: STMicro + chip: STM32F0xx +- arch: cortex-m + mfgr: STMicro + chip: STM32F100xx +- arch: cortex-m + mfgr: STMicro + chip: STM32F101xx +- arch: cortex-m + mfgr: STMicro + chip: STM32F102xx +- arch: cortex-m + mfgr: STMicro + chip: STM32F105xx +- arch: cortex-m + mfgr: STMicro + chip: STM32F107xx +- arch: cortex-m + mfgr: STMicro + chip: STM32F20x +- arch: cortex-m + mfgr: STMicro + chip: STM32F21x +- arch: cortex-m + mfgr: STMicro + chip: STM32F301 +- arch: cortex-m + mfgr: STMicro + chip: STM32F302 +- arch: cortex-m + mfgr: STMicro + chip: STM32F303 +- arch: cortex-m + mfgr: STMicro + chip: STM32F3x4 +- arch: cortex-m + mfgr: STMicro + chip: STM32F373 +- arch: cortex-m + mfgr: STMicro + chip: STM32F401 +- arch: cortex-m + mfgr: STMicro + chip: STM32F405 +- arch: cortex-m + mfgr: STMicro + chip: STM32F407 +- arch: cortex-m + mfgr: STMicro + chip: STM32F410 +- arch: cortex-m + mfgr: STMicro + chip: STM32F412 +- arch: cortex-m + mfgr: STMicro + chip: STM32F413 +- arch: cortex-m + mfgr: STMicro + chip: STM32F427 +- arch: cortex-m + mfgr: STMicro + chip: STM32F429 +- arch: cortex-m + mfgr: STMicro + chip: STM32F446 +- arch: cortex-m + mfgr: STMicro + chip: STM32F7x +- arch: cortex-m + mfgr: STMicro + chip: STM32F7x2 +- arch: cortex-m + mfgr: STMicro + chip: STM32F7x5 +- arch: cortex-m + mfgr: STMicro + chip: STM32F7x6 +- arch: cortex-m + mfgr: STMicro + chip: STM32F7x7 +- arch: cortex-m + mfgr: STMicro + chip: STM32F7x9 +- arch: cortex-m + mfgr: STMicro + chip: STM32G07x + should_pass: false + run_when: never +- arch: cortex-m + mfgr: STMicro + chip: STM32G431xx +- arch: cortex-m + mfgr: STMicro + chip: STM32G441xx +- arch: cortex-m + mfgr: STMicro + chip: STM32G471xx +- arch: cortex-m + mfgr: STMicro + chip: STM32G474xx +- arch: cortex-m + mfgr: STMicro + chip: STM32G483xx +- arch: cortex-m + mfgr: STMicro + chip: STM32G484xx +- arch: cortex-m + mfgr: STMicro + chip: STM32L100 +- arch: cortex-m + mfgr: STMicro + chip: STM32L15xC +- arch: cortex-m + mfgr: STMicro + chip: STM32L15xxE +- arch: cortex-m + mfgr: STMicro + chip: STM32L15xxxA +- arch: cortex-m + mfgr: STMicro + chip: STM32L1xx +- arch: cortex-m + mfgr: STMicro + chip: STM32W108 +- arch: cortex-m + mfgr: STMicro + chip: STM32L051x + should_pass: false + run_when: never +- arch: cortex-m + mfgr: STMicro + chip: STM32L052x + should_pass: false + run_when: never +- arch: cortex-m + mfgr: STMicro + chip: STM32L053x + should_pass: false + run_when: never +- arch: cortex-m + mfgr: STMicro + chip: STM32L062x + should_pass: false + run_when: never +- arch: cortex-m + mfgr: STMicro + chip: STM32L063x + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Toshiba + chip: M365 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Toshiba + chip: M367 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Toshiba + chip: M368 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Toshiba + chip: M369 + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Toshiba + chip: M36B + should_pass: false + run_when: never +- arch: cortex-m + mfgr: Toshiba + chip: M061 +- arch: riscv + mfgr: SiFive + chip: E310x + svd_url: https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x/e310x.svd + should_pass: false + run_when: never +- arch: msp430 + mfgr: TexasInstruments + chip: msp430g2553 + svd_url: https://github.com/pftbest/msp430g2553/raw/v0.1.3-svd/msp430g2553.svd +- arch: msp430 + mfgr: TexasInstruments + chip: msp430fr2355 + svd_url: https://raw.githubusercontent.com/YuhanLiin/msp430fr2355/master/msp430fr2355.svd +- arch: xtensa-lx + mfgr: Espressif + chip: esp32 + svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32.svd +- arch: xtensa-lx + mfgr: Espressif + chip: esp32s2 + svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s2.svd +- arch: xtensa-lx + mfgr: Espressif + chip: esp32s3 + svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s3.svd +- arch: riscv + mfgr: Espressif + chip: esp32c3 + svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32c3.svd +- arch: mips + mfgr: Microchip + chip: pic32mx170f256b + svd_url: https://raw.githubusercontent.com/kiffie/pic32-pac/master/pic32mx1xxfxxxb/PIC32MX170F256B.svd.patched +- arch: mips + mfgr: Microchip + chip: pic32mx270f256b + svd_url: https://raw.githubusercontent.com/kiffie/pic32-pac/master/pic32mx2xxfxxxb/PIC32MX270F256B.svd.patched diff --git a/ci/svd2rust-regress/src/diff.rs b/ci/svd2rust-regress/src/diff.rs index d155c56a..de4d0d31 100644 --- a/ci/svd2rust-regress/src/diff.rs +++ b/ci/svd2rust-regress/src/diff.rs @@ -208,6 +208,9 @@ impl Diffing { .to_owned(), svd_url: Some(url.to_owned()), should_pass: true, + skip_check: false, + suffix: Default::default(), + opts: Default::default(), run_when: crate::tests::RunWhen::Always, }, _ => { @@ -232,10 +235,10 @@ impl Diffing { ) => last_args.as_deref(), None => None, }); - let join = |opt1: Option<&str>, opt2: Option<&str>| -> Option { + let join = |opt1: Option<&str>, opt2: Option<&str>| -> Option> { match (opt1, opt2) { - (Some(str1), Some(str2)) => Some(format!("{} {}", str1, str2)), - (Some(str), None) | (None, Some(str)) => Some(str.to_owned()), + (Some(str1), Some(str2)) => vec![str1.to_owned(), str2.to_owned()].into(), + (Some(str), None) | (None, Some(str)) => Some(vec![str.to_owned()]), (None, None) => None, } }; @@ -243,14 +246,14 @@ impl Diffing { .setup_case( &opts.output_dir.join("baseline"), &baseline_bin, - join(baseline_cmd, last_args).as_deref(), + &join(baseline_cmd, last_args), ) .with_context(|| "couldn't create head")?; let current = test .setup_case( &opts.output_dir.join("current"), ¤t_bin, - join(current_cmd, last_args).as_deref(), + &join(current_cmd, last_args), ) .with_context(|| "couldn't create base")?; diff --git a/ci/svd2rust-regress/src/main.rs b/ci/svd2rust-regress/src/main.rs index 4d0fdf77..22b03985 100644 --- a/ci/svd2rust-regress/src/main.rs +++ b/ci/svd2rust-regress/src/main.rs @@ -17,6 +17,7 @@ use std::path::PathBuf; use std::process::{exit, Command}; use std::sync::atomic::{AtomicBool, Ordering}; use std::time::Instant; +use svd_test::WorkspaceTomlGuard; use wildmatch::WildMatch; #[derive(Debug, serde::Deserialize)] @@ -61,20 +62,20 @@ pub struct TestAll { /// Filter by manufacturer, may be combined with other filters #[clap( - short = 'm', - long = "manufacturer", - ignore_case = true, - value_parser = manufacturers(), -)] + short = 'm', + long = "manufacturer", + ignore_case = true, + value_parser = manufacturers(), + )] pub mfgr: Option, /// Filter by architecture, may be combined with other filters #[clap( - short = 'a', - long = "architecture", - ignore_case = true, - value_parser = architectures(), -)] + short = 'a', + long = "architecture", + ignore_case = true, + value_parser = architectures(), + )] pub arch: Option, /// Include tests expected to fail (will cause a non-zero return code) @@ -99,7 +100,7 @@ pub struct TestAll { #[clap(short = 'p', long = "svd2rust-path", default_value = default_svd2rust())] pub current_bin_path: PathBuf, #[clap(last = true)] - pub command: Option, + pub passthrough_opts: Option>, // TODO: Specify smaller subset of tests? Maybe with tags? // TODO: Compile svd2rust? } @@ -148,7 +149,7 @@ pub struct Test { #[clap(short = 'p', long = "svd2rust-path", default_value = default_svd2rust())] pub current_bin_path: PathBuf, #[clap(last = true)] - pub command: Option, + pub passthrough_opts: Option>, } impl Test { @@ -161,6 +162,7 @@ impl Test { Self { chip: Some(_), .. } => {} _ => unreachable!("clap should not allow this"), } + let _toml_guard = WorkspaceTomlGuard::new()?; let test = if let (Some(url), Some(arch)) = (&self.url, &self.arch) { tests::TestCase { arch: svd2rust::Target::parse(arch)?, @@ -177,6 +179,9 @@ impl Test { .to_owned(), svd_url: Some(url.clone()), should_pass: true, + skip_check: false, + suffix: Default::default(), + opts: Default::default(), run_when: tests::RunWhen::default(), } } else { @@ -186,7 +191,7 @@ impl Test { .ok_or_else(|| anyhow::anyhow!("no test found for chip"))? .to_owned() }; - test.test(opts, &self.current_bin_path, self.command.as_deref())?; + test.test(opts, &self.current_bin_path, &self.passthrough_opts)?; Ok(()) } } @@ -235,11 +240,14 @@ impl TestAll { "No tests run, you might want to use `--bad-tests` and/or `--long-test`" ); } + + let toml_guard = WorkspaceTomlGuard::new()?; + let any_fails = AtomicBool::new(false); tests.par_iter().for_each(|t| { let start = Instant::now(); - match t.test(opt, &self.current_bin_path, self.command.as_deref()) { + match t.test(opt, &self.current_bin_path, &self.passthrough_opts) { Ok(s) => { if let Some(stderrs) = s { let mut buf = String::new(); @@ -293,6 +301,8 @@ impl TestAll { } } }); + drop(toml_guard); + if any_fails.load(Ordering::Acquire) { exit(1); } else { diff --git a/ci/svd2rust-regress/src/svd_test.rs b/ci/svd2rust-regress/src/svd_test.rs index 97de00da..4801bd3e 100644 --- a/ci/svd2rust-regress/src/svd_test.rs +++ b/ci/svd2rust-regress/src/svd_test.rs @@ -17,15 +17,14 @@ const CRATES_ALL: &[&str] = &[ ]; const CRATES_MSP430: &[&str] = &["msp430 = \"0.4.0\"", "msp430-rt = \"0.4.0\""]; const CRATES_ATOMICS: &[&str] = - &["portable-atomic = { version = \"0.3.16\", default-features = false }"]; + &["portable-atomic = { version = \"1\", default-features = false }"]; const CRATES_CORTEX_M: &[&str] = &["cortex-m = \"0.7.6\"", "cortex-m-rt = \"0.7\""]; const CRATES_RISCV: &[&str] = &["riscv = \"0.12.1\"", "riscv-rt = \"0.13.0\""]; -const CRATES_XTENSALX: &[&str] = &["xtensa-lx-rt = \"0.9.0\"", "xtensa-lx = \"0.6.0\""]; const CRATES_MIPS: &[&str] = &["mips-mcu = \"0.1.0\""]; const PROFILE_ALL: &[&str] = &["[profile.dev]", "incremental = false"]; const FEATURES_ALL: &[&str] = &["[features]"]; const FEATURES_CORTEX_M: &[&str] = &["rt = [\"cortex-m-rt/device\"]"]; -const FEATURES_XTENSALX: &[&str] = &["default = [\"xtensa-lx/esp32\", \"xtensa-lx-rt/esp32\"]"]; +const FEATURES_XTENSA_LX: &[&str] = &["rt = []"]; const WORKSPACE_EXCLUDE: &[&str] = &["[workspace]"]; fn path_helper_base(base: &Path, input: &[&str]) -> PathBuf { @@ -143,25 +142,27 @@ impl TestCase { &self, opts: &Opts, bin_path: &Path, - command: Option<&str>, + cli_opts: &Option>, ) -> Result>, TestError> { let (chip_dir, mut process_stderr_paths) = self - .setup_case(&opts.output_dir, bin_path, command) + .setup_case(&opts.output_dir, bin_path, cli_opts) .with_context(|| anyhow!("when setting up case for {}", self.name()))?; // Run `cargo check`, capturing stderr to a log file - let cargo_check_err_file = path_helper_base(&chip_dir, &["cargo-check.err.log"]); - Command::new("cargo") - .arg("check") - .current_dir(&chip_dir) - .capture_outputs( - true, - "cargo check", - None, - Some(&cargo_check_err_file), - &process_stderr_paths, - ) - .with_context(|| "failed to check")?; - process_stderr_paths.push(cargo_check_err_file); + if !self.skip_check { + let cargo_check_err_file = path_helper_base(&chip_dir, &["cargo-check.err.log"]); + Command::new("cargo") + .arg("check") + .current_dir(&chip_dir) + .capture_outputs( + true, + "cargo check", + None, + Some(&cargo_check_err_file), + &process_stderr_paths, + ) + .with_context(|| "failed to check")?; + process_stderr_paths.push(cargo_check_err_file); + } Ok(if opts.verbose > 1 { Some(process_stderr_paths) } else { @@ -175,13 +176,15 @@ impl TestCase { &self, output_dir: &Path, svd2rust_bin_path: &Path, - command: Option<&str>, + command: &Option>, ) -> Result<(PathBuf, Vec), TestError> { let user = match std::env::var("USER") { Ok(val) => val, Err(_) => "rusttester".into(), }; - let chip_dir = output_dir.join(Case::Snake.sanitize(&self.name()).as_ref()); + let mut chip_name = self.name(); + chip_name = Case::Snake.cow_to_case(chip_name.into()).to_string(); + let chip_dir = output_dir.join(&chip_name); tracing::span::Span::current() .record("chip_dir", tracing::field::display(chip_dir.display())); if let Err(err) = fs::remove_dir_all(&chip_dir) { @@ -196,104 +199,34 @@ impl TestCase { self.name(), chip_dir.display() ); - // XXX: Workaround for https://github.com/rust-lang/cargo/issues/6009#issuecomment-1925445245 - let manifest_path = crate::get_cargo_workspace().join("Cargo.toml"); - let workspace_toml = - fs::read(&manifest_path).context("failed to read workspace Cargo.toml")?; + println!("chip_dir: {}", chip_dir.display()); Command::new("cargo") .env("USER", user) .arg("init") .arg("--name") - .arg(Case::Snake.sanitize(&self.name()).as_ref()) + .arg(chip_name) .arg("--vcs") .arg("none") + .arg("--lib") .arg(&chip_dir) .capture_outputs(true, "cargo init", None, None, &[]) .with_context(|| "Failed to cargo init")?; - std::fs::write(manifest_path, workspace_toml) - .context("failed to write workspace Cargo.toml")?; - - let svd_toml = path_helper_base(&chip_dir, &["Cargo.toml"]); - let mut file = OpenOptions::new() - .append(true) - .open(svd_toml) - .with_context(|| "Failed to open Cargo.toml for appending")?; - let crates = CRATES_ALL - .iter() - .chain(match &self.arch { - Target::CortexM => CRATES_CORTEX_M.iter(), - Target::RISCV => CRATES_RISCV.iter(), - Target::Mips => CRATES_MIPS.iter(), - Target::Msp430 => CRATES_MSP430.iter(), - Target::XtensaLX => CRATES_XTENSALX.iter(), - Target::None => unreachable!(), - }) - .chain(if command.unwrap_or_default().contains("--atomics") { - CRATES_ATOMICS.iter() - } else { - [].iter() - }) - .chain(PROFILE_ALL.iter()) - .chain(FEATURES_ALL.iter()) - .chain(match &self.arch { - Target::XtensaLX => FEATURES_XTENSALX.iter(), - Target::CortexM => FEATURES_CORTEX_M.iter(), - _ => [].iter(), - }) - .chain(WORKSPACE_EXCLUDE.iter()); - for c in crates { - writeln!(file, "{}", c).with_context(|| "Failed to append to file!")?; - } - tracing::info!("Downloading SVD"); - // FIXME: Avoid downloading multiple times, especially if we're using the diff command - let svd_url = &self.svd_url(); - let svd = reqwest::blocking::get(svd_url) - .with_context(|| format!("Failed to get svd URL: {svd_url}"))? - .error_for_status() - .with_context(|| anyhow!("Response is not ok for svd url"))? - .text() - .with_context(|| "SVD is bad text")?; + self.prepare_chip_test_toml(&chip_dir, command)?; + let chip_svd = self.prepare_svd_file(&chip_dir)?; + self.prepare_rust_toolchain_file(&chip_dir)?; - let chip_svd = format!("{}.svd", &self.chip); - let svd_file = path_helper_base(&chip_dir, &[&chip_svd]); - file_helper(&svd, &svd_file)?; let lib_rs_file = path_helper_base(&chip_dir, &["src", "lib.rs"]); let src_dir = path_helper_base(&chip_dir, &["src"]); let svd2rust_err_file = path_helper_base(&chip_dir, &["svd2rust.err.log"]); - let target = match self.arch { - Target::CortexM => "cortex-m", - Target::Msp430 => "msp430", - Target::Mips => "mips", - Target::RISCV => "riscv", - Target::XtensaLX => "xtensa-lx", - Target::None => unreachable!(), - }; - tracing::info!("Running svd2rust"); - let mut svd2rust_bin = Command::new(svd2rust_bin_path); - if let Some(command) = command { - if !command.is_empty() { - svd2rust_bin.args( - shell_words::split(command).context("unable to split command into args")?, - ); - } - } - svd2rust_bin - .args(["-i", &chip_svd]) - .args(["--target", target]) - .current_dir(&chip_dir) - .capture_outputs( - true, - "svd2rust", - Some(&lib_rs_file).filter(|_| { - !matches!( - self.arch, - Target::CortexM | Target::Msp430 | Target::XtensaLX - ) - }), - Some(&svd2rust_err_file), - &[], - )?; + self.run_svd2rust( + svd2rust_bin_path, + &chip_svd, + &chip_dir, + &lib_rs_file, + &svd2rust_err_file, + command, + )?; process_stderr_paths.push(svd2rust_err_file); match self.arch { Target::CortexM | Target::Mips | Target::Msp430 | Target::XtensaLX => { @@ -309,6 +242,7 @@ impl TestCase { .with_context(|| format!("couldn't parse {}", lib_rs_file.display()))?; File::options() .write(true) + .truncate(true) .open(&lib_rs_file) .with_context(|| format!("couldn't open {}", lib_rs_file.display()))? .write(prettyplease::unparse(&file).as_bytes()) @@ -370,6 +304,132 @@ impl TestCase { } Ok((chip_dir, process_stderr_paths)) } + + fn prepare_rust_toolchain_file(&self, chip_dir: &Path) -> Result<(), TestError> { + // Could be extended to let cargo install and use a specific toolchain. + let channel: Option = None; + + if let Some(channel) = channel { + let toolchain_file = path_helper_base(chip_dir, &["rust-toolchain.toml"]); + let mut file = OpenOptions::new() + .create(true) + .truncate(true) + .write(true) + .open(&toolchain_file) + .with_context(|| "failed to create toolchain file")?; + + writeln!(file, "[toolchain]\nchannel = \"{}\"", channel) + .with_context(|| "writing toolchain file failed")?; + } + + Ok(()) + } + + fn prepare_chip_test_toml( + &self, + chip_dir: &Path, + opts: &Option>, + ) -> Result<(), TestError> { + let svd_toml = path_helper_base(chip_dir, &["Cargo.toml"]); + let mut file = OpenOptions::new() + .append(true) + .open(svd_toml) + .with_context(|| "Failed to open Cargo.toml for appending")?; + + let cargo_toml_fragments = CRATES_ALL + .iter() + .chain(match &self.arch { + Target::CortexM => CRATES_CORTEX_M.iter(), + Target::RISCV => CRATES_RISCV.iter(), + Target::Mips => CRATES_MIPS.iter(), + Target::Msp430 => CRATES_MSP430.iter(), + Target::XtensaLX => [].iter(), + Target::None => unreachable!(), + }) + .chain(if let Some(opts) = opts { + if opts.iter().any(|v| v.contains("atomics")) { + CRATES_ATOMICS.iter() + } else { + [].iter() + } + } else { + [].iter() + }) + .chain(PROFILE_ALL.iter()) + .chain(FEATURES_ALL.iter()) + .chain(match &self.arch { + Target::CortexM => FEATURES_CORTEX_M.iter(), + Target::XtensaLX => FEATURES_XTENSA_LX.iter(), + _ => [].iter(), + }) + .chain(WORKSPACE_EXCLUDE.iter()); + for fragments in cargo_toml_fragments { + writeln!(file, "{}", fragments).with_context(|| "Failed to append to file!")?; + } + Ok(()) + } + + fn prepare_svd_file(&self, chip_dir: &Path) -> Result { + tracing::info!("Downloading SVD"); + // FIXME: Avoid downloading multiple times, especially if we're using the diff command + let svd_url = &self.svd_url(); + let svd = reqwest::blocking::get(svd_url) + .with_context(|| format!("Failed to get svd URL: {svd_url}"))? + .error_for_status() + .with_context(|| anyhow!("Response is not ok for svd url"))? + .text() + .with_context(|| "SVD is bad text")?; + + let chip_svd = format!("{}.svd", &self.chip); + let svd_file = path_helper_base(chip_dir, &[&chip_svd]); + file_helper(&svd, &svd_file)?; + Ok(chip_svd) + } + + fn run_svd2rust( + &self, + svd2rust_bin_path: &Path, + chip_svd: &str, + chip_dir: &Path, + lib_rs_file: &PathBuf, + svd2rust_err_file: &PathBuf, + cli_opts: &Option>, + ) -> Result<(), TestError> { + tracing::info!("Running svd2rust"); + + let target = match self.arch { + Target::CortexM => "cortex-m", + Target::Msp430 => "msp430", + Target::Mips => "mips", + Target::RISCV => "riscv", + Target::XtensaLX => "xtensa-lx", + Target::None => unreachable!(), + }; + let mut svd2rust_bin = Command::new(svd2rust_bin_path); + + let base_cmd = svd2rust_bin + .args(["-i", chip_svd]) + .args(["--target", target]); + if let Some(cli_opts) = cli_opts { + base_cmd.args(cli_opts); + } + if let Some(opts) = self.opts.as_ref() { + base_cmd.args(opts); + } + base_cmd.current_dir(chip_dir).capture_outputs( + true, + "svd2rust", + Some(lib_rs_file).filter(|_| { + !matches!( + self.arch, + Target::CortexM | Target::Msp430 | Target::XtensaLX + ) + }), + Some(svd2rust_err_file), + &[], + )?; + Ok(()) + } } fn visit_dirs(dir: &Path, cb: &mut dyn FnMut(&fs::DirEntry)) -> std::io::Result<()> { @@ -386,3 +446,33 @@ fn visit_dirs(dir: &Path, cb: &mut dyn FnMut(&fs::DirEntry)) -> std::io::Result< } Ok(()) } + +pub struct WorkspaceTomlGuard { + pub unmodified_toml: Vec, + pub manifest_path: PathBuf, +} + +impl WorkspaceTomlGuard { + pub fn new() -> Result { + // XXX: Workaround for + // https://github.com/rust-lang/cargo/issues/6009#issuecomment-1925445245 + // Calling cargo init will add the chip test directory to the workspace members, regardless + // of the exclude list. The unmodified manifest path is stored here and written + // back after cargo init. + let manifest_path = crate::get_cargo_workspace().join("Cargo.toml"); + let unmodified_toml = + fs::read(&manifest_path).with_context(|| "error reading manifest file")?; + Ok(Self { + unmodified_toml, + manifest_path, + }) + } +} + +impl Drop for WorkspaceTomlGuard { + fn drop(&mut self) { + if let Err(e) = std::fs::write(self.manifest_path.clone(), &self.unmodified_toml) { + tracing::error!("Failed to write back to manifest Cargo.toml: {}", e); + } + } +} diff --git a/ci/svd2rust-regress/src/tests.rs b/ci/svd2rust-regress/src/tests.rs index f1562a5d..4e40d4da 100644 --- a/ci/svd2rust-regress/src/tests.rs +++ b/ci/svd2rust-regress/src/tests.rs @@ -72,10 +72,16 @@ pub struct TestCase { pub mfgr: Manufacturer, pub chip: String, #[serde(default, skip_serializing_if = "Option::is_none")] + pub suffix: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub opts: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] pub svd_url: Option, #[serde(default = "true_")] pub should_pass: bool, #[serde(default)] + pub skip_check: bool, + #[serde(default)] pub run_when: RunWhen, } @@ -103,7 +109,12 @@ impl TestCase { } pub fn name(&self) -> String { - format!("{:?}-{}", self.mfgr, self.chip.replace('.', "_")) + let mut base_name = format!("{:?}-{}", self.mfgr, self.chip.replace('.', "_")); + if let Some(suffix) = &self.suffix { + base_name.push('-'); + base_name.push_str(suffix); + } + base_name } } diff --git a/ci/svd2rust-regress/tests.yml b/ci/svd2rust-regress/tests.yml index 06501c71..27e08a6d 100644 --- a/ci/svd2rust-regress/tests.yml +++ b/ci/svd2rust-regress/tests.yml @@ -1,1914 +1,506 @@ -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9CN11 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9CN12 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9G09 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9G15 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9G20 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9G25 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9G35 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9M10 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9M11 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9N12 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9X25 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: AT91SAM9X35 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3A4C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3A8C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N00A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N00B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N0A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N0B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N0C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N1A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N1B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N1C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N2A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N2B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N2C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N4A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N4B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3N4C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S1A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S1B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S1C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S2A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S2B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S2C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S4A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S4B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S4C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S8B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3S8C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3SD8B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3SD8C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3U1C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3U1E - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3U2C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3U2E - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3U4C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3U4E - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3X4C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3X4E - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3X8C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM3X8E - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM4S16B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM4S16C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM4S8B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM4S8C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM4SD32B - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAM4SD32C - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMA5D31 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMA5D33 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMA5D34 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMA5D35 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21E15A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21E16A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21E17A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21E18A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21G16A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21G17A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21G18A - svd_url: https://raw.githubusercontent.com/wez/atsamd21-rs/master/svd/ATSAMD21G18A.svd - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21J16A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21J17A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMD21J18A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMR21E16A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMR21E17A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMR21E18A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMR21G16A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMR21G17A - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Atmel - chip: ATSAMR21G18A - should_pass: false - run_when: never +# Atmel - BAD-SVD missing resetValue + +# Freescale - arch: cortex-m mfgr: Freescale - chip: MKV56F20 - should_pass: false - run_when: never + chip: MK02F12810 - arch: cortex-m mfgr: Freescale - chip: MKV56F22 - should_pass: false - run_when: never + chip: MK10D7 - arch: cortex-m mfgr: Freescale - chip: MKV56F24 - should_pass: false - run_when: never + chip: MK12D5 - arch: cortex-m mfgr: Freescale - chip: MKV58F20 - should_pass: false - run_when: never + chip: MK21D5 - arch: cortex-m mfgr: Freescale - chip: MKV58F22 - should_pass: false - run_when: never + chip: MK21F12 - arch: cortex-m mfgr: Freescale - chip: MKV58F24 - should_pass: false - run_when: never + chip: MK30D7 - arch: cortex-m mfgr: Freescale - chip: MK61F15 - should_pass: false - run_when: never + chip: MK40D7 - arch: cortex-m mfgr: Freescale - chip: MK61F15WS - should_pass: false - run_when: never + chip: MK52DZ10 - arch: cortex-m mfgr: Freescale - chip: MK70F12 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Freescale - chip: MK70F15 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Freescale - chip: MK70F15WS - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Freescale - chip: MK02F12810 -- arch: cortex-m - mfgr: Freescale - chip: MK10D10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK10D5 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK10D7 -- arch: cortex-m - mfgr: Freescale - chip: MK10DZ10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK10F12 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK11D5 -- arch: cortex-m - mfgr: Freescale - chip: MK11D5WS - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK11DA5 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK12D5 -- arch: cortex-m - mfgr: Freescale - chip: MK20D10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK20D5 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK20D7 -- arch: cortex-m - mfgr: Freescale - chip: MK20DZ10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK20F12 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK21D5 -- arch: cortex-m - mfgr: Freescale - chip: MK21D5WS - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK21DA5 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK21F12 -- arch: cortex-m - mfgr: Freescale - chip: MK21FA12 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK22D5 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK22F12 -- arch: cortex-m - mfgr: Freescale - chip: MK22F12810 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK22F25612 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK22F51212 -- arch: cortex-m - mfgr: Freescale - chip: MK22FA12 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK24F12 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK24F25612 -- arch: cortex-m - mfgr: Freescale - chip: MK26F18 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK30D10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK30D7 -- arch: cortex-m - mfgr: Freescale - chip: MK30DZ10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK40D10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK40D7 -- arch: cortex-m - mfgr: Freescale - chip: MK40DZ10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK50D10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK50D7 -- arch: cortex-m - mfgr: Freescale - chip: MK50DZ10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK51D10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK51D7 -- arch: cortex-m - mfgr: Freescale - chip: MK51DZ10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK52D10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK52DZ10 -- arch: cortex-m - mfgr: Freescale - chip: MK53D10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK53DZ10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK60D10 -- arch: cortex-m - mfgr: Freescale - chip: MK60DZ10 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK60F15 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK63F12 -- arch: cortex-m - mfgr: Freescale - chip: MK64F12 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK65F18 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK66F18 -- arch: cortex-m - mfgr: Freescale - chip: MK80F25615 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MK81F25615 - should_pass: true - run_when: not-short + chip: MK66F18 - arch: cortex-m mfgr: Freescale chip: MK82F25615 -- arch: cortex-m - mfgr: Freescale - chip: MKE14F16 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKE14Z7 - should_pass: true - run_when: not-short - arch: cortex-m mfgr: Freescale chip: MKE15Z7 - arch: cortex-m - mfgr: Freescale - chip: MKE16F16 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKE18F16 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL28T7_CORE0 -- arch: cortex-m - mfgr: Freescale - chip: MKL28T7_CORE1 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL28Z7 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL81Z7 -- arch: cortex-m - mfgr: Freescale - chip: MKL82Z7 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKS22F12 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV10Z1287 -- arch: cortex-m - mfgr: Freescale - chip: MKV10Z7 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV11Z7 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV30F12810 -- arch: cortex-m - mfgr: Freescale - chip: MKV31F12810 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV31F25612 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV31F51212 -- arch: cortex-m - mfgr: Freescale - chip: MKV40F15 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV42F16 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV43F15 -- arch: cortex-m - mfgr: Freescale - chip: MKV44F15 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV44F16 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV45F15 -- arch: cortex-m - mfgr: Freescale - chip: MKV46F15 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKV46F16 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKW20Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKW21D5 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKW21Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKW22D5 -- arch: cortex-m - mfgr: Freescale - chip: MKW24D5 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKW30Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKW31Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKW40Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKW41Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKE02Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKE04Z1284 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKE04Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKE06Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKE14D7 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKE15D7 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL02Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKL03Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL04Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL05Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKL13Z644 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL14Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL15Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKL16Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL17Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL17Z644 -- arch: cortex-m - mfgr: Freescale - chip: MKL24Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL25Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL26Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKL27Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL27Z644 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL33Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKL33Z644 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL34Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL36Z4 -- arch: cortex-m - mfgr: Freescale - chip: MKL43Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKL46Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKM14ZA5 -- arch: cortex-m - mfgr: Freescale - chip: MKM33ZA5 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKM34Z7 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: MKM34ZA5 -- arch: cortex-m - mfgr: Freescale - chip: MKW01Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: SKEAZ1284 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Freescale - chip: SKEAZN642 -- arch: cortex-m - mfgr: Freescale - chip: SKEAZN84 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF10xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF10xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF11xK -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF11xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF11xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF11xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF12xK -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF12xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF13xK -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF13xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF13xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF13xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF14xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF14xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF14xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF15xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF15xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF15xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF1AxL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF1AxM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF1AxN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF31xK -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF31xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF31xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF31xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF34xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF34xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF34xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF42xK -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AF42xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFA3xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFA3xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFA3xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFA4xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFA4xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFA4xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFAAxL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFAAxM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFAAxN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFB4xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFB4xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9AFB4xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9B160L -- arch: cortex-m - mfgr: Fujitsu - chip: MB9B160R -- arch: cortex-m - mfgr: Fujitsu - chip: MB9B360L -- arch: cortex-m - mfgr: Fujitsu - chip: MB9B360R -- arch: cortex-m - mfgr: Fujitsu - chip: MB9B460L -- arch: cortex-m - mfgr: Fujitsu - chip: MB9B460R -- arch: cortex-m - mfgr: Fujitsu - chip: MB9B560L -- arch: cortex-m - mfgr: Fujitsu - chip: MB9B560R -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF10xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF10xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF11xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF11xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF11xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF11xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF12xJ -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF12xK -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF12xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF12xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF12xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF12xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF21xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF21xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF30xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF30xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF31xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF31xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF31xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF31xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF32xK -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF32xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF32xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF32xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF32xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF40xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF40xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF41xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF41xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF41xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF41xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF42xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF42xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF50xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF50xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF51xN -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF51xR -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF51xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF51xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF52xK -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF52xL -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF52xM -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF52xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF52xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF61xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BF61xT -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BFD1xS -- arch: cortex-m - mfgr: Fujitsu - chip: MB9BFD1xT -- arch: cortex-m - mfgr: Fujitsu - chip: S6E1A1 -- arch: cortex-m - mfgr: Fujitsu - chip: S6E2CC -- arch: cortex-m - mfgr: Holtek - chip: ht32f125x -- arch: cortex-m - mfgr: Holtek - chip: ht32f175x -- arch: cortex-m - mfgr: Holtek - chip: ht32f275x -- arch: cortex-m - mfgr: Nordic - chip: nrf51 -- arch: cortex-m - mfgr: Nordic - chip: nrf52 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Nuvoton - chip: M051_Series - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Nuvoton - chip: NUC100_Series - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC11Exx_v5 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC11Uxx_v7 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC11xx_v6a - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC11xx_v6 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC13Uxx_v1 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC15xx_v0.7 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC800_v0.3 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC11E6x_v0.8 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC176x5x_v0.2 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC11Cxx_v9 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC178x_7x - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC178x_7x_v0.8 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC408x_7x_v0.7 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC11Axxv0.6 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC11D14_svd_v4 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC13xx_svd_v1 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC18xx_svd_v18 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC43xx_43Sxx - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC1102_4_v4 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: LPC5410x_v0.4 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: NXP - chip: MK22F25612 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: NXP - chip: MK22F51212 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: NXP - chip: MKW41Z4 - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3C1x4_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3C1x6_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3C1x7_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3L1x4_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3L1x6_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3L1x7_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3U1x4_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3U1x6_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3U1x7_SVD - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: SiliconLabs - chip: SIM3L1x8_SVD - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Spansion - chip: MB9AF12xK - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Spansion - chip: MB9AF12xL - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Spansion - chip: MB9AF42xK - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Spansion - chip: MB9AF42xL - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Spansion - chip: MB9BF12xJ - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKL28T7_CORE0 - arch: cortex-m - mfgr: Spansion - chip: MB9BF12xS - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKL81Z7 - arch: cortex-m - mfgr: Spansion - chip: MB9BF12xT - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKV10Z1287 - arch: cortex-m - mfgr: Spansion - chip: MB9BF16xx - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKV31F51212 - arch: cortex-m - mfgr: Spansion - chip: MB9BF32xS - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKV45F15 - arch: cortex-m - mfgr: Spansion - chip: MB9BF32xT - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKW22D5 - arch: cortex-m - mfgr: Spansion - chip: MB9BF36xx - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKE02Z4 - arch: cortex-m - mfgr: Spansion - chip: MB9BF42xS - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKE06Z4 - arch: cortex-m - mfgr: Spansion - chip: MB9BF42xT - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKL05Z4 - arch: cortex-m - mfgr: Spansion - chip: MB9BF46xx - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKL17Z644 - arch: cortex-m - mfgr: Spansion - chip: MB9BF52xS - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKL36Z4 - arch: cortex-m - mfgr: Spansion - chip: MB9BF52xT - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKM14ZA5 - arch: cortex-m - mfgr: Spansion - chip: MB9BF56xx - should_pass: true - run_when: not-short + mfgr: Freescale + chip: MKM34ZA5 - arch: cortex-m - mfgr: Spansion + mfgr: Freescale + chip: SKEAZN642 + +# Fujitsu +- arch: cortex-m + mfgr: Fujitsu chip: MB9AF10xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF10xR - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF11xK - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF11xL - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF11xM - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF11xN - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9AF12xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF12xL +- arch: cortex-m + mfgr: Fujitsu chip: MB9AF13xK - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF13xL - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF13xM - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF13xN - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF14xL - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF14xM - arch: cortex-m - mfgr: Spansion - chip: MB9AF14xN - should_pass: true - run_when: not-short -- arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF15xM - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF15xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF15xR - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9AF1AxL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF1AxM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF1AxN +- arch: cortex-m + mfgr: Fujitsu chip: MB9AF31xK - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF31xL - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF31xM - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF31xN - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF34xL - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF34xM - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AF34xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9AF42xK +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AF42xL +- arch: cortex-m + mfgr: Fujitsu chip: MB9AFA3xL - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AFA3xM - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AFA3xN - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AFA4xL - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AFA4xM - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AFA4xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9AFAAxL +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFAAxM +- arch: cortex-m + mfgr: Fujitsu + chip: MB9AFAAxN +- arch: cortex-m + mfgr: Fujitsu chip: MB9AFB4xL - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AFB4xM - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9AFB4xN - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9B160L +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B160R +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B360L +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B360R +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B460L +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B460R +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B560L +- arch: cortex-m + mfgr: Fujitsu + chip: MB9B560R +- arch: cortex-m + mfgr: Fujitsu chip: MB9BF10xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF10xR - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF11xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF11xR - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF11xS - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF11xT - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9BF12xJ +- arch: cortex-m + mfgr: Fujitsu chip: MB9BF12xK - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF12xL - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF12xM - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9BF12xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF12xT +- arch: cortex-m + mfgr: Fujitsu chip: MB9BF21xS - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF21xT - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF30xN - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF30xR - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF31xN - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF31xR - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF31xS - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF31xT - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF32xK - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF32xL - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF32xM - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9BF32xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF32xT +- arch: cortex-m + mfgr: Fujitsu chip: MB9BF40xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF40xR - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF41xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF41xR - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF41xS - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF41xT - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9BF42xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF42xT +- arch: cortex-m + mfgr: Fujitsu chip: MB9BF50xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF50xR - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF51xN - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF51xR - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF51xS - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF51xT - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF52xK - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF52xL - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF52xM - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu + chip: MB9BF52xS +- arch: cortex-m + mfgr: Fujitsu + chip: MB9BF52xT +- arch: cortex-m + mfgr: Fujitsu chip: MB9BF61xS - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BF61xT - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BFD1xS - arch: cortex-m - mfgr: Spansion + mfgr: Fujitsu chip: MB9BFD1xT - should_pass: true - run_when: not-short - arch: cortex-m - mfgr: STMicro - chip: STM32F030 + mfgr: Fujitsu + chip: S6E1A1 + +# GD32 + +# Holtek - arch: cortex-m - mfgr: STMicro - chip: STM32F0x2 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32f0x2.svd.patched + mfgr: Holtek + chip: ht32f125x - arch: cortex-m - mfgr: STMicro - chip: STM32F103 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32f103.svd.patched + mfgr: Holtek + chip: ht32f175x - arch: cortex-m - mfgr: STMicro - chip: STM32F411 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32f411.svd.patched + mfgr: Holtek + chip: ht32f275x + +# Microchip +- arch: mips + mfgr: Microchip + chip: pic32mx170f256b + svd_url: https://raw.githubusercontent.com/kiffie/pic32-pac/master/pic32mx1xxfxxxb/PIC32MX170F256B.svd.patched +- arch: mips + mfgr: Microchip + chip: pic32mx270f256b + svd_url: https://raw.githubusercontent.com/kiffie/pic32-pac/master/pic32mx2xxfxxxb/PIC32MX270F256B.svd.patched + +# Nordic - arch: cortex-m - mfgr: STMicro - chip: STM32F469 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32f469.svd.patched + mfgr: Nordic + chip: nrf51 - arch: cortex-m - mfgr: STMicro - chip: STM32F723 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32f723.svd.patched + mfgr: Nordic + chip: nrf52 + should_pass: false + run_when: never + +# Nuvoton - arch: cortex-m - mfgr: STMicro - chip: STM32G070 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32g070.svd.patched + mfgr: Nuvoton + chip: NUC100_Series - arch: cortex-m - mfgr: STMicro - chip: STM32G473 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32g473.svd.patched + mfgr: Nuvoton + chip: M051_Series + +# NXP - arch: cortex-m - mfgr: STMicro - chip: STM32H753 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32h753.svd.patched + mfgr: NXP + chip: MK22F25612 - arch: cortex-m - mfgr: STMicro - chip: STM32L0x3 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32l0x3.svd.patched + mfgr: NXP + chip: MKW41Z4 + +# MSP430 +- arch: msp430 + mfgr: TexasInstruments + chip: msp430g2553 + skip_check: true + svd_url: https://github.com/pftbest/msp430g2553/raw/v0.3.0-svd/msp430g2553.svd +- arch: msp430 + mfgr: TexasInstruments + chip: msp430fr2355 + skip_check: true + svd_url: https://raw.githubusercontent.com/YuhanLiin/msp430fr2355/master/msp430fr2355.svd + +# RISC-V +- arch: riscv + mfgr: SiFive + chip: e310x + svd_url: https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x/e310x.svd +- arch: riscv + mfgr: SiFive + chip: fu540 + svd_url: https://raw.githubusercontent.com/riscv-rust/fu540-pac/master/fu540.svd + +# SiliconLabs - arch: cortex-m - mfgr: STMicro - chip: STM32L162 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32l162.svd.patched + mfgr: SiliconLabs + chip: SIM3C1x4_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3C1x4.svd - arch: cortex-m - mfgr: STMicro - chip: STM32L4x6 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32l4x6.svd.patched + mfgr: SiliconLabs + chip: SIM3C1x6_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3C1x6.svd - arch: cortex-m - mfgr: STMicro - chip: STM32L562 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32l562.svd.patched + mfgr: SiliconLabs + chip: SIM3C1x7_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3C1x7.svd - arch: cortex-m - mfgr: STMicro - chip: STM32MP157 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32mp157.svd.patched + mfgr: SiliconLabs + chip: SIM3L1x4_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3L1x4.svd - arch: cortex-m - mfgr: STMicro - chip: STM32WB55 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32wb55.svd.patched + mfgr: SiliconLabs + chip: SIM3L1x6_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3L1x6.svd - arch: cortex-m - mfgr: STMicro - chip: STM32WLE5 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32wle5.svd.patched + mfgr: SiliconLabs + chip: SIM3L1x7_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3L1x7.svd +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3U1x4_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3U1x4.svd +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3U1x6_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3U1x6.svd +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3U1x7_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3U1x7.svd +- arch: cortex-m + mfgr: SiliconLabs + chip: SIM3L1x8_SVD + svd_url: https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3L1x8.svd + +# Spansion +- arch: cortex-m + mfgr: Spansion + chip: MB9BF36xx +- arch: cortex-m + mfgr: Spansion + chip: MB9BF46xx +- arch: cortex-m + mfgr: Spansion + chip: MB9BF56xx + +# STMicro - arch: cortex-m mfgr: STMicro - chip: STM32C011 - svd_url: https://stm32-rs.github.io/stm32-rs/stm32c011.svd.patched + chip: STM32F030 - arch: cortex-m mfgr: STMicro chip: STM32F031x @@ -1929,13 +521,7 @@ chip: STM32F100xx - arch: cortex-m mfgr: STMicro - chip: STM32F101xx -- arch: cortex-m - mfgr: STMicro - chip: STM32F102xx -- arch: cortex-m - mfgr: STMicro - chip: STM32F105xx + chip: STM32F103xx - arch: cortex-m mfgr: STMicro chip: STM32F107xx @@ -1948,33 +534,18 @@ - arch: cortex-m mfgr: STMicro chip: STM32F301 -- arch: cortex-m - mfgr: STMicro - chip: STM32F302 - arch: cortex-m mfgr: STMicro chip: STM32F303 -- arch: cortex-m - mfgr: STMicro - chip: STM32F3x4 -- arch: cortex-m - mfgr: STMicro - chip: STM32F373 - arch: cortex-m mfgr: STMicro chip: STM32F401 -- arch: cortex-m - mfgr: STMicro - chip: STM32F405 - arch: cortex-m mfgr: STMicro chip: STM32F407 - arch: cortex-m mfgr: STMicro chip: STM32F410 -- arch: cortex-m - mfgr: STMicro - chip: STM32F412 - arch: cortex-m mfgr: STMicro chip: STM32F413 @@ -1989,151 +560,132 @@ chip: STM32F446 - arch: cortex-m mfgr: STMicro - chip: STM32F7x -- arch: cortex-m - mfgr: STMicro - chip: STM32F7x2 -- arch: cortex-m - mfgr: STMicro - chip: STM32F7x5 + chip: STM32L100 - arch: cortex-m mfgr: STMicro - chip: STM32F7x6 + chip: STM32L15xC - arch: cortex-m mfgr: STMicro - chip: STM32F7x7 + chip: STM32L15xxE - arch: cortex-m mfgr: STMicro - chip: STM32F7x9 + chip: STM32L15xxxA - arch: cortex-m mfgr: STMicro - chip: STM32G07x - should_pass: false - run_when: never + chip: STM32L1xx - arch: cortex-m mfgr: STMicro - chip: STM32G431xx + chip: STM32W108 +# Patched - arch: cortex-m mfgr: STMicro - chip: STM32G441xx + chip: STM32F0x2 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f0x2.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32G471xx + chip: STM32F103 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f103.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32G474xx + chip: STM32F411 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f411.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32G483xx + chip: STM32F469 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f469.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32G484xx + chip: STM32F723 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32f723.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L100 + chip: STM32G070 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32g070.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L15xC + chip: STM32G473 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32g473.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L15xxE + chip: STM32H743 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32h743.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L15xxxA + chip: STM32L0x3 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32l0x3.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L1xx + chip: STM32L162 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32l162.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32W108 + chip: STM32L4x6 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32l4x6.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L051x - should_pass: false - run_when: never + chip: STM32L562 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32l562.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L052x - should_pass: false - run_when: never + chip: STM32MP157 + svd_url: https://stm32-rs.github.io/stm32-rs/stm32mp157.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L053x - should_pass: false - run_when: never + chip: STM32WB55 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32wb55.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L062x - should_pass: false - run_when: never + chip: STM32WLE5 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32wle5.svd.patched - arch: cortex-m mfgr: STMicro - chip: STM32L063x - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Toshiba - chip: M365 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Toshiba - chip: M367 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Toshiba - chip: M368 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Toshiba - chip: M369 - should_pass: false - run_when: never -- arch: cortex-m - mfgr: Toshiba - chip: M36B - should_pass: false - run_when: never + chip: STM32C011 + suffix: patched + svd_url: https://stm32-rs.github.io/stm32-rs/stm32c011.svd.patched + +# Toschiba - arch: cortex-m mfgr: Toshiba chip: M061 -- arch: riscv - mfgr: SiFive - chip: E310x - svd_url: https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x/e310x.svd - should_pass: false - run_when: never -- arch: msp430 - mfgr: TexasInstruments - chip: msp430g2553 - svd_url: https://github.com/pftbest/msp430g2553/raw/v0.1.3-svd/msp430g2553.svd -- arch: msp430 - mfgr: TexasInstruments - chip: msp430fr2355 - svd_url: https://raw.githubusercontent.com/YuhanLiin/msp430fr2355/master/msp430fr2355.svd + +# Espressif +# Xtensa requires special LLVM fork and nightly compiler, so skip the checks for now. - arch: xtensa-lx mfgr: Espressif chip: esp32 + opts: + - --ident-formats-theme + - legacy svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32.svd - arch: xtensa-lx mfgr: Espressif chip: esp32s2 + opts: + - --ident-formats-theme + - legacy svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s2.svd - arch: xtensa-lx mfgr: Espressif chip: esp32s3 + opts: + - --ident-formats-theme + - legacy svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s3.svd - arch: riscv mfgr: Espressif chip: esp32c3 svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32c3.svd -- arch: mips - mfgr: Microchip - chip: pic32mx170f256b - svd_url: https://raw.githubusercontent.com/kiffie/pic32-pac/master/pic32mx1xxfxxxb/PIC32MX170F256B.svd.patched -- arch: mips - mfgr: Microchip - chip: pic32mx270f256b - svd_url: https://raw.githubusercontent.com/kiffie/pic32-pac/master/pic32mx2xxfxxxb/PIC32MX270F256B.svd.patched diff --git a/src/util.rs b/src/util.rs index f97cb378..fd7bb3c2 100644 --- a/src/util.rs +++ b/src/util.rs @@ -71,9 +71,9 @@ impl Case { }, } } + pub fn sanitize<'a>(&self, s: &'a str) -> Cow<'a, str> { let s = sanitize(s); - self.cow_to_case(s) } } From 3807ab428f0e504e7cfff660e70be9b96c75bfff Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 7 Feb 2025 12:16:10 +0300 Subject: [PATCH 57/77] fix cluster derive --- src/generate/peripheral.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 5fd01178..72450077 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -1410,8 +1410,8 @@ fn cluster_block( Ok(quote! { #[doc = #description] - pub use self::#derived as #block_ty; - pub use self::#mod_derived as #mod_ty; + pub use #derived as #block_ty; + pub use #mod_derived as #mod_ty; }) } else { let cpath = path.new_cluster(&c.name); From 0e17ebfa6839407c510e5ac1b22a93be0bbff386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20C=C3=A1rdenas=20Rodr=C3=ADguez?= Date: Sat, 8 Feb 2025 12:20:13 +0100 Subject: [PATCH 58/77] Add mtvec_align for RISC-V --- CHANGELOG.md | 1 + src/config.rs | 12 +++++++++++- src/config/riscv.rs | 19 +++++++++++++++++++ src/lib.rs | 2 +- src/main.rs | 6 +++++- src/util.rs | 6 +++++- 6 files changed, 42 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 312c949a..6604f511 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Add `mtvec_align` field to `riscv_config` to configure the byte alignment of interrupt vector table. - Fix reexport path when "%s" inside "derivedFrom" - Force using rust edition 2021 in CI - Added lifetime ellision for `FieldWriter` where the explicit lifetimes are not necessary, which diff --git a/src/config.rs b/src/config.rs index ca6ced37..024d8b78 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,5 +1,5 @@ use anyhow::{bail, Result}; -use proc_macro2::Span; +use proc_macro2::{Span, TokenStream}; use std::{ collections::HashMap, ops::{Deref, DerefMut}, @@ -46,6 +46,12 @@ pub struct Config { pub settings: Settings, } +impl Config { + pub fn extra_build(&self) -> Option { + self.settings.extra_build() + } +} + #[allow(clippy::upper_case_acronyms)] #[allow(non_camel_case_types)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] @@ -345,6 +351,10 @@ impl Settings { self.riscv_config = source.riscv_config; } } + + pub fn extra_build(&self) -> Option { + self.riscv_config.as_ref().and_then(|cfg| cfg.extra_build()) + } } #[derive(Clone, PartialEq, Eq, Debug)] diff --git a/src/config/riscv.rs b/src/config/riscv.rs index 2091bc2f..90100762 100644 --- a/src/config/riscv.rs +++ b/src/config/riscv.rs @@ -1,3 +1,6 @@ +use proc_macro2::TokenStream; +use quote::quote; + #[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] #[derive(Clone, PartialEq, Eq, Debug, Default)] #[non_exhaustive] @@ -8,6 +11,22 @@ pub struct RiscvConfig { pub harts: Vec, pub clint: Option, pub plic: Option, + pub mtvec_align: Option, +} + +impl RiscvConfig { + pub fn extra_build(&self) -> Option { + self.mtvec_align.map(|align| { + quote! { + // set environment variable RISCV_MTVEC_ALIGN enfoce correct byte alignment of interrupt vector. + println!( + "cargo:rustc-env=RISCV_MTVEC_ALIGN={}", + #align + ); + println!("cargo:rerun-if-env-changed=RISCV_MTVEC_ALIGN"); + } + }) + } } #[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] diff --git a/src/lib.rs b/src/lib.rs index b5d5c4ab..ce3779ad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -671,7 +671,7 @@ pub fn generate(input: &str, config: &Config) -> Result { } else { Some(DeviceSpecific { device_x, - build_rs: util::build_rs().to_string(), + build_rs: util::build_rs(&config).to_string(), }) }; diff --git a/src/main.rs b/src/main.rs index 27607bfc..d1dc1f4a 100755 --- a/src/main.rs +++ b/src/main.rs @@ -366,7 +366,11 @@ Ignore this option if you are not building your own FPGA based soft-cores."), .contains(&config.target) { writeln!(File::create(path.join("device.x"))?, "{device_x}")?; - writeln!(File::create(path.join("build.rs"))?, "{}", build_rs())?; + writeln!( + File::create(path.join("build.rs"))?, + "{}", + build_rs(&config) + )?; } if config.feature_group || config.feature_peripheral { diff --git a/src/util.rs b/src/util.rs index fd7bb3c2..dbf0dde5 100644 --- a/src/util.rs +++ b/src/util.rs @@ -399,7 +399,9 @@ impl U32Ext for u32 { } } -pub fn build_rs() -> TokenStream { +pub fn build_rs(config: &Config) -> TokenStream { + let extra_build = config.extra_build(); + quote! { //! Builder file for Peripheral access crate generated by svd2rust tool @@ -419,6 +421,8 @@ pub fn build_rs() -> TokenStream { println!("cargo:rustc-link-search={}", out.display()); println!("cargo:rerun-if-changed=device.x"); + + #extra_build } println!("cargo:rerun-if-changed=build.rs"); From c27e1110f90568aaa1d9e863d50096631e570781 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Feb 2025 09:52:32 +0100 Subject: [PATCH 59/77] add Vorago va108xx chip to CI --- .github/workflows/ci.yml | 2 ++ ci/svd2rust-regress/src/tests.rs | 2 ++ ci/svd2rust-regress/tests.yml | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7e7756e..c87e2126 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,6 +90,8 @@ jobs: - { vendor: TexasInstruments, options: "-- --atomics" } - { vendor: Espressif } - { vendor: Espressif, options: "-- --atomics" } + - { vendor: Vorago } + - { vendor: Vorago, options: "-- --strict --atomics" } steps: - uses: actions/checkout@v4 diff --git a/ci/svd2rust-regress/src/tests.rs b/ci/svd2rust-regress/src/tests.rs index 4e40d4da..e71accbd 100644 --- a/ci/svd2rust-regress/src/tests.rs +++ b/ci/svd2rust-regress/src/tests.rs @@ -22,6 +22,7 @@ pub enum Manufacturer { Toshiba, SiFive, TexasInstruments, + Vorago, Espressif, Unknown, } @@ -40,6 +41,7 @@ impl Manufacturer { NXP, SiliconLabs, Spansion, + Vorago, STMicro, Toshiba, SiFive, diff --git a/ci/svd2rust-regress/tests.yml b/ci/svd2rust-regress/tests.yml index 27e08a6d..5d26bbb1 100644 --- a/ci/svd2rust-regress/tests.yml +++ b/ci/svd2rust-regress/tests.yml @@ -689,3 +689,9 @@ mfgr: Espressif chip: esp32c3 svd_url: https://raw.githubusercontent.com/espressif/svd/main/svd/esp32c3.svd + +# Vorago +- arch: cortex-m + mfgr: Vorago + chip: va108xx + svd_url: https://raw.githubusercontent.com/us-irs/va108xx-rs/refs/heads/main/va108xx/svd/va108xx.svd.patched From 1cacf2502ab7fcd8d6ffc09f4b921124748c9ad7 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 8 Feb 2025 13:40:50 +0300 Subject: [PATCH 60/77] update to svd-rs 0.14.11 --- CHANGELOG.md | 1 + Cargo.lock | 8 ++++---- Cargo.toml | 4 ++-- src/generate/register.rs | 27 +++++++++------------------ 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6604f511..d8c1c50e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Some fixes for the `svd2rust-regress` tool and update of its documentation - Other internal clippy fixes for `clippy::manual_div_ceil`, `clippy::nonminimal_bool` and `clippy::needless_lifetimes` +- Update `svd-rs` to 0.14.11 ## [v0.35.0] - 2024-11-12 diff --git a/Cargo.lock b/Cargo.lock index 9dc97544..049e0245 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1335,9 +1335,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "svd-parser" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ba83b8a290ee3a180051e10a043691bb91d1b6be2053a570936fbdbec5ee2b" +checksum = "5ee7838c1b248b3418519826888d6ed2be881092ccd815bf350bd713b1d9f687" dependencies = [ "anyhow", "roxmltree", @@ -1347,9 +1347,9 @@ dependencies = [ [[package]] name = "svd-rs" -version = "0.14.9" +version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e49a90f3c4d03d81687e81d41b00f349fd44ccf9c26e0185ee926968de093bb" +checksum = "1ec61cc12f8001859a87cca405aa84bfb2e5a083cfbf2eea804e5c23b6ad5a76" dependencies = [ "once_cell", "regex", diff --git a/Cargo.toml b/Cargo.toml index 0acbc255..c878da9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,11 +58,11 @@ url = { version = "2.5", features = ["serde"] } [dependencies.svd-parser] features = ["expand"] -version = "0.14.7" +version = "0.14.8" [dependencies.svd-rs] features = ["serde"] -version = "0.14.9" +version = "0.14.11" [dependencies.syn] version = "2.0" diff --git a/src/generate/register.rs b/src/generate/register.rs index 56e72472..7ff3c265 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -1341,24 +1341,15 @@ pub fn fields( }); } - // Update register modify bit masks - let offsets = match f { - MaybeArray::Array(info, dim) => (0..dim.dim) - .map(|i| i * dim.dim_increment + info.bit_offset()) - .collect(), - MaybeArray::Single(info) => vec![info.bit_offset()], - }; - for o in offsets { - let bitmask = (u64::MAX >> (64 - width)) << o; - use ModifiedWriteValues::*; - match mwv { - Modify | Set | Clear => {} - OneToSet | OneToClear | OneToToggle => { - one_to_modify_fields_bitmap |= bitmask; - } - ZeroToClear | ZeroToSet | ZeroToToggle => { - zero_to_modify_fields_bitmap |= bitmask; - } + let bitmask = f.bitmask(); + use ModifiedWriteValues::*; + match mwv { + Modify | Set | Clear => {} + OneToSet | OneToClear | OneToToggle => { + one_to_modify_fields_bitmap |= bitmask; + } + ZeroToClear | ZeroToSet | ZeroToToggle => { + zero_to_modify_fields_bitmap |= bitmask; } } } From 4b63081fbf797c4aea94e9b898e4b1ee278dd5a5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Feb 2025 11:57:35 +0100 Subject: [PATCH 61/77] try to display SVD URL for tracing --- ci/svd2rust-regress/src/svd_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/svd2rust-regress/src/svd_test.rs b/ci/svd2rust-regress/src/svd_test.rs index 4801bd3e..aa92752b 100644 --- a/ci/svd2rust-regress/src/svd_test.rs +++ b/ci/svd2rust-regress/src/svd_test.rs @@ -137,7 +137,7 @@ impl CommandHelper for Command { } impl TestCase { - #[tracing::instrument(skip(self, opts), fields(name = %self.name()))] + #[tracing::instrument(skip(self, opts), fields(name = %self.name(), svd=%self.svd_url()))] pub fn test( &self, opts: &Opts, From 977653183ec032b83603874f0dfe0318df1f8125 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 15 Jan 2025 17:48:35 +0100 Subject: [PATCH 62/77] improve docs of generated library --- CHANGELOG.md | 2 ++ src/generate/device.rs | 1 + src/lib.rs | 17 +++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8c1c50e..0c702336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Other internal clippy fixes for `clippy::manual_div_ceil`, `clippy::nonminimal_bool` and `clippy::needless_lifetimes` - Update `svd-rs` to 0.14.11 +- Added `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` to the generated library code. This + adds a display of the feature gates in the documentation of the generated library ## [v0.35.0] - 2024-11-12 diff --git a/src/generate/device.rs b/src/generate/device.rs index d2b3ee9c..7092953a 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -59,6 +59,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Date: Thu, 13 Feb 2025 12:02:28 +0100 Subject: [PATCH 63/77] Add Raspberry Pi to CI --- .github/workflows/ci.yml | 2 ++ ci/svd2rust-regress/src/tests.rs | 2 ++ ci/svd2rust-regress/tests.yml | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c87e2126..e92c4a31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,8 @@ jobs: - { vendor: Espressif, options: "-- --atomics" } - { vendor: Vorago } - { vendor: Vorago, options: "-- --strict --atomics" } + - { vendor: RaspberryPi } + - { vendor: RaspberryPi, options: "-- --atomics" } steps: - uses: actions/checkout@v4 diff --git a/ci/svd2rust-regress/src/tests.rs b/ci/svd2rust-regress/src/tests.rs index e71accbd..c7ebc083 100644 --- a/ci/svd2rust-regress/src/tests.rs +++ b/ci/svd2rust-regress/src/tests.rs @@ -24,6 +24,7 @@ pub enum Manufacturer { TexasInstruments, Vorago, Espressif, + RaspberryPi, Unknown, } @@ -45,6 +46,7 @@ impl Manufacturer { STMicro, Toshiba, SiFive, + RaspberryPi, TexasInstruments, Espressif, ] diff --git a/ci/svd2rust-regress/tests.yml b/ci/svd2rust-regress/tests.yml index 5d26bbb1..73a87549 100644 --- a/ci/svd2rust-regress/tests.yml +++ b/ci/svd2rust-regress/tests.yml @@ -695,3 +695,11 @@ mfgr: Vorago chip: va108xx svd_url: https://raw.githubusercontent.com/us-irs/va108xx-rs/refs/heads/main/va108xx/svd/va108xx.svd.patched + +# Raspberry Pi +- arch: cortex-m + mfgr: RaspberryPi + chip: rp2040 +- arch: cortex-m + mfgr: RaspberryPi + chip: rp2350 From 71f1c5e7322e6a29ffe7c1eccb3e93d1d54b83f8 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 2 Mar 2025 10:56:42 +0300 Subject: [PATCH 64/77] regress with edition 2021 --- Cargo.lock | 669 ++++++++++++++++++---------- ci/svd2rust-regress/Cargo.toml | 2 +- ci/svd2rust-regress/src/svd_test.rs | 1 + 3 files changed, 447 insertions(+), 225 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 049e0245..6caca339 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,19 +67,20 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "arrayref" @@ -93,6 +94,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.4.0" @@ -116,27 +123,21 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "bitflags" -version = "1.3.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "blake2b_simd" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" dependencies = [ "arrayref", "arrayvec", @@ -145,21 +146,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytes" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.2.0" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "shlex", ] @@ -172,9 +173,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.20" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", "clap_derive", @@ -182,9 +183,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstream", "anstyle", @@ -194,21 +195,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "colorchoice" @@ -240,9 +241,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -259,9 +260,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "darling" @@ -337,14 +338,14 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] name = "either" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" [[package]] name = "encoding_rs" @@ -357,9 +358,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -367,9 +368,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" dependencies = [ "anstream", "anstyle", @@ -380,25 +381,25 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fnv" @@ -437,6 +438,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -471,6 +473,7 @@ checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-io", + "futures-sink", "futures-task", "memchr", "pin-project-lite", @@ -478,6 +481,29 @@ dependencies = [ "slab", ] +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "gimli" version = "0.31.1" @@ -486,15 +512,15 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" -version = "0.3.26" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", "indexmap", "slab", @@ -505,9 +531,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -515,26 +541,20 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "http" -version = "0.2.12" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -543,26 +563,32 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", - "pin-project-lite", ] [[package]] -name = "httparse" -version = "1.9.5" +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] [[package]] -name = "httpdate" -version = "1.0.3" +name = "httparse" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "humantime" @@ -572,39 +598,74 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.31" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", + "http-body-util", "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -722,7 +783,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] @@ -754,9 +815,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown", @@ -770,9 +831,9 @@ checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "irx-config" @@ -798,16 +859,17 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -819,27 +881,27 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "log" -version = "0.4.22" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "matchers" @@ -864,30 +926,29 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", @@ -912,26 +973,26 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "openssl" -version = "0.10.68" +version = "0.10.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" dependencies = [ - "bitflags 2.6.0", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -948,23 +1009,33 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-src" +version = "300.4.2+3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" +dependencies = [ + "cc", +] [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -983,9 +1054,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1001,28 +1072,28 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -1093,20 +1164,24 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", "h2", "http", "http-body", + "http-body-util", "hyper", + "hyper-rustls", "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -1123,12 +1198,27 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", + "tower", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.15", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] @@ -1145,37 +1235,73 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.40" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", ] [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -1186,7 +1312,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -1195,9 +1321,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -1205,29 +1331,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.215" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" dependencies = [ "itoa", "memchr", @@ -1301,15 +1427,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1333,6 +1459,12 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "svd-parser" version = "0.14.8" @@ -1375,7 +1507,7 @@ dependencies = [ "serde_yaml", "svd-parser", "svd-rs", - "syn 2.0.87", + "syn 2.0.98", "thiserror", "url", ] @@ -1394,7 +1526,7 @@ dependencies = [ "serde_yaml", "shell-words", "svd2rust", - "syn 2.0.87", + "syn 2.0.98", "thiserror", "tracing", "tracing-subscriber", @@ -1415,9 +1547,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -1426,9 +1558,12 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" @@ -1438,25 +1573,25 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -1464,12 +1599,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.14.0" +version = "3.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" dependencies = [ "cfg-if", "fastrand", + "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -1492,7 +1628,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] @@ -1517,9 +1653,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.41.1" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -1540,11 +1676,21 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls", + "tokio", +] + [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -1587,6 +1733,27 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -1595,9 +1762,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1606,20 +1773,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -1638,9 +1805,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -1662,9 +1829,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unsafe-libyaml" @@ -1672,11 +1839,17 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -1704,9 +1877,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" @@ -1729,49 +1902,59 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1779,28 +1962,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -1847,6 +2033,36 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -2005,13 +2221,12 @@ dependencies = [ ] [[package]] -name = "winreg" -version = "0.50.0" +name = "wit-bindgen-rt" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "bitflags", ] [[package]] @@ -2028,9 +2243,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -2040,37 +2255,43 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", "synstructure", ] [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", "synstructure", ] +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + [[package]] name = "zerovec" version = "0.10.4" @@ -2090,5 +2311,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.98", ] diff --git a/ci/svd2rust-regress/Cargo.toml b/ci/svd2rust-regress/Cargo.toml index bd32d497..62f4cff4 100644 --- a/ci/svd2rust-regress/Cargo.toml +++ b/ci/svd2rust-regress/Cargo.toml @@ -8,7 +8,7 @@ rust-version = "1.82.0" [dependencies] clap = { version = "4.1", features = ["color", "derive", "string", "env"] } svd2rust = { path = "../../" } -reqwest = { version = "0.11", features = ["blocking"] } +reqwest = { version = "0.12", features = ["blocking", "native-tls-vendored"] } rayon = "1.4" anyhow = "1" thiserror = "1" diff --git a/ci/svd2rust-regress/src/svd_test.rs b/ci/svd2rust-regress/src/svd_test.rs index aa92752b..e376460a 100644 --- a/ci/svd2rust-regress/src/svd_test.rs +++ b/ci/svd2rust-regress/src/svd_test.rs @@ -203,6 +203,7 @@ impl TestCase { Command::new("cargo") .env("USER", user) .arg("init") + .args(["--edition", "2021"]) .arg("--name") .arg(chip_name) .arg("--vcs") From 63c851f9f76621b970c4c4e8b4c654448f4351a8 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 25 Oct 2024 17:38:41 +0300 Subject: [PATCH 65/77] disable respace --- CHANGELOG.md | 1 + src/generate/peripheral.rs | 43 ++++++++++++++++---------------------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8c1c50e..4eb79d85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Some fixes for the `svd2rust-regress` tool and update of its documentation - Other internal clippy fixes for `clippy::manual_div_ceil`, `clippy::nonminimal_bool` and `clippy::needless_lifetimes` +- Add missing `escape_special_chars` for peripheral description - Update `svd-rs` to 0.14.11 ## [v0.35.0] - 2024-11-12 diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 72450077..44f7594b 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -42,7 +42,8 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result let p_ty = ident(&name, config, "peripheral", span); let name_str = p_ty.to_string(); let address = util::hex(p.base_address + config.base_address_shift); - let description = util::respace(p.description.as_ref().unwrap_or(&p.name)); + let doc = util::respace(p.description.as_ref().unwrap_or(&name)); + let doc = util::escape_special_chars(&doc); let mod_ty = ident(&name, config, "peripheral_mod", span); let (derive_regs, base, path) = if let Some(path) = path { @@ -88,12 +89,12 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result let per_to_tokens = |out: &mut TokenStream, feature_attribute: &TokenStream, - description: &str, + doc: &str, p_ty: &Ident, doc_alias: Option, address: LitInt| { out.extend(quote! { - #[doc = #description] + #[doc = #doc] #phtml #doc_alias #feature_attribute @@ -140,7 +141,8 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result let mut feature_names = Vec::with_capacity(dim.dim as _); for pi in svd::peripheral::expand(p, dim) { let name = &pi.name; - let description = pi.description.as_deref().unwrap_or(&p.name); + let doc = util::respace(pi.description.as_ref().unwrap_or(&pi.name)); + let doc = util::escape_special_chars(&doc); let p_ty = ident(name, config, "peripheral", span); let name_str = p_ty.to_string(); let doc_alias = (&name_str != name).then(|| quote!(#[doc(alias = #name)])); @@ -155,7 +157,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result per_to_tokens( &mut out, &feature_attribute_n, - description, + &doc, &p_ty, doc_alias, address, @@ -169,7 +171,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result if derive_regs { // re-export the base module to allow deriveFrom this one out.extend(quote! { - #[doc = #description] + #[doc = #doc] #feature_any_attribute pub use self::#base as #mod_ty; }); @@ -182,21 +184,14 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result feature_attribute.extend(quote! { #[cfg(feature = #p_feature)] }) }; // Insert the peripheral structure - per_to_tokens( - &mut out, - &feature_attribute, - &description, - &p_ty, - None, - address, - ); + per_to_tokens(&mut out, &feature_attribute, &doc, &p_ty, None, address); // Derived peripherals may not require re-implementation, and will instead // use a single definition of the non-derived version. if derive_regs { // re-export the base module to allow deriveFrom this one out.extend(quote! { - #[doc = #description] + #[doc = #doc] #feature_attribute pub use self::#base as #mod_ty; }); @@ -205,9 +200,6 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result } } - let description = util::respace(p.description.as_ref().unwrap_or(&name)); - let description = util::escape_special_chars(&description); - // Build up an alternate erc list by expanding any derived registers/clusters // erc: *E*ither *R*egister or *C*luster let mut ercs = p.registers.take().unwrap_or_default(); @@ -246,7 +238,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result register_or_cluster_block(&ercs, &derive_infos, None, "Register block", None, config)?; out.extend(quote! { - #[doc = #description] + #[doc = #doc] #feature_attribute pub mod #mod_ty }); @@ -1381,8 +1373,9 @@ fn cluster_block( index: &Index, config: &Config, ) -> Result { - let description = util::respace(c.description.as_ref().unwrap_or(&c.name)); - let description = util::escape_special_chars(&description); + let doc = c.description.as_ref().unwrap_or(&c.name); + let doc = util::respace(doc); + let doc = util::escape_special_chars(&doc); let mod_name = c.name.remove_dim().to_string(); // name_snake_case needs to take into account array type. @@ -1409,7 +1402,7 @@ fn cluster_block( .push(path_segment(ident(&dname, config, "cluster_mod", span))); Ok(quote! { - #[doc = #description] + #[doc = #doc] pub use #derived as #block_ty; pub use #mod_derived as #mod_ty; }) @@ -1429,7 +1422,7 @@ fn cluster_block( &c.children, &mod_derive_infos, Some(&mod_name), - &description, + &doc, cluster_size, config, )?; @@ -1441,11 +1434,11 @@ fn cluster_block( }; Ok(quote! { - #[doc = #description] + #[doc = #doc] pub use self::#mod_ty::#block_ty; ///Cluster - #[doc = #description] + #[doc = #doc] pub mod #mod_ty { #mod_items } From 6b0e1ca1fd5a1f2b927ee4155c06ec2e1afcf302 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 9 Feb 2025 21:29:42 +0300 Subject: [PATCH 66/77] use generics for peripherals too --- CHANGELOG.md | 1 + src/generate/device.rs | 5 ---- src/generate/generic.rs | 59 +++++++++++++++++++++++++++++++++++--- src/generate/peripheral.rs | 48 +------------------------------ 4 files changed, 57 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eb79d85..56bf5aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Generic `Periph` - Add `mtvec_align` field to `riscv_config` to configure the byte alignment of interrupt vector table. - Fix reexport path when "%s" inside "derivedFrom" - Force using rust edition 2021 in CI diff --git a/src/generate/device.rs b/src/generate/device.rs index d2b3ee9c..16e2f195 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -62,11 +62,6 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { + _marker: marker::PhantomData, +} + +unsafe impl Send for Periph {} + +impl Periph { + ///Pointer to the register block + pub const PTR: *const RB = A as *const _; + + ///Return the pointer to the register block + #[inline(always)] + pub const fn ptr() -> *const RB { + Self::PTR + } + + /// Steal an instance of this peripheral + /// + /// # Safety + /// + /// Ensure that the new instance of the peripheral cannot be used in a way + /// that may race with any existing instances, for example by only + /// accessing read-only or write-only registers, or by consuming the + /// original peripheral and using critical sections to coordinate + /// access between multiple new instances. + /// + /// Additionally, other software such as HALs may rely on only one + /// peripheral instance existing to ensure memory safety; ensure + /// no stolen instances are passed to such software. + pub unsafe fn steal() -> Self { + Self { + _marker: marker::PhantomData, + } + } +} + +impl core::ops::Deref for Periph { + type Target = RB; + + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} + /// Raw register type (`u8`, `u16`, `u32`, ...) pub trait RawReg: Copy @@ -247,7 +293,10 @@ impl W { self } } -impl W where REG: Writable { +impl W +where + REG: Writable, +{ /// Writes raw bits to the register. #[inline(always)] pub fn set(&mut self, bits: REG::Ux) -> &mut Self { @@ -335,7 +384,8 @@ pub struct RangeFrom; pub struct RangeTo; /// Write field Proxy -pub type FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> = raw::FieldWriter<'a, REG, WI, FI, Safety>; +pub type FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> = + raw::FieldWriter<'a, REG, WI, FI, Safety>; impl FieldWriter<'_, REG, WI, FI, Safety> where @@ -390,7 +440,8 @@ where } } -impl<'a, REG, const WI: u8, FI, const MIN: u64, const MAX: u64> FieldWriter<'a, REG, WI, FI, Range> +impl<'a, REG, const WI: u8, FI, const MIN: u64, const MAX: u64> + FieldWriter<'a, REG, WI, FI, Range> where REG: Writable + RegisterSpec, FI: FieldSpec, @@ -478,7 +529,7 @@ macro_rules! bit_proxy { pub const fn width(&self) -> u8 { Self::WIDTH } - + /// Field offset #[inline(always)] pub const fn offset(&self) -> u8 { diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index 44f7594b..f5de3902 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -63,25 +63,6 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result feature_attribute.extend(quote! { #[cfg(feature = #feature_name)] }); }; - let steal_fn = quote! { - /// Steal an instance of this peripheral - /// - /// # Safety - /// - /// Ensure that the new instance of the peripheral cannot be used in a way - /// that may race with any existing instances, for example by only - /// accessing read-only or write-only registers, or by consuming the - /// original peripheral and using critical sections to coordinate - /// access between multiple new instances. - /// - /// Additionally, other software such as HALs may rely on only one - /// peripheral instance existing to ensure memory safety; ensure - /// no stolen instances are passed to such software. - pub unsafe fn steal() -> Self { - Self { _marker: PhantomData } - } - }; - let phtml = config.settings.html_url.as_ref().map(|url| { let doc = format!("See peripheral [structure]({url}#{})", &path.peripheral); quote!(#[doc = ""] #[doc = #doc]) @@ -98,34 +79,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result #phtml #doc_alias #feature_attribute - pub struct #p_ty { _marker: PhantomData<*const ()> } - - #feature_attribute - unsafe impl Send for #p_ty {} - - #feature_attribute - impl #p_ty { - ///Pointer to the register block - pub const PTR: *const #base::RegisterBlock = #address as *const _; - - ///Return the pointer to the register block - #[inline(always)] - pub const fn ptr() -> *const #base::RegisterBlock { - Self::PTR - } - - #steal_fn - } - - #feature_attribute - impl Deref for #p_ty { - type Target = #base::RegisterBlock; - - #[inline(always)] - fn deref(&self) -> &Self::Target { - unsafe { &*Self::PTR } - } - } + pub type #p_ty = crate::Periph<#base::RegisterBlock, #address>; #feature_attribute impl core::fmt::Debug for #p_ty { From c186174d64235d3518be031f23f288f38dc8d089 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 5 Feb 2025 10:28:46 +0100 Subject: [PATCH 67/77] update CI to run clippy and docs --- .github/workflows/ci.yml | 35 ++++++--- ci/svd2rust-regress/src/command.rs | 10 ++- ci/svd2rust-regress/src/github.rs | 2 +- ci/svd2rust-regress/src/main.rs | 42 ++++++++++- ci/svd2rust-regress/src/svd_test.rs | 107 +++++++++++++++++++++++----- 5 files changed, 162 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e92c4a31..1c56f42d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: ci: name: CI runs-on: ubuntu-latest - needs: [check, ci-linux, ci-clippy, ci-serde] + needs: [check, ci-linux, ci-docs-clippy, ci-serde] if: always() steps: - name: Done @@ -127,15 +127,32 @@ jobs: # stable. run: cargo +stable regress tests --toolchain 1.76.0 -m Nordic -- --strict --atomics - ci-clippy: + ci-docs-clippy: runs-on: ubuntu-latest needs: [check] + strategy: + fail-fast: false + matrix: + include: + # STMicro + - { chip: STM32F030 } + - { chip: STM32F410 } + - { chip: STM32L1xx } + # Espressif + - { chip: esp32c3 } + # Freescale + - { chip: MKW22D5 } + - { chip: MK02F12810 } + # Silicon Labs + - { chip: SIM3L1x8_SVD } + # Nordic chips + - { chip: nrf51, options: "-- -f register_mod::s:_mod" } + - { chip: nrf52, options: "-- -f register_mod::s:_mod" } steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable + - uses: dtolnay/rust-toolchain@nightly + - uses: dtolnay/rust-toolchain@stable - name: Cache uses: Swatinem/rust-cache@v2 @@ -144,12 +161,8 @@ jobs: run: | cargo install svd2rust --path . - - name: Run CI script - env: - VENDOR: RISC-V - OPTIONS: "" - COMMAND: clippy - run: bash ci/script.sh + - name: Check docs and clippy on generated PACs + run: cargo regress test -c ${{ matrix.chip }} --docs-stable --docs-nightly --clippy ${{ matrix.options }} ci-serde: runs-on: ubuntu-latest diff --git a/ci/svd2rust-regress/src/command.rs b/ci/svd2rust-regress/src/command.rs index 2c873bb8..2786166c 100644 --- a/ci/svd2rust-regress/src/command.rs +++ b/ci/svd2rust-regress/src/command.rs @@ -7,7 +7,8 @@ pub trait CommandExt { fn run(&mut self, hide: bool) -> Result<(), anyhow::Error>; #[track_caller] - fn get_output(&mut self, can_fail: bool) -> Result; + fn run_and_get_output(&mut self, can_fail: bool) + -> Result; #[track_caller] fn get_output_string(&mut self) -> Result; @@ -33,7 +34,10 @@ impl CommandExt for Command { } #[track_caller] - fn get_output(&mut self, can_fail: bool) -> Result { + fn run_and_get_output( + &mut self, + can_fail: bool, + ) -> Result { let output = self .output() .with_context(|| format!("command `{}` couldn't be run", self.display()))?; @@ -51,7 +55,7 @@ impl CommandExt for Command { #[track_caller] fn get_output_string(&mut self) -> Result { - String::from_utf8(self.get_output(true)?.stdout).map_err(Into::into) + String::from_utf8(self.run_and_get_output(true)?.stdout).map_err(Into::into) } fn display(&self) -> String { diff --git a/ci/svd2rust-regress/src/github.rs b/ci/svd2rust-regress/src/github.rs index 5dc68508..5a9bbf2b 100644 --- a/ci/svd2rust-regress/src/github.rs +++ b/ci/svd2rust-regress/src/github.rs @@ -148,7 +148,7 @@ pub fn get_release_binary_artifact( Command::new("gzip") .arg("-d") .arg(output_dir.join(artifact)) - .get_output(false)?; + .run_and_get_output(false)?; } } _ => { diff --git a/ci/svd2rust-regress/src/main.rs b/ci/svd2rust-regress/src/main.rs index 22b03985..36dec528 100644 --- a/ci/svd2rust-regress/src/main.rs +++ b/ci/svd2rust-regress/src/main.rs @@ -90,6 +90,18 @@ pub struct TestAll { /// Enable splitting `lib.rs` with `form` pub form_lib: bool, + /// Check generated crates with clippy. + #[clap(long)] + pub clippy: bool, + + /// Check documentation build with stable. + #[clap(long)] + pub docs_stable: bool, + + /// Check documentation build with nightly settings (docs.rs equivalent). + #[clap(long)] + pub docs_nightly: bool, + /// Print all available test using the specified filters #[clap(long)] pub list: bool, @@ -143,6 +155,18 @@ pub struct Test { /// Chip to use, use `--url` or `--svd-file` for another way to specify svd pub chip: Option, + /// Check generated crate with clippy. + #[arg(long)] + pub clippy: bool, + + /// Check documentation build with stable. + #[clap(long)] + pub docs_stable: bool, + + /// Check documentation build with nightly settings (docs.rs equivalent). + #[clap(long)] + pub docs_nightly: bool, + /// Path to an `svd2rust` binary, relative or absolute. /// Defaults to `target/release/svd2rust[.exe]` of this repository /// (which must be already built) @@ -191,7 +215,14 @@ impl Test { .ok_or_else(|| anyhow::anyhow!("no test found for chip"))? .to_owned() }; - test.test(opts, &self.current_bin_path, &self.passthrough_opts)?; + test.test( + opts, + &self.current_bin_path, + self.clippy, + self.docs_stable, + self.docs_nightly, + &self.passthrough_opts, + )?; Ok(()) } } @@ -247,7 +278,14 @@ impl TestAll { tests.par_iter().for_each(|t| { let start = Instant::now(); - match t.test(opt, &self.current_bin_path, &self.passthrough_opts) { + match t.test( + opt, + &self.current_bin_path, + self.clippy, + self.docs_stable, + self.docs_nightly, + &self.passthrough_opts, + ) { Ok(s) => { if let Some(stderrs) = s { let mut buf = String::new(); diff --git a/ci/svd2rust-regress/src/svd_test.rs b/ci/svd2rust-regress/src/svd_test.rs index e376460a..534202c8 100644 --- a/ci/svd2rust-regress/src/svd_test.rs +++ b/ci/svd2rust-regress/src/svd_test.rs @@ -71,7 +71,7 @@ impl std::fmt::Debug for ProcessFailed { } trait CommandHelper { - fn capture_outputs( + fn run_and_capture_outputs( &mut self, cant_fail: bool, name: &str, @@ -79,11 +79,27 @@ trait CommandHelper { stderr: Option<&PathBuf>, previous_processes_stderr: &[PathBuf], ) -> Result<(), TestError>; + + fn run_and_capture_stderr( + &mut self, + cant_fail: bool, + name: &str, + stderr: &PathBuf, + previous_processes_stderr: &[PathBuf], + ) -> Result<(), TestError> { + self.run_and_capture_outputs( + cant_fail, + name, + None, + Some(stderr), + previous_processes_stderr, + ) + } } impl CommandHelper for Command { #[tracing::instrument(skip_all, fields(stdout = tracing::field::Empty, stderr = tracing::field::Empty))] - fn capture_outputs( + fn run_and_capture_outputs( &mut self, cant_fail: bool, name: &str, @@ -91,7 +107,7 @@ impl CommandHelper for Command { stderr: Option<&PathBuf>, previous_processes_stderr: &[PathBuf], ) -> Result<(), TestError> { - let output = self.get_output(true)?; + let output = self.run_and_get_output(true)?; let out_payload = String::from_utf8_lossy(&output.stdout); if let Some(out) = stdout { file_helper(&out_payload, out)?; @@ -142,10 +158,13 @@ impl TestCase { &self, opts: &Opts, bin_path: &Path, - cli_opts: &Option>, + run_clippy: bool, + run_docs_stable: bool, + run_docs_nightly: bool, + cli_passthrough_opts: &Option>, ) -> Result>, TestError> { let (chip_dir, mut process_stderr_paths) = self - .setup_case(&opts.output_dir, bin_path, cli_opts) + .setup_case(&opts.output_dir, bin_path, cli_passthrough_opts) .with_context(|| anyhow!("when setting up case for {}", self.name()))?; // Run `cargo check`, capturing stderr to a log file if !self.skip_check { @@ -153,16 +172,70 @@ impl TestCase { Command::new("cargo") .arg("check") .current_dir(&chip_dir) - .capture_outputs( + .run_and_capture_stderr( true, "cargo check", - None, - Some(&cargo_check_err_file), + &cargo_check_err_file, &process_stderr_paths, ) - .with_context(|| "failed to check")?; + .with_context(|| "failed to check with cargo check")?; process_stderr_paths.push(cargo_check_err_file); } + if run_docs_nightly { + tracing::info!("Checking docs build with nightly"); + let cargo_docs_err_file = path_helper_base(&chip_dir, &["cargo-docs-nightly.err.log"]); + // Docs are built like docs.rs would build them. Additionally, build with all features. + + // Set the RUSTDOCFLAGS environment variable + let rustdocflags = "--cfg docsrs --generate-link-to-definition -Z unstable-options"; + Command::new("cargo") + .arg("+nightly") + .arg("doc") + .arg("--all-features") + .env("RUSTDOCFLAGS", rustdocflags) // Set the environment variable + .current_dir(&chip_dir) + .run_and_capture_stderr( + true, + "cargo docs nightly", + &cargo_docs_err_file, + &process_stderr_paths, + ) + .with_context(|| "failed to generate docs with cargo docs")?; + } + if run_docs_stable { + tracing::info!("Checking docs build with stable"); + let cargo_docs_err_file = path_helper_base(&chip_dir, &["cargo-docs-stable.err.log"]); + // Docs are built like docs.rs would build them. Additionally, build with all features. + Command::new("cargo") + .arg("+stable") + .arg("doc") + .arg("--all-features") + .current_dir(&chip_dir) + .run_and_capture_stderr( + true, + "cargo docs stable", + &cargo_docs_err_file, + &process_stderr_paths, + ) + .with_context(|| "failed to generate docs with cargo docs")?; + } + if run_clippy { + tracing::info!("Checking with clippy"); + let cargo_clippy_err_file = path_helper_base(&chip_dir, &["cargo-clippy.err.log"]); + Command::new("cargo") + .arg("clippy") + .arg("--") + .arg("-D") + .arg("warnings") + .current_dir(&chip_dir) + .run_and_capture_stderr( + true, + "cargo clippy", + &cargo_clippy_err_file, + &process_stderr_paths, + ) + .with_context(|| "failed to check with cargo clippy")?; + } Ok(if opts.verbose > 1 { Some(process_stderr_paths) } else { @@ -170,13 +243,13 @@ impl TestCase { }) } - #[tracing::instrument(skip(self, output_dir, command), fields(name = %self.name(), chip_dir = tracing::field::Empty))] + #[tracing::instrument(skip(self, output_dir, passthrough_opts), fields(name = %self.name(), chip_dir = tracing::field::Empty))] pub fn setup_case( &self, output_dir: &Path, svd2rust_bin_path: &Path, - command: &Option>, + passthrough_opts: &Option>, ) -> Result<(PathBuf, Vec), TestError> { let user = match std::env::var("USER") { Ok(val) => val, @@ -210,10 +283,10 @@ impl TestCase { .arg("none") .arg("--lib") .arg(&chip_dir) - .capture_outputs(true, "cargo init", None, None, &[]) + .run_and_capture_outputs(true, "cargo init", None, None, &[]) .with_context(|| "Failed to cargo init")?; - self.prepare_chip_test_toml(&chip_dir, command)?; + self.prepare_chip_test_toml(&chip_dir, passthrough_opts)?; let chip_svd = self.prepare_svd_file(&chip_dir)?; self.prepare_rust_toolchain_file(&chip_dir)?; @@ -226,7 +299,7 @@ impl TestCase { &chip_dir, &lib_rs_file, &svd2rust_err_file, - command, + passthrough_opts, )?; process_stderr_paths.push(svd2rust_err_file); match self.arch { @@ -262,7 +335,7 @@ impl TestCase { .arg(&new_lib_rs_file) .arg("--outdir") .arg(&src_dir) - .capture_outputs( + .run_and_capture_outputs( true, "form", None, @@ -291,7 +364,7 @@ impl TestCase { Command::new(rustfmt_bin_path) .arg(entry) .args(["--edition", "2021"]) - .capture_outputs( + .run_and_capture_outputs( false, "rustfmt", None, @@ -417,7 +490,7 @@ impl TestCase { if let Some(opts) = self.opts.as_ref() { base_cmd.args(opts); } - base_cmd.current_dir(chip_dir).capture_outputs( + base_cmd.current_dir(chip_dir).run_and_capture_outputs( true, "svd2rust", Some(lib_rs_file).filter(|_| { From 90196b014f92755a291fc23ae23b42a386c81d66 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 7 Mar 2025 09:22:35 +0300 Subject: [PATCH 68/77] temporary disable SIM3L1x8_SVD --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c56f42d..b85cb520 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,7 +144,8 @@ jobs: - { chip: MKW22D5 } - { chip: MK02F12810 } # Silicon Labs - - { chip: SIM3L1x8_SVD } + # TODO: fix doc rendering bug when math `>` is present in description + #- { chip: SIM3L1x8_SVD } # Nordic chips - { chip: nrf51, options: "-- -f register_mod::s:_mod" } - { chip: nrf52, options: "-- -f register_mod::s:_mod" } From 0f21f90633e9ef64011bac40e39cdd3a48ad880f Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 7 Mar 2025 11:39:40 +0300 Subject: [PATCH 69/77] Split on the start of attribute instead of the end --- .github/workflows/ci.yml | 3 +-- CHANGELOG.md | 1 + src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b85cb520..1c56f42d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,8 +144,7 @@ jobs: - { chip: MKW22D5 } - { chip: MK02F12810 } # Silicon Labs - # TODO: fix doc rendering bug when math `>` is present in description - #- { chip: SIM3L1x8_SVD } + - { chip: SIM3L1x8_SVD } # Nordic chips - { chip: nrf51, options: "-- -f register_mod::s:_mod" } - { chip: nrf52, options: "-- -f register_mod::s:_mod" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 157948d7..110b0c25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Update `svd-rs` to 0.14.11 - Added `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` to the generated library code. This adds a display of the feature gates in the documentation of the generated library +- Split on the start of attribute instead of the end ## [v0.35.0] - 2024-11-12 diff --git a/src/main.rs b/src/main.rs index d1dc1f4a..d3efbeba 100755 --- a/src/main.rs +++ b/src/main.rs @@ -353,7 +353,7 @@ Ignore this option if you are not building your own FPGA based soft-cores."), let filename = if config.make_mod { "mod.rs" } else { "lib.rs" }; let mut file = File::create(path.join(filename)).expect("Couldn't create output file"); - let data = items.to_string().replace("] ", "]\n"); + let data = items.to_string().replace(" # [", "\n#["); file.write_all(data.as_ref()) .expect("Could not write code to lib.rs"); From 6b30ea5ae8d63763b57cba72d1697ae29cbe0fc2 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Thu, 9 May 2024 07:36:22 +0300 Subject: [PATCH 70/77] use ConstZero/One instead of Default --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 1 + src/generate/generic.rs | 39 +++++++++++++++---------------- src/generate/generic_atomic.rs | 8 +++---- src/generate/generic_reg_vcell.rs | 4 ++-- src/generate/register.rs | 21 +++++++++++------ src/util.rs | 5 ++++ 7 files changed, 46 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c56f42d..0aa32833 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ on: push: - branches: master + branches: [master] pull_request: merge_group: diff --git a/CHANGELOG.md b/CHANGELOG.md index 110b0c25..e921e919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] - Generic `Periph` +- use `ConstZero::ZERO` instead of `Default::default()` to force const - Add `mtvec_align` field to `riscv_config` to configure the byte alignment of interrupt vector table. - Fix reexport path when "%s" inside "derivedFrom" - Force using rust edition 2021 in CI diff --git a/src/generate/generic.rs b/src/generate/generic.rs index 9d124093..e527a4a8 100644 --- a/src/generate/generic.rs +++ b/src/generate/generic.rs @@ -49,7 +49,6 @@ impl core::ops::Deref for Periph { /// Raw register type (`u8`, `u16`, `u32`, ...) pub trait RawReg: Copy - + Default + From + core::ops::BitOr + core::ops::BitAnd @@ -60,8 +59,10 @@ pub trait RawReg: { /// Mask for bits of width `WI` fn mask() -> Self; - /// Mask for bits of width 1 - fn one() -> Self; + /// `0` + const ZERO: Self; + /// `1` + const ONE: Self; } macro_rules! raw_reg { @@ -71,10 +72,8 @@ macro_rules! raw_reg { fn mask() -> Self { $mask::() } - #[inline(always)] - fn one() -> Self { - 1 - } + const ZERO: Self = 0; + const ONE: Self = 1; } const fn $mask() -> $U { <$U>::MAX >> ($size - WI) @@ -120,10 +119,10 @@ pub trait Writable: RegisterSpec { type Safety; /// Specifies the register bits that are not changed if you pass `1` and are changed if you pass `0` - const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux; + const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = Self::Ux::ZERO; /// Specifies the register bits that are not changed if you pass `0` and are changed if you pass `1` - const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux; + const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = Self::Ux::ZERO; } /// Reset value of the register. @@ -132,7 +131,7 @@ pub trait Writable: RegisterSpec { /// register by using the `reset` method. pub trait Resettable: RegisterSpec { /// Reset value of the register. - const RESET_VALUE: Self::Ux; + const RESET_VALUE: Self::Ux = Self::Ux::ZERO; /// Reset value of the register. #[inline(always)] @@ -539,8 +538,8 @@ macro_rules! bit_proxy { /// Writes bit to the field #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { - self.w.bits &= !(REG::Ux::one() << self.o); - self.w.bits |= (REG::Ux::from(value) & REG::Ux::one()) << self.o; + self.w.bits &= !(REG::Ux::ONE << self.o); + self.w.bits |= (REG::Ux::from(value) & REG::Ux::ONE) << self.o; self.w } /// Writes `variant` to the field @@ -568,13 +567,13 @@ where /// Sets the field bit #[inline(always)] pub fn set_bit(self) -> &'a mut W { - self.w.bits |= REG::Ux::one() << self.o; + self.w.bits |= REG::Ux::ONE << self.o; self.w } /// Clears the field bit #[inline(always)] pub fn clear_bit(self) -> &'a mut W { - self.w.bits &= !(REG::Ux::one() << self.o); + self.w.bits &= !(REG::Ux::ONE << self.o); self.w } } @@ -587,7 +586,7 @@ where /// Sets the field bit #[inline(always)] pub fn set_bit(self) -> &'a mut W { - self.w.bits |= REG::Ux::one() << self.o; + self.w.bits |= REG::Ux::ONE << self.o; self.w } } @@ -600,7 +599,7 @@ where /// Clears the field bit #[inline(always)] pub fn clear_bit(self) -> &'a mut W { - self.w.bits &= !(REG::Ux::one() << self.o); + self.w.bits &= !(REG::Ux::ONE << self.o); self.w } } @@ -613,7 +612,7 @@ where ///Clears the field bit by passing one #[inline(always)] pub fn clear_bit_by_one(self) -> &'a mut W { - self.w.bits |= REG::Ux::one() << self.o; + self.w.bits |= REG::Ux::ONE << self.o; self.w } } @@ -626,7 +625,7 @@ where ///Sets the field bit by passing zero #[inline(always)] pub fn set_bit_by_zero(self) -> &'a mut W { - self.w.bits &= !(REG::Ux::one() << self.o); + self.w.bits &= !(REG::Ux::ONE << self.o); self.w } } @@ -639,7 +638,7 @@ where ///Toggle the field bit by passing one #[inline(always)] pub fn toggle_bit(self) -> &'a mut W { - self.w.bits |= REG::Ux::one() << self.o; + self.w.bits |= REG::Ux::ONE << self.o; self.w } } @@ -652,7 +651,7 @@ where ///Toggle the field bit by passing zero #[inline(always)] pub fn toggle_bit(self) -> &'a mut W { - self.w.bits &= !(REG::Ux::one() << self.o); + self.w.bits &= !(REG::Ux::ONE << self.o); self.w } } diff --git a/src/generate/generic_atomic.rs b/src/generate/generic_atomic.rs index 54c491c3..55250961 100644 --- a/src/generate/generic_atomic.rs +++ b/src/generate/generic_atomic.rs @@ -39,7 +39,7 @@ mod atomic { impl Reg where - REG::Ux: AtomicOperations + REG::Ux: AtomicOperations, { /// Set high every bit in the register that was set in the write proxy. Leave other bits /// untouched. The write is done in a single atomic instruction. @@ -53,7 +53,7 @@ mod atomic { F: FnOnce(&mut W) -> &mut W, { let bits = f(&mut W { - bits: Default::default(), + bits: REG::Ux::ZERO, _reg: marker::PhantomData, }) .bits; @@ -72,7 +72,7 @@ mod atomic { F: FnOnce(&mut W) -> &mut W, { let bits = f(&mut W { - bits: !REG::Ux::default(), + bits: !REG::Ux::ZERO, _reg: marker::PhantomData, }) .bits; @@ -91,7 +91,7 @@ mod atomic { F: FnOnce(&mut W) -> &mut W, { let bits = f(&mut W { - bits: Default::default(), + bits: REG::Ux::ZERO, _reg: marker::PhantomData, }) .bits; diff --git a/src/generate/generic_reg_vcell.rs b/src/generate/generic_reg_vcell.rs index b0ca0d5e..9e436334 100644 --- a/src/generate/generic_reg_vcell.rs +++ b/src/generate/generic_reg_vcell.rs @@ -148,7 +148,7 @@ impl Reg { F: FnOnce(&mut W) -> &mut W, { let value = f(&mut W { - bits: REG::Ux::default(), + bits: REG::Ux::ZERO, _reg: marker::PhantomData, }) .bits; @@ -169,7 +169,7 @@ impl Reg { F: FnOnce(&mut W) -> T, { let mut writer = W { - bits: REG::Ux::default(), + bits: REG::Ux::ZERO, _reg: marker::PhantomData, }; diff --git a/src/generate/register.rs b/src/generate/register.rs index 7ff3c265..c1cdc876 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -413,24 +413,31 @@ pub fn render_register_mod( let doc = format!("`write(|w| ..)` method takes [`{mod_ty}::W`](W) writer structure",); - let zero_to_modify_fields_bitmap = util::hex(zero_to_modify_fields_bitmap); - let one_to_modify_fields_bitmap = util::hex(one_to_modify_fields_bitmap); + let zero_to_modify_fields_bitmap = util::hex_nonzero(zero_to_modify_fields_bitmap) + .map(|bm| quote!(const ZERO_TO_MODIFY_FIELDS_BITMAP: #rty = #bm;)); + let one_to_modify_fields_bitmap = util::hex_nonzero(one_to_modify_fields_bitmap) + .map(|bm| quote!(const ONE_TO_MODIFY_FIELDS_BITMAP: #rty = #bm;)); mod_items.extend(quote! { #[doc = #doc] impl crate::Writable for #regspec_ty { type Safety = crate::#safe_ty; - const ZERO_TO_MODIFY_FIELDS_BITMAP: #rty = #zero_to_modify_fields_bitmap; - const ONE_TO_MODIFY_FIELDS_BITMAP: #rty = #one_to_modify_fields_bitmap; + #zero_to_modify_fields_bitmap + #one_to_modify_fields_bitmap } }); } - if let Some(rv) = properties.reset_value.map(util::hex) { - let doc = format!("`reset()` method sets {} to value {rv}", register.name); + if let Some(rv) = properties.reset_value.map(util::hex_nonzero) { + let doc = if let Some(rv) = &rv { + format!("`reset()` method sets {} to value {rv}", register.name) + } else { + format!("`reset()` method sets {} to value 0", register.name) + }; + let rv = rv.map(|rv| quote!(const RESET_VALUE: #rty = #rv;)); mod_items.extend(quote! { #[doc = #doc] impl crate::Resettable for #regspec_ty { - const RESET_VALUE: #rty = #rv; + #rv } }); } diff --git a/src/util.rs b/src/util.rs index dbf0dde5..40a1e526 100644 --- a/src/util.rs +++ b/src/util.rs @@ -255,6 +255,11 @@ pub fn hex(n: u64) -> LitInt { ) } +/// Turns non-zero `n` into an unsuffixed separated hex token +pub fn hex_nonzero(n: u64) -> Option { + (n != 0).then(|| hex(n)) +} + /// Turns `n` into an unsuffixed token pub fn unsuffixed(n: impl Into) -> LitInt { LitInt::new(&n.into().to_string(), Span::call_site()) From 77aff9bdee93f9425c5091db1c150ec1c1fbdc5c Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 8 Mar 2025 08:10:54 +0300 Subject: [PATCH 71/77] release 0.36 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e921e919..ab5992eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [v0.36.0] - 2025-03-09 + - Generic `Periph` - use `ConstZero::ZERO` instead of `Default::default()` to force const - Add `mtvec_align` field to `riscv_config` to configure the byte alignment of interrupt vector table. @@ -946,7 +948,8 @@ peripheral.register.write(|w| w.field().set()); - Initial version of the `svd2rust` tool -[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.35.0...HEAD +[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.36.0...HEAD +[v0.36.0]: https://github.com/rust-embedded/svd2rust/compare/v0.35.0...v0.36.0 [v0.35.0]: https://github.com/rust-embedded/svd2rust/compare/v0.34.0...v0.35.0 [v0.34.0]: https://github.com/rust-embedded/svd2rust/compare/v0.33.5...v0.34.0 [v0.33.5]: https://github.com/rust-embedded/svd2rust/compare/v0.33.4...v0.33.5 diff --git a/Cargo.lock b/Cargo.lock index 6caca339..f538b364 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1491,7 +1491,7 @@ dependencies = [ [[package]] name = "svd2rust" -version = "0.35.0" +version = "0.36.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index c878da9a..86587a67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["svd", "embedded", "register", "map", "generator"] license = "MIT OR Apache-2.0" name = "svd2rust" repository = "https://github.com/rust-embedded/svd2rust/" -version = "0.35.0" +version = "0.36.0" readme = "README.md" rust-version = "1.74" From 33044dc5707ef2cd34cd759a371177f135cf9fa6 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Thu, 13 Mar 2025 09:15:15 +0300 Subject: [PATCH 72/77] irx-update --- CHANGELOG.md | 2 + Cargo.lock | 391 ++++++++++++++++++++++++++++++++------------------- Cargo.toml | 2 +- 3 files changed, 251 insertions(+), 144 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab5992eb..d408095e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Update `irx-config` + ## [v0.36.0] - 2025-03-09 - Generic `Periph` diff --git a/Cargo.lock b/Cargo.lock index f538b364..222c836b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "arrayref" @@ -152,9 +152,9 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" @@ -173,9 +173,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" dependencies = [ "clap_builder", "clap_derive", @@ -183,26 +183,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] name = "clap_derive" -version = "4.5.28" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] [[package]] @@ -266,9 +266,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "darling" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -276,58 +276,58 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 1.0.109", + "strsim", + "syn", ] [[package]] name = "darling_macro" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "derive_builder" -version = "0.12.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.12.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "derive_builder_macro" -version = "0.12.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 1.0.109", + "syn", ] [[package]] @@ -338,14 +338,14 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] [[package]] name = "either" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "encoding_rs" @@ -368,14 +368,14 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.6" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" +checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697" dependencies = [ "anstream", "anstyle", "env_filter", - "humantime", + "jiff", "log", ] @@ -552,9 +552,9 @@ dependencies = [ [[package]] name = "http" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -573,12 +573,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -586,15 +586,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" @@ -783,7 +777,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] [[package]] @@ -815,9 +809,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown", @@ -837,11 +831,12 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "irx-config" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0071d0561e65904b6ea900e6e09d84579766c20a2b6b4d628eaf3caf9ec9ee" +checksum = "6266a086f9c5635dffbfd7bd49262b2a40e0a580ab34e85d88dc59ed8133976a" dependencies = [ "blake2b_simd", + "cfg-if", "clap", "derive_builder", "serde", @@ -859,9 +854,33 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jiff" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "js-sys" @@ -881,9 +900,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.170" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "linux-raw-sys" @@ -891,6 +910,12 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" + [[package]] name = "litemap" version = "0.7.5" @@ -982,9 +1007,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" [[package]] name = "openssl" @@ -1009,7 +1034,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] [[package]] @@ -1066,34 +1091,49 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] [[package]] name = "prettyplease" -version = "0.2.29" +version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" dependencies = [ "proc-macro2", - "syn 2.0.98", + "syn", ] [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -1164,9 +1204,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" dependencies = [ "base64", "bytes", @@ -1209,9 +1249,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.11" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", @@ -1242,7 +1282,20 @@ dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.9.2", "windows-sys 0.59.0", ] @@ -1287,15 +1340,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schannel" @@ -1331,29 +1384,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -1447,12 +1500,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -1467,9 +1514,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "svd-parser" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee7838c1b248b3418519826888d6ed2be881092ccd815bf350bd713b1d9f687" +checksum = "a41fe17e46dee363a7d3b20e878bbf6d6b4e839ae010ff07ef0e05d41d201811" dependencies = [ "anyhow", "roxmltree", @@ -1479,9 +1526,9 @@ dependencies = [ [[package]] name = "svd-rs" -version = "0.14.11" +version = "0.14.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec61cc12f8001859a87cca405aa84bfb2e5a083cfbf2eea804e5c23b6ad5a76" +checksum = "c9b88ee2e82f09623ff76965587dc15a2e7150a3126854899c86e94dab777458" dependencies = [ "once_cell", "regex", @@ -1507,7 +1554,7 @@ dependencies = [ "serde_yaml", "svd-parser", "svd-rs", - "syn 2.0.98", + "syn", "thiserror", "url", ] @@ -1526,7 +1573,7 @@ dependencies = [ "serde_yaml", "shell-words", "svd2rust", - "syn 2.0.98", + "syn", "thiserror", "tracing", "tracing-subscriber", @@ -1536,20 +1583,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.98" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -1573,7 +1609,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] [[package]] @@ -1599,15 +1635,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.17.1" +version = "3.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" dependencies = [ "cfg-if", "fastrand", "getrandom 0.3.1", "once_cell", - "rustix", + "rustix 1.0.2", "windows-sys 0.59.0", ] @@ -1628,7 +1664,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] [[package]] @@ -1653,9 +1689,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.43.0" +version = "1.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" dependencies = [ "backtrace", "bytes", @@ -1701,9 +1737,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -1722,9 +1758,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -1779,7 +1815,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] [[package]] @@ -1829,9 +1865,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicode-ident" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unsafe-libyaml" @@ -1933,7 +1969,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.98", + "syn", "wasm-bindgen-shared", ] @@ -1968,7 +2004,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2001,7 +2037,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix", + "rustix 0.38.44", "windows-sys 0.48.0", ] @@ -2033,34 +2069,39 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + [[package]] name = "windows-registry" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ "windows-result", "windows-strings", - "windows-targets 0.52.6", + "windows-targets 0.53.0", ] [[package]] name = "windows-result" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" dependencies = [ - "windows-targets 0.52.6", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" dependencies = [ - "windows-result", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -2114,13 +2155,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -2133,6 +2190,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -2145,6 +2208,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -2157,12 +2226,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -2175,6 +2256,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -2187,6 +2274,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -2199,6 +2292,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -2211,11 +2310,17 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" -version = "0.5.40" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] @@ -2261,7 +2366,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", "synstructure", ] @@ -2282,7 +2387,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", "synstructure", ] @@ -2311,5 +2416,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn", ] diff --git a/Cargo.toml b/Cargo.toml index 86587a67..63a92cbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ yaml = ["dep:serde_yaml"] [dependencies] clap = { version = "4.0", optional = true } -irx-config = { version = "=3.3.0", features = [ +irx-config = { version = "3.5.0", features = [ "cmd", "toml-parser", "yaml", From be0d5c7c712398d55a0772e04ff866036f62b9ec Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 22 Mar 2025 10:22:42 +0300 Subject: [PATCH 73/77] rm ci/script.sh, move svd2rust-regress up --- Cargo.toml | 2 +- ci/before_deploy.sh | 17 - ci/script.sh | 630 ------------------ .../.gitignore | 0 .../Cargo.toml | 2 +- .../README.md | 0 .../all-tests.yml | 0 .../src/ci.rs | 0 .../src/command.rs | 0 .../src/diff.rs | 0 .../src/github.rs | 0 .../src/main.rs | 2 +- .../src/svd_test.rs | 0 .../src/tests.rs | 0 .../tests.yml | 0 15 files changed, 3 insertions(+), 650 deletions(-) delete mode 100644 ci/before_deploy.sh delete mode 100755 ci/script.sh rename {ci/svd2rust-regress => svd2rust-regress}/.gitignore (100%) rename {ci/svd2rust-regress => svd2rust-regress}/Cargo.toml (95%) rename {ci/svd2rust-regress => svd2rust-regress}/README.md (100%) rename {ci/svd2rust-regress => svd2rust-regress}/all-tests.yml (100%) rename {ci/svd2rust-regress => svd2rust-regress}/src/ci.rs (100%) rename {ci/svd2rust-regress => svd2rust-regress}/src/command.rs (100%) rename {ci/svd2rust-regress => svd2rust-regress}/src/diff.rs (100%) rename {ci/svd2rust-regress => svd2rust-regress}/src/github.rs (100%) rename {ci/svd2rust-regress => svd2rust-regress}/src/main.rs (99%) rename {ci/svd2rust-regress => svd2rust-regress}/src/svd_test.rs (100%) rename {ci/svd2rust-regress => svd2rust-regress}/src/tests.rs (100%) rename {ci/svd2rust-regress => svd2rust-regress}/tests.yml (100%) diff --git a/Cargo.toml b/Cargo.toml index 63a92cbf..c7662e87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,7 @@ version = "2.0" features = ["full", "extra-traits"] [workspace] -members = ["ci/svd2rust-regress"] +members = ["svd2rust-regress"] default-members = ["."] exclude = [ "output", diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh deleted file mode 100644 index 41d6879c..00000000 --- a/ci/before_deploy.sh +++ /dev/null @@ -1,17 +0,0 @@ -set -euxo pipefail - -main() { - cargo rustc --bin svd2rust --target $TARGET --release -- -C lto - - rm -rf stage - mkdir stage - cp target/$TARGET/release/svd2rust stage - - pushd stage - tar czf ../$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz * - popd - - rm -rf stage -} - -main diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100755 index 01c05a89..00000000 --- a/ci/script.sh +++ /dev/null @@ -1,630 +0,0 @@ -set -euxo pipefail - -test_svd() { - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/$VENDOR/${1}.svd -} - -test_patched_stm32() { - test_svd_for_target cortex-m https://stm32-rs.github.io/stm32-rs/${1}.svd.patched -} - -test_svd_for_target() { - curl -fL --output $td/input.svd $2 - - # NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt - pushd $td - RUST_BACKTRACE=1 svd2rust $options --target $1 --source-type xml -i input.svd - - mv lib.rs src/lib.rs - - popd - - cargo $COMMAND --manifest-path $td/Cargo.toml -} - -main() { - if [ -z ${VENDOR-} ]; then - return - fi - - td=$(mktemp -d) - - case $OPTIONS in - all) - options="--strict --atomics" - ;; - *) - options=$OPTIONS - ;; - esac - - # test crate - cargo init --lib --name foo --edition 2021 $td - echo 'cortex-m = "0.7.7"' >> $td/Cargo.toml - echo 'cortex-m-rt = "0.7.3"' >> $td/Cargo.toml - echo 'vcell = "0.1.3"' >> $td/Cargo.toml - if [[ "$options" == *"--atomics"* ]]; then - echo 'portable-atomic = { version = "1.4", default-features = false }' >> $td/Cargo.toml - fi - if [[ "$options" == *"--impl-defmt"* ]]; then - echo 'defmt = { version = "0.3.5", optional = true }' >> $td/Cargo.toml - fi - echo '[profile.dev]' >> $td/Cargo.toml - echo 'incremental = false' >> $td/Cargo.toml - - echo '[lints.rust]' >> $td/Cargo.toml - echo 'dead_code = "deny"' >> $td/Cargo.toml - echo 'improper_ctypes = "deny"' >> $td/Cargo.toml - echo 'missing_docs = "deny"' >> $td/Cargo.toml - echo 'no_mangle_generic_items = "deny"' >> $td/Cargo.toml - echo 'non_shorthand_field_patterns = "deny"' >> $td/Cargo.toml - echo 'overflowing_literals = "deny"' >> $td/Cargo.toml - echo 'path_statements = "deny"' >> $td/Cargo.toml - echo 'patterns_in_fns_without_body = "deny"' >> $td/Cargo.toml - echo 'unconditional_recursion = "deny"' >> $td/Cargo.toml - echo 'unused_allocation = "deny"' >> $td/Cargo.toml - echo 'unused_comparisons = "deny"' >> $td/Cargo.toml - echo 'unused_parens = "deny"' >> $td/Cargo.toml - echo 'while_true = "deny"' >> $td/Cargo.toml - if [[ "${RUST_TOOLCHAIN:-}" == *"nightly"* ]]; then - echo 'private_bounds = "deny"' >> $td/Cargo.toml - echo 'private_interfaces = "deny"' >> $td/Cargo.toml - fi - - case $VENDOR in - Atmel) - # BAD-SVD missing resetValue - # test_svd AT91SAM9CN11 - # test_svd AT91SAM9CN12 - # test_svd AT91SAM9G10 - # test_svd AT91SAM9G15 - # test_svd AT91SAM9G20 - # test_svd AT91SAM9G25 - # test_svd AT91SAM9G35 - # test_svd AT91SAM9M10 - # test_svd AT91SAM9M11 - # test_svd AT91SAM9N12 - # test_svd AT91SAM9X25 - # test_svd AT91SAM9X35 - # test_svd ATSAM3A4C - # test_svd ATSAM3A8C - # test_svd ATSAM3N00A - # test_svd ATSAM3N00B - # test_svd ATSAM3N0A - # test_svd ATSAM3N0B - # test_svd ATSAM3N0C - # test_svd ATSAM3N1A - # test_svd ATSAM3N1B - # test_svd ATSAM3N1C - # test_svd ATSAM3N2A - # test_svd ATSAM3N2B - # test_svd ATSAM3N2C - # test_svd ATSAM3N4A - # test_svd ATSAM3N4B - # test_svd ATSAM3N4C - # test_svd ATSAM3S1A - # test_svd ATSAM3S1B - # test_svd ATSAM3S1C - # test_svd ATSAM3S2A - # test_svd ATSAM3S2B - # test_svd ATSAM3S2C - # test_svd ATSAM3S4A - # test_svd ATSAM3S4B - # test_svd ATSAM3S4C - # test_svd ATSAM3S8B - # test_svd ATSAM3S8C - # test_svd ATSAM3SD8B - # test_svd ATSAM3SD8C - # test_svd ATSAM3U1C - # test_svd ATSAM3U1E - # test_svd ATSAM3U2C - # test_svd ATSAM3U2E - # test_svd ATSAM3U4C - # test_svd ATSAM3U4E - # test_svd ATSAM3X4C - # test_svd ATSAM3X4E - # test_svd ATSAM3X8C - # test_svd ATSAM3X8E - # test_svd ATSAM4S16B - # test_svd ATSAM4S16C - # test_svd ATSAM4S8B - # test_svd ATSAM4S8C - # test_svd ATSAM4SD32B - # test_svd ATSAM4SD32C - # test_svd ATSAMA5D31 - # test_svd ATSAMA5D33 - # test_svd ATSAMA5D34 - # test_svd ATSAMA5D35 - - # FIXME(#107) "failed to resolve. Use of undeclared type or module `sercom0`" - # test_svd ATSAMD21E15A - # test_svd ATSAMD21E16A - # test_svd ATSAMD21E17A - # test_svd ATSAMD21E18A - # test_svd ATSAMD21G16A - # test_svd ATSAMD21G17A - # test_svd ATSAMD21G18A - # test_svd ATSAMD21J16A - # test_svd ATSAMD21J17A - # test_svd ATSAMD21J18A - # test_svd ATSAMR21E16A - # test_svd ATSAMR21E17A - # test_svd ATSAMR21E18A - # test_svd ATSAMR21G16A - # test_svd ATSAMR21G17A - # test_svd ATSAMR21G18A - ;; - - Freescale) - # BAD-SVD bad enumeratedValue value - # test_svd MKV56F20 - # test_svd MKV56F22 - # test_svd MKV56F24 - # test_svd MKV58F20 - # test_svd MKV58F22 - # test_svd MKV58F24 - - # BAD-SVD field names are equivalent when case is ignored - # test_svd MK61F15 - # test_svd MK61F15WS - # test_svd MK70F12 - # test_svd MK70F15 - # test_svd MK70F15WS - - # OK - # NOTE it would take too long to test all these so we only a few of each family - test_svd MK02F12810 - # test_svd MK10D10 - # test_svd MK10D5 - test_svd MK10D7 - # test_svd MK10DZ10 - # test_svd MK10F12 - # test_svd MK11D5 - # test_svd MK11D5WS - # test_svd MK11DA5 - test_svd MK12D5 - # test_svd MK20D10 - # test_svd MK20D5 - # test_svd MK20D7 - # test_svd MK20DZ10 - # test_svd MK20F12 - test_svd MK21D5 - # test_svd MK21D5WS - # test_svd MK21DA5 - test_svd MK21F12 - # test_svd MK21FA12 - # test_svd MK22D5 - # test_svd MK22F12 - # test_svd MK22F12810 - # test_svd MK22F25612 - # test_svd MK22F51212 - # test_svd MK22FA12 - # test_svd MK24F12 - # test_svd MK24F25612 - # test_svd MK26F18 - # test_svd MK30D10 - test_svd MK30D7 - # test_svd MK30DZ10 - # test_svd MK40D10 - test_svd MK40D7 - # test_svd MK40DZ10 - # test_svd MK50D10 - # test_svd MK50D7 - # test_svd MK50DZ10 - # test_svd MK51D10 - # test_svd MK51D7 - # test_svd MK51DZ10 - # test_svd MK52D10 - test_svd MK52DZ10 - # test_svd MK53D10 - # test_svd MK53DZ10 - # test_svd MK60D10 - # test_svd MK60DZ10 - # test_svd MK60F15 - # test_svd MK63F12 - # test_svd MK64F12 - # test_svd MK65F18 - test_svd MK66F18 - # test_svd MK80F25615 - # test_svd MK81F25615 - test_svd MK82F25615 - # test_svd MKE14F16 - # test_svd MKE14Z7 - test_svd MKE15Z7 - # test_svd MKE16F16 - # test_svd MKE18F16 - test_svd MKL28T7_CORE0 - # test_svd MKL28T7_CORE1 - # test_svd MKL28Z7 - test_svd MKL81Z7 - # test_svd MKL82Z7 - # test_svd MKS22F12 - test_svd MKV10Z1287 - # test_svd MKV10Z7 - # test_svd MKV11Z7 - # test_svd MKV30F12810 - # test_svd MKV31F12810 - # test_svd MKV31F25612 - test_svd MKV31F51212 - # test_svd MKV40F15 - # test_svd MKV42F16 - # test_svd MKV43F15 - # test_svd MKV44F15 - # test_svd MKV44F16 - test_svd MKV45F15 - # test_svd MKV46F15 - # test_svd MKV46F16 - # test_svd MKW20Z4 - # test_svd MKW21D5 - # test_svd MKW21Z4 - test_svd MKW22D5 - # test_svd MKW24D5 - # test_svd MKW30Z4 - # test_svd MKW31Z4 - # test_svd MKW40Z4 - # test_svd MKW41Z4 - - # #92 regression tests - # NOTE it would take too long to test all these so we only a few of each family - test_svd MKE02Z4 - # test_svd MKE04Z1284 - # test_svd MKE04Z4 - test_svd MKE06Z4 - # test_svd MKE14D7 - # test_svd MKE15D7 - # test_svd MKL02Z4 - # test_svd MKL03Z4 - # test_svd MKL04Z4 - test_svd MKL05Z4 - # test_svd MKL13Z644 - # test_svd MKL14Z4 - # test_svd MKL15Z4 - # test_svd MKL16Z4 - # test_svd MKL17Z4 - test_svd MKL17Z644 - # test_svd MKL24Z4 - # test_svd MKL25Z4 - # test_svd MKL26Z4 - # test_svd MKL27Z4 - # test_svd MKL27Z644 - # test_svd MKL33Z4 - # test_svd MKL33Z644 - # test_svd MKL34Z4 - test_svd MKL36Z4 - # test_svd MKL43Z4 - # test_svd MKL46Z4 - test_svd MKM14ZA5 - # test_svd MKM33ZA5 - # test_svd MKM34Z7 - test_svd MKM34ZA5 - # test_svd MKW01Z4 - # test_svd SKEAZ1284 - test_svd SKEAZN642 - # test_svd SKEAZN84 - ;; - - Fujitsu) - # OK - test_svd MB9AF10xN - test_svd MB9AF10xR - test_svd MB9AF11xK - test_svd MB9AF11xL - test_svd MB9AF11xM - test_svd MB9AF11xN - test_svd MB9AF12xK - test_svd MB9AF12xL - test_svd MB9AF13xK - test_svd MB9AF13xL - test_svd MB9AF13xM - test_svd MB9AF13xN - test_svd MB9AF14xL - test_svd MB9AF14xM - test_svd MB9AF14xN - test_svd MB9AF15xM - test_svd MB9AF15xN - test_svd MB9AF15xR - test_svd MB9AF1AxL - test_svd MB9AF1AxM - test_svd MB9AF1AxN - test_svd MB9AF31xK - test_svd MB9AF31xL - test_svd MB9AF31xM - test_svd MB9AF31xN - test_svd MB9AF34xL - test_svd MB9AF34xM - test_svd MB9AF34xN - test_svd MB9AF42xK - test_svd MB9AF42xL - test_svd MB9AFA3xL - test_svd MB9AFA3xM - test_svd MB9AFA3xN - test_svd MB9AFA4xL - test_svd MB9AFA4xM - test_svd MB9AFA4xN - test_svd MB9AFAAxL - test_svd MB9AFAAxM - test_svd MB9AFAAxN - test_svd MB9AFB4xL - test_svd MB9AFB4xM - test_svd MB9AFB4xN - test_svd MB9B160L - test_svd MB9B160R - test_svd MB9B360L - test_svd MB9B360R - test_svd MB9B460L - test_svd MB9B460R - test_svd MB9B560L - test_svd MB9B560R - test_svd MB9BF10xN - test_svd MB9BF10xR - test_svd MB9BF11xN - test_svd MB9BF11xR - test_svd MB9BF11xS - test_svd MB9BF11xT - test_svd MB9BF12xJ - test_svd MB9BF12xK - test_svd MB9BF12xL - test_svd MB9BF12xM - test_svd MB9BF12xS - test_svd MB9BF12xT - test_svd MB9BF21xS - test_svd MB9BF21xT - test_svd MB9BF30xN - test_svd MB9BF30xR - test_svd MB9BF31xN - test_svd MB9BF31xR - test_svd MB9BF31xS - test_svd MB9BF31xT - test_svd MB9BF32xK - test_svd MB9BF32xL - test_svd MB9BF32xM - test_svd MB9BF32xS - test_svd MB9BF32xT - test_svd MB9BF40xN - test_svd MB9BF40xR - test_svd MB9BF41xN - test_svd MB9BF41xR - test_svd MB9BF41xS - test_svd MB9BF41xT - test_svd MB9BF42xS - test_svd MB9BF42xT - test_svd MB9BF50xN - test_svd MB9BF50xR - test_svd MB9BF51xN - test_svd MB9BF51xR - test_svd MB9BF51xS - test_svd MB9BF51xT - test_svd MB9BF52xK - test_svd MB9BF52xL - test_svd MB9BF52xM - test_svd MB9BF52xS - test_svd MB9BF52xT - test_svd MB9BF61xS - test_svd MB9BF61xT - test_svd MB9BFD1xS - test_svd MB9BFD1xT - test_svd S6E1A1 - #test_svd S6E2CC #broken CANFD.FDESCR access - ;; - - GD32) - #test_svd_for_target cortex-m https://q.geek.nz/files/gd32f130.svd.patched - ;; - - Holtek) - # OK - test_svd ht32f125x - test_svd ht32f175x - test_svd ht32f275x - ;; - - Microchip) - echo '[dependencies.bare-metal]' >> $td/Cargo.toml - echo 'version = "1.0.0"' >> $td/Cargo.toml - - echo '[dependencies.mips-mcu]' >> $td/Cargo.toml - echo 'version = "0.1.0"' >> $td/Cargo.toml - - test_svd_for_target mips https://raw.githubusercontent.com/kiffie/pic32-pac/master/pic32mx1xxfxxxb/PIC32MX170F256B.svd.patched - test_svd_for_target mips https://raw.githubusercontent.com/kiffie/pic32-pac/master/pic32mx2xxfxxxb/PIC32MX270F256B.svd.patched - ;; - - Nordic) - # BAD-SVD two enumeratedValues have the same value - # test_svd nrf52 - - # OK - test_svd nrf51 - ;; - - Nuvoton) - # OK - test_svd M051_Series - test_svd NUC100_Series - ;; - - NXP) - test_svd MK22F25612 - test_svd MKW41Z4 - - # BAD-SVD two enumeratedValues have the same name - # test_svd LPC11Exx_v5 - # test_svd LPC11Uxx_v7 - # test_svd LPC11xx_v6a - # test_svd LPC11xx_v6 - # test_svd LPC13Uxx_v1 - # test_svd LPC15xx_v0.7 - # test_svd LPC800_v0.3 - # test_svd LPC11E6x_v0.8 - # test_svd LPC176x5x_v0.2 - # test_svd LPC11Cxx_v9 - - # BAD-SVD missing resetValue - # test_svd LPC178x_7x - # test_svd LPC178x_7x_v0.8 - # test_svd LPC408x_7x_v0.7 - # test_svd LPC11Axxv0.6 - - - # BAD-SVD bad identifier: contains a '.' - # test_svd LPC11D14_svd_v4 - # test_svd LPC13xx_svd_v1 - - # BAD-SVD bad identifier: contains a '/' - # test_svd LPC18xx_svd_v18 - # test_svd LPC43xx_svd_v5 - - # BAD-SVD uses the identifier '_' to name a reserved bitfield value - # test_svd LPC1102_4_v4 - - # FIXME(???) "duplicate definitions for `write`" - # #99 regression test - # test_svd LPC5410x_v0.4 - ;; - - # MSP430 - MSP430) - echo '[dependencies.msp430]' >> $td/Cargo.toml - echo 'version = "0.4.0"' >> $td/Cargo.toml - - # Test MSP430 - test_svd_for_target msp430 https://raw.githubusercontent.com/pftbest/msp430g2553/v0.3.0-svd/msp430g2553.svd - test_svd_for_target msp430 https://raw.githubusercontent.com/YuhanLiin/msp430fr2355/master/msp430fr2355.svd - ;; - - # Community-provided RISC-V SVDs - RISC-V) - echo '[dependencies.bare-metal]' >> $td/Cargo.toml - echo 'version = "1.0.0"' >> $td/Cargo.toml - - echo '[dependencies.riscv]' >> $td/Cargo.toml - echo 'version = "0.12.1"' >> $td/Cargo.toml - - echo '[dependencies.riscv-rt]' >> $td/Cargo.toml - echo 'version = "0.13.0"' >> $td/Cargo.toml - - test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x/e310x.svd - test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/k210-pac/master/k210.svd - test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/fu540-pac/master/fu540.svd - ;; - - SiliconLabs) - # #99 regression tests - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3C1x4.svd - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3C1x6.svd - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3C1x7.svd - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3L1x4.svd - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3L1x6.svd - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3L1x7.svd - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3U1x4.svd - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3U1x6.svd - test_svd_for_target cortex-m https://raw.githubusercontent.com/cmsis-svd/cmsis-svd-data/main/data/SiliconLabs/SiM3_NRND/SIM3U1x7.svd - - # FIXME(???) panicked at "c.text.clone()" - # test_svd SIM3L1x8_SVD - ;; - - Spansion) - # OK - # See Fujitsu for other chips - test_svd MB9BF36xx - test_svd MB9BF46xx - test_svd MB9BF56xx - ;; - - STMicro) - # OK - test_svd STM32F030 - test_svd STM32F031x - test_svd STM32F042x - test_svd STM32F072x - test_svd STM32F091x - test_svd STM32F0xx - test_svd STM32F100xx - test_svd STM32F103xx - test_svd STM32F107xx - test_svd STM32F20x - test_svd STM32F21x - test_svd STM32F301 - test_svd STM32F303 - test_svd STM32F401 - test_svd STM32F407 - test_svd STM32F410 - test_svd STM32F413 - test_svd STM32F427 - test_svd STM32F429 - test_svd STM32F446 - test_svd STM32F469 - test_svd STM32L100 - test_svd STM32L15xC - test_svd STM32L15xxE - test_svd STM32L15xxxA - test_svd STM32L1xx - test_svd STM32L4x6 - test_svd STM32W108 - - # FIXME(#91) "field is never used: `register`" - # test_svd STM32L051x - # test_svd STM32L052x - # test_svd STM32L053x - # test_svd STM32L062x - # test_svd STM32L063x - ;; - - STM32-patched) - echo '[dependencies.critical-section]' >> $td/Cargo.toml - echo 'version = "1.0"' >> $td/Cargo.toml - echo 'optional = true' >> $td/Cargo.toml - - echo '[features]' >> $td/Cargo.toml - echo 'default = ["critical-section", "rt"]' >> $td/Cargo.toml - echo 'rt = ["cortex-m-rt/device"]' >> $td/Cargo.toml - echo 'atomics = []' >> $td/Cargo.toml - - # OK - test_patched_stm32 stm32f0x2 - test_patched_stm32 stm32f103 - test_patched_stm32 stm32f411 - test_patched_stm32 stm32f469 - test_patched_stm32 stm32f723 - test_patched_stm32 stm32g070 - test_patched_stm32 stm32g473 - test_patched_stm32 stm32h743 - test_patched_stm32 stm32l0x3 - test_patched_stm32 stm32l162 - test_patched_stm32 stm32l4x6 - test_patched_stm32 stm32l562 - test_patched_stm32 stm32mp157 - test_patched_stm32 stm32wb55 - test_patched_stm32 stm32wle5 - test_patched_stm32 stm32c011 - ;; - - Toshiba) - # BAD-SVD resetValue is bigger than the register size - # test_svd M365 - # test_svd M367 - # test_svd M368 - # test_svd M369 - # test_svd M36B - - # OK - test_svd M061 - ;; - - Espressif) - test_svd_for_target riscv https://raw.githubusercontent.com/espressif/svd/main/svd/esp32c3.svd - - test_svd_for_target xtensa-lx https://raw.githubusercontent.com/espressif/svd/main/svd/esp32.svd - test_svd_for_target xtensa-lx https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s2.svd - test_svd_for_target xtensa-lx https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s3.svd - ;; - - esac - - rm -rf $td -} - -if [ -z ${TRAVIS_TAG-} ]; then - main -fi diff --git a/ci/svd2rust-regress/.gitignore b/svd2rust-regress/.gitignore similarity index 100% rename from ci/svd2rust-regress/.gitignore rename to svd2rust-regress/.gitignore diff --git a/ci/svd2rust-regress/Cargo.toml b/svd2rust-regress/Cargo.toml similarity index 95% rename from ci/svd2rust-regress/Cargo.toml rename to svd2rust-regress/Cargo.toml index 62f4cff4..9b3fc80e 100644 --- a/ci/svd2rust-regress/Cargo.toml +++ b/svd2rust-regress/Cargo.toml @@ -7,7 +7,7 @@ rust-version = "1.82.0" [dependencies] clap = { version = "4.1", features = ["color", "derive", "string", "env"] } -svd2rust = { path = "../../" } +svd2rust = { path = "../" } reqwest = { version = "0.12", features = ["blocking", "native-tls-vendored"] } rayon = "1.4" anyhow = "1" diff --git a/ci/svd2rust-regress/README.md b/svd2rust-regress/README.md similarity index 100% rename from ci/svd2rust-regress/README.md rename to svd2rust-regress/README.md diff --git a/ci/svd2rust-regress/all-tests.yml b/svd2rust-regress/all-tests.yml similarity index 100% rename from ci/svd2rust-regress/all-tests.yml rename to svd2rust-regress/all-tests.yml diff --git a/ci/svd2rust-regress/src/ci.rs b/svd2rust-regress/src/ci.rs similarity index 100% rename from ci/svd2rust-regress/src/ci.rs rename to svd2rust-regress/src/ci.rs diff --git a/ci/svd2rust-regress/src/command.rs b/svd2rust-regress/src/command.rs similarity index 100% rename from ci/svd2rust-regress/src/command.rs rename to svd2rust-regress/src/command.rs diff --git a/ci/svd2rust-regress/src/diff.rs b/svd2rust-regress/src/diff.rs similarity index 100% rename from ci/svd2rust-regress/src/diff.rs rename to svd2rust-regress/src/diff.rs diff --git a/ci/svd2rust-regress/src/github.rs b/svd2rust-regress/src/github.rs similarity index 100% rename from ci/svd2rust-regress/src/github.rs rename to svd2rust-regress/src/github.rs diff --git a/ci/svd2rust-regress/src/main.rs b/svd2rust-regress/src/main.rs similarity index 99% rename from ci/svd2rust-regress/src/main.rs rename to svd2rust-regress/src/main.rs index 36dec528..f1a4ae6a 100644 --- a/ci/svd2rust-regress/src/main.rs +++ b/svd2rust-regress/src/main.rs @@ -412,7 +412,7 @@ impl Opts { } } -/// Hack to use ci/tests.yml as default value when running as `cargo run` +/// Hack to use svd2rust-regress/tests.yml as default value when running as `cargo run` fn default_test_cases() -> std::ffi::OsString { std::env::var_os("CARGO_MANIFEST_DIR").map_or_else( || std::ffi::OsString::from("tests.yml".to_owned()), diff --git a/ci/svd2rust-regress/src/svd_test.rs b/svd2rust-regress/src/svd_test.rs similarity index 100% rename from ci/svd2rust-regress/src/svd_test.rs rename to svd2rust-regress/src/svd_test.rs diff --git a/ci/svd2rust-regress/src/tests.rs b/svd2rust-regress/src/tests.rs similarity index 100% rename from ci/svd2rust-regress/src/tests.rs rename to svd2rust-regress/src/tests.rs diff --git a/ci/svd2rust-regress/tests.yml b/svd2rust-regress/tests.yml similarity index 100% rename from ci/svd2rust-regress/tests.yml rename to svd2rust-regress/tests.yml From 2ca591cfc0aded0492351eb85a6da4201085e8cc Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Thu, 3 Apr 2025 09:55:51 +0300 Subject: [PATCH 74/77] fix known issues in derive register arrays --- .github/workflows/ci.yml | 10 ++++-- CHANGELOG.md | 1 + src/generate/peripheral.rs | 58 ++++++++++++++++++++++------------- src/generate/register.rs | 24 ++++++++++----- svd2rust-regress/src/tests.rs | 2 ++ svd2rust-regress/tests.yml | 6 ++++ 6 files changed, 69 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0aa32833..92d9873a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,10 @@ jobs: - { vendor: Spansion, options: "-- --atomics" } - { vendor: STMicro } - { vendor: STMicro, options: "-- --atomics" } - - { vendor: STMicro, options: "-- --strict -f enum_value::p: --max-cluster-size --atomics --atomics-feature atomics --impl-debug --impl-defmt defmt" } + - { + vendor: STMicro, + options: "-- --strict -f enum_value::p: --max-cluster-size --atomics --atomics-feature atomics --impl-debug --impl-defmt defmt", + } - { vendor: Toshiba } - { vendor: Toshiba, options: "-- --strict --atomics" } - { vendor: TexasInstruments } @@ -92,6 +95,7 @@ jobs: - { vendor: Espressif, options: "-- --atomics" } - { vendor: Vorago } - { vendor: Vorago, options: "-- --strict --atomics" } + - { vendor: Renesas } - { vendor: RaspberryPi } - { vendor: RaspberryPi, options: "-- --atomics" } @@ -176,11 +180,11 @@ jobs: - name: Cache uses: Swatinem/rust-cache@v2 with: - key: svdtools-0.3.19 + key: svdtools-0.4.6 - name: Install svdtools run: | - cargo install svdtools --version 0.3.19 --target-dir target + cargo install svdtools --version 0.4.6 --target-dir target - name: Run CI script run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index d408095e..013438df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] - Update `irx-config` +- Fix register array derive regression ## [v0.36.0] - 2025-03-09 diff --git a/src/generate/peripheral.rs b/src/generate/peripheral.rs index f5de3902..618952eb 100644 --- a/src/generate/peripheral.rs +++ b/src/generate/peripheral.rs @@ -188,8 +188,15 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result "Pushing {} register or cluster blocks into output", ercs.len() ); - let reg_block = - register_or_cluster_block(&ercs, &derive_infos, None, "Register block", None, config)?; + let reg_block = register_or_cluster_block( + &ercs, + &BlockPath::new(&p.name), + &derive_infos, + None, + "Register block", + None, + config, + )?; out.extend(quote! { #[doc = #doc] @@ -469,6 +476,7 @@ fn make_comment(size: u32, offset: u32, description: &str) -> String { fn register_or_cluster_block( ercs: &[RegisterCluster], + path: &BlockPath, derive_infos: &[DeriveInfo], name: Option<&str>, doc: &str, @@ -478,7 +486,7 @@ fn register_or_cluster_block( let mut rbfs = TokenStream::new(); let mut accessors = TokenStream::new(); - let ercs_expanded = expand(ercs, derive_infos, config) + let ercs_expanded = expand(ercs, path, derive_infos, config) .with_context(|| "Could not expand register or cluster block")?; // Locate conflicting regions; we'll need to use unions to represent them. @@ -612,6 +620,7 @@ fn register_or_cluster_block( /// `RegisterBlockField`s containing `Field`s. fn expand( ercs: &[RegisterCluster], + path: &BlockPath, derive_infos: &[DeriveInfo], config: &Config, ) -> Result> { @@ -623,14 +632,14 @@ fn expand( match &erc { RegisterCluster::Register(register) => { let reg_name = ®ister.name; - let expanded_reg = expand_register(register, derive_info, config) + let expanded_reg = expand_register(register, path, derive_info, config) .with_context(|| format!("can't expand register '{reg_name}'"))?; trace!("Register: {reg_name}"); ercs_expanded.extend(expanded_reg); } RegisterCluster::Cluster(cluster) => { let cluster_name = &cluster.name; - let expanded_cluster = expand_cluster(cluster, config) + let expanded_cluster = expand_cluster(cluster, path, config) .with_context(|| format!("can't expand cluster '{cluster_name}'"))?; trace!("Cluster: {cluster_name}"); ercs_expanded.extend(expanded_cluster); @@ -873,9 +882,9 @@ fn is_derivable( /// Calculate the size of a Cluster. If it is an array, then the dimensions /// tell us the size of the array. Otherwise, inspect the contents using /// [cluster_info_size_in_bits]. -fn cluster_size_in_bits(cluster: &Cluster, config: &Config) -> Result { +fn cluster_size_in_bits(cluster: &Cluster, path: &BlockPath, config: &Config) -> Result { match cluster { - Cluster::Single(info) => cluster_info_size_in_bits(info, config), + Cluster::Single(info) => cluster_info_size_in_bits(info, path, config), // If the contained array cluster has a mismatch between the // dimIncrement and the size of the array items, then the array // will get expanded in expand_cluster below. The overall size @@ -885,7 +894,7 @@ fn cluster_size_in_bits(cluster: &Cluster, config: &Config) -> Result { return Ok(0); // Special case! } let last_offset = (dim.dim - 1) * dim.dim_increment * BITS_PER_BYTE; - let last_size = cluster_info_size_in_bits(info, config); + let last_size = cluster_info_size_in_bits(info, path, config); Ok(last_offset + last_size?) } } @@ -893,13 +902,13 @@ fn cluster_size_in_bits(cluster: &Cluster, config: &Config) -> Result { /// Recursively calculate the size of a ClusterInfo. A cluster's size is the /// maximum end position of its recursive children. -fn cluster_info_size_in_bits(info: &ClusterInfo, config: &Config) -> Result { +fn cluster_info_size_in_bits(info: &ClusterInfo, path: &BlockPath, config: &Config) -> Result { let mut size = 0; for c in &info.children { let end = match c { RegisterCluster::Register(reg) => { - let reg_size: u32 = expand_register(reg, &DeriveInfo::Root, config)? + let reg_size: u32 = expand_register(reg, path, &DeriveInfo::Root, config)? .iter() .map(|rbf| rbf.size) .sum(); @@ -907,7 +916,7 @@ fn cluster_info_size_in_bits(info: &ClusterInfo, config: &Config) -> Result (reg.address_offset * BITS_PER_BYTE) + reg_size } RegisterCluster::Cluster(clust) => { - (clust.address_offset * BITS_PER_BYTE) + cluster_size_in_bits(clust, config)? + (clust.address_offset * BITS_PER_BYTE) + cluster_size_in_bits(clust, path, config)? } }; @@ -917,10 +926,14 @@ fn cluster_info_size_in_bits(info: &ClusterInfo, config: &Config) -> Result } /// Render a given cluster (and any children) into `RegisterBlockField`s -fn expand_cluster(cluster: &Cluster, config: &Config) -> Result> { +fn expand_cluster( + cluster: &Cluster, + path: &BlockPath, + config: &Config, +) -> Result> { let mut cluster_expanded = vec![]; - let cluster_size = cluster_info_size_in_bits(cluster, config) + let cluster_size = cluster_info_size_in_bits(cluster, path, config) .with_context(|| format!("Can't calculate cluster {} size", cluster.name))?; let description = cluster .description @@ -1087,6 +1100,7 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result Result> { @@ -1104,7 +1118,7 @@ fn expand_register( } else { info_name.remove_dim() }; - let ty_str = ty_name.clone(); + let mut ty_str = ty_name.clone(); match register { Register::Single(info) => { @@ -1135,7 +1149,7 @@ fn expand_register( || (register_size <= array_info.dim_increment * BITS_PER_BYTE); let convert_list = match config.keep_list { - true => info.name.contains("[%s]"), + true => info_name.contains("[%s]"), false => true, }; @@ -1154,13 +1168,12 @@ fn expand_register( "".into() }; let ac = match derive_info { - DeriveInfo::Implicit(_) => { - ty_name = info_name.expand_dim(&index); - convert_list && sequential_indexes_from0 - } - DeriveInfo::Explicit(_) => { + DeriveInfo::Implicit(di) | DeriveInfo::Explicit(di) + if path == &di.block && !info_name.contains("[%s]") => + { ty_name = info_name.expand_dim(&index); - convert_list && sequential_indexes_from0 + ty_str = ty_name.clone(); + false } _ => convert_list, }; @@ -1207,7 +1220,7 @@ fn expand_register( let idx_name = ident( &util::fullname(&ri.name, &info.alternate_group, config.ignore_groups), config, - "cluster_accessor", + "register_accessor", span, ); let doc = make_comment( @@ -1374,6 +1387,7 @@ fn cluster_block( }; let reg_block = register_or_cluster_block( &c.children, + &path.new_cluster(&c.name), &mod_derive_infos, Some(&mod_name), &doc, diff --git a/src/generate/register.rs b/src/generate/register.rs index c1cdc876..7622ba71 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -50,14 +50,16 @@ pub fn render( ) -> Result { let mut name = util::name_of(register, config.ignore_groups); // Rename if this is a derived array - if dpath.is_some() { + if let Some(dpath) = dpath.as_ref() { if let MaybeArray::Array(info, array_info) = register { if let Some(dim_index) = &array_info.dim_index { - let index: Cow = dim_index.first().unwrap().into(); - name = info - .fullname(config.ignore_groups) - .expand_dim(&index) - .into() + if path == &dpath.block { + let index: Cow = dim_index.first().unwrap().into(); + name = info + .fullname(config.ignore_groups) + .expand_dim(&index) + .into() + } } } } @@ -1452,7 +1454,15 @@ impl Variant { span, ); let sc = case.sanitize(&ev.name); - const INTERNALS: [&str; 6] = ["bit", "bits", "clear_bit", "set", "set_bit", "variant"]; + const INTERNALS: [&str; 7] = [ + "bit", + "bits", + "clear_bit", + "set", + "set_bit", + "variant", + "offset", + ]; let sc = Ident::new( &(if INTERNALS.contains(&sc.as_ref()) { sc + "_" diff --git a/svd2rust-regress/src/tests.rs b/svd2rust-regress/src/tests.rs index c7ebc083..f6c2f73d 100644 --- a/svd2rust-regress/src/tests.rs +++ b/svd2rust-regress/src/tests.rs @@ -25,6 +25,7 @@ pub enum Manufacturer { Vorago, Espressif, RaspberryPi, + Renesas, Unknown, } @@ -47,6 +48,7 @@ impl Manufacturer { Toshiba, SiFive, RaspberryPi, + Renesas, TexasInstruments, Espressif, ] diff --git a/svd2rust-regress/tests.yml b/svd2rust-regress/tests.yml index 73a87549..bf17e088 100644 --- a/svd2rust-regress/tests.yml +++ b/svd2rust-regress/tests.yml @@ -696,6 +696,12 @@ chip: va108xx svd_url: https://raw.githubusercontent.com/us-irs/va108xx-rs/refs/heads/main/va108xx/svd/va108xx.svd.patched +# Renesas +- arch: cortex-m + mfgr: Renesas + chip: r7fa4m1ab + svd_url: https://raw.githubusercontent.com/ra-rs/ra/refs/heads/main/svd/vendor/R7FA4M1AB.svd + # Raspberry Pi - arch: cortex-m mfgr: RaspberryPi From a85dedaca8054a70007d32289946a48ebafef76c Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Fri, 4 Apr 2025 06:27:14 +0300 Subject: [PATCH 75/77] release 0.36.1 --- CHANGELOG.md | 5 +- Cargo.lock | 144 +++++++++++++++++++++++++++------------------------ Cargo.toml | 6 +-- 3 files changed, 82 insertions(+), 73 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 013438df..8362d053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [v0.36.1] - 2025-04-04 + - Update `irx-config` - Fix register array derive regression @@ -951,7 +953,8 @@ peripheral.register.write(|w| w.field().set()); - Initial version of the `svd2rust` tool -[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.36.0...HEAD +[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.36.1...HEAD +[v0.36.1]: https://github.com/rust-embedded/svd2rust/compare/v0.36.0...v0.36.1 [v0.36.0]: https://github.com/rust-embedded/svd2rust/compare/v0.35.0...v0.36.0 [v0.35.0]: https://github.com/rust-embedded/svd2rust/compare/v0.34.0...v0.35.0 [v0.34.0]: https://github.com/rust-embedded/svd2rust/compare/v0.33.5...v0.34.0 diff --git a/Cargo.lock b/Cargo.lock index 222c836b..f87d1e9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -158,9 +158,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] @@ -173,9 +173,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" dependencies = [ "clap_builder", "clap_derive", @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" dependencies = [ "anstream", "anstyle", @@ -266,9 +266,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -276,9 +276,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", @@ -368,9 +368,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", @@ -494,14 +494,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -645,9 +645,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" dependencies = [ "bytes", "futures-channel", @@ -655,6 +655,7 @@ dependencies = [ "http", "http-body", "hyper", + "libc", "pin-project-lite", "socket2", "tokio", @@ -703,9 +704,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" [[package]] name = "icu_normalizer" @@ -727,9 +728,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" [[package]] name = "icu_properties" @@ -748,9 +749,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" [[package]] name = "icu_provider" @@ -860,9 +861,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e" +checksum = "c102670231191d07d37a35af3eb77f1f0dbf7a71be51a962dcd57ea607be7260" dependencies = [ "jiff-static", "log", @@ -873,9 +874,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9" +checksum = "4cdde31a9d349f1b1f51a0b3714a5940ac022976f4b49485fc04be052b183b4c" dependencies = [ "proc-macro2", "quote", @@ -912,9 +913,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "litemap" @@ -924,9 +925,9 @@ checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "matchers" @@ -951,9 +952,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" dependencies = [ "adler2", ] @@ -1007,9 +1008,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl" @@ -1112,9 +1113,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.30" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", "syn", @@ -1138,6 +1139,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "rayon" version = "1.10.0" @@ -1204,9 +1211,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" dependencies = [ "base64", "bytes", @@ -1288,22 +1295,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys 0.9.2", + "linux-raw-sys 0.9.3", "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.23" +version = "0.23.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" dependencies = [ "once_cell", "rustls-pki-types", @@ -1329,9 +1336,9 @@ checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.103.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" dependencies = [ "ring", "rustls-pki-types", @@ -1486,9 +1493,9 @@ checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1538,7 +1545,7 @@ dependencies = [ [[package]] name = "svd2rust" -version = "0.36.0" +version = "0.36.1" dependencies = [ "anyhow", "clap", @@ -1635,15 +1642,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.18.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ - "cfg-if", "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.2", "once_cell", - "rustix 1.0.2", + "rustix 1.0.5", "windows-sys 0.59.0", ] @@ -1689,9 +1695,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.0" +version = "1.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" dependencies = [ "backtrace", "bytes", @@ -1724,9 +1730,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", @@ -1940,9 +1946,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -2071,9 +2077,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-link" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-registry" @@ -2088,9 +2094,9 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" dependencies = [ "windows-link", ] @@ -2327,9 +2333,9 @@ dependencies = [ [[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags", ] diff --git a/Cargo.toml b/Cargo.toml index c7662e87..88daf5ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["svd", "embedded", "register", "map", "generator"] license = "MIT OR Apache-2.0" name = "svd2rust" repository = "https://github.com/rust-embedded/svd2rust/" -version = "0.36.0" +version = "0.36.1" readme = "README.md" rust-version = "1.74" @@ -58,11 +58,11 @@ url = { version = "2.5", features = ["serde"] } [dependencies.svd-parser] features = ["expand"] -version = "0.14.8" +version = "0.14.9" [dependencies.svd-rs] features = ["serde"] -version = "0.14.11" +version = "0.14.12" [dependencies.syn] version = "2.0" From 5a4d946e179dde91fd8a49fae94ddf06945a5bea Mon Sep 17 00:00:00 2001 From: Mike Bernard Date: Wed, 2 Apr 2025 20:00:54 -0700 Subject: [PATCH 76/77] add 'gen' keyword (close #927) --- CHANGELOG.md | 1 + src/util.rs | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 013438df..137c4048 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Update `irx-config` - Fix register array derive regression +- Sanitize `gen` keyword (new in Rust 2024 edition) ## [v0.36.0] - 2025-03-09 diff --git a/src/util.rs b/src/util.rs index 40a1e526..92e420c6 100644 --- a/src/util.rs +++ b/src/util.rs @@ -132,13 +132,13 @@ pub fn ident_str(name: &str, fmt: &IdentFormat) -> String { } pub fn sanitize_keyword(sc: Cow) -> Cow { - const KEYWORDS: [&str; 55] = [ + const KEYWORDS: [&str; 56] = [ "abstract", "alignof", "as", "async", "await", "become", "box", "break", "const", "continue", "crate", "do", "dyn", "else", "enum", "extern", "false", "final", "fn", "for", - "if", "impl", "in", "let", "loop", "macro", "match", "mod", "move", "mut", "offsetof", - "override", "priv", "proc", "pub", "pure", "ref", "return", "self", "sizeof", "static", - "struct", "super", "trait", "true", "try", "type", "typeof", "unsafe", "unsized", "use", - "virtual", "where", "while", "yield", + "gen", "if", "impl", "in", "let", "loop", "macro", "match", "mod", "move", "mut", + "offsetof", "override", "priv", "proc", "pub", "pure", "ref", "return", "self", "sizeof", + "static", "struct", "super", "trait", "true", "try", "type", "typeof", "unsafe", "unsized", + "use", "virtual", "where", "while", "yield", ]; if KEYWORDS.contains(&sc.as_ref()) { sc + "_" From 7a01f7c00f684063eb29ea672144f6546fd7ed0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20C=C3=A1rdenas=20Rodr=C3=ADguez?= Date: Sat, 24 May 2025 15:43:25 +0200 Subject: [PATCH 77/77] riscv-peripheral v0.3.0 rework --- CHANGELOG.md | 3 + src/config/riscv.rs | 5 +- src/generate/device.rs | 51 ++++++++-------- src/generate/riscv.rs | 133 ++++++++++++++++++++++++----------------- 4 files changed, 108 insertions(+), 84 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8985ad60..85cbde20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Adapt RISC-V specific codegen for `riscv-peripheral` v0.3.0 rework +- Include `riscv-peripheral` peripherals in `Peripherals` struct + ## [v0.36.1] - 2025-04-04 - Update `irx-config` diff --git a/src/config/riscv.rs b/src/config/riscv.rs index 90100762..477c5848 100644 --- a/src/config/riscv.rs +++ b/src/config/riscv.rs @@ -52,15 +52,16 @@ impl RiscvEnumItem { #[derive(Clone, PartialEq, Eq, Debug, Default)] #[non_exhaustive] pub struct RiscvClintConfig { + pub pub_new: bool, pub name: String, - pub freq: Option, - pub async_delay: bool, + pub mtime_freq: usize, } #[cfg_attr(feature = "serde", derive(serde::Deserialize), serde(default))] #[derive(Clone, PartialEq, Eq, Debug, Default)] #[non_exhaustive] pub struct RiscvPlicConfig { + pub pub_new: bool, pub name: String, pub core_interrupt: Option, pub hart_id: Option, diff --git a/src/generate/device.rs b/src/generate/device.rs index 96e1d332..bef17ed6 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -219,34 +219,31 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result vec![], - false => c - .harts - .iter() - .map(|h| (TokenStream::from_str(&h.name).unwrap(), h.value)) - .collect::>(), + let harts = c + .harts + .iter() + .map(|h| (TokenStream::from_str(&h.name).unwrap(), h.value)) + .collect::>(); + let harts = match harts.len() { + 0 => quote! {}, + _ => { + let harts = harts + .iter() + .map(|(name, value)| { + let value = TokenStream::from_str(&format!("{value}")).unwrap(); + quote! {crate::interrupt::Hart::#name => #value} + }) + .collect::>(); + quote! { + harts [#(#harts),*] + } + } }; if let Some(clint) = &c.clint { let p = peripherals.iter().find(|&p| p.name == clint.name).unwrap(); - let base = TokenStream::from_str(&format!("base 0x{:X},", p.base_address)).unwrap(); - let freq = match clint.freq { - Some(clk) => match clint.async_delay { - true => TokenStream::from_str(&format!("freq {clk}, async_delay,")).unwrap(), - false => TokenStream::from_str(&format!("freq {clk},")).unwrap(), - }, - None => quote! {}, - }; - let mtimecmps = harts - .iter() - .map(|(name, value)| { - let mtimecmp_name = TokenStream::from_str(&format!("mtimecmp{value}")).unwrap(); - let doc = format!("[{value}](crate::interrupt::Hart::{name})"); - quote! {#mtimecmp_name = (crate::interrupt::Hart::#name, #doc)} - }) - .collect::>(); - let mtimecmps = match mtimecmps.len() { - 0 => quote! {}, - _ => quote! {mtimecmps [ #(#mtimecmps),* ],}, - }; - let msips = harts - .iter() - .map(|(name, value)| { - let msip_name = TokenStream::from_str(&format!("msip{value}")).unwrap(); - let doc = format!("[{value}](crate::interrupt::Hart::{name})"); - quote! {#msip_name = (crate::interrupt::Hart::#name, #doc)} - }) - .collect::>(); - let msips = match msips.len() { - 0 => quote! {}, - _ => quote! {msips [ #(#msips),* ],}, + + let span = Span::call_site(); + let vis = match clint.pub_new { + true => quote! {pub}, + false => quote! {}, }; + let name = util::ident(&p.name, config, "peripheral", span); + let base = TokenStream::from_str(&format!("base 0x{:X},", p.base_address)).unwrap(); + let freq = TokenStream::from_str(&format!("mtime_freq {},", clint.mtime_freq)).unwrap(); riscv_peripherals.extend(quote! { - riscv_peripheral::clint_codegen!(#base #freq #mtimecmps #msips); + riscv_peripheral::clint_codegen!(#vis #name, #base #freq #harts); + impl #name { + /// Steal an instance of this peripheral + /// + /// # Safety + /// + /// Ensure that the new instance of the peripheral cannot be used in a way + /// that may race with any existing instances, for example by only + /// accessing read-only or write-only registers, or by consuming the + /// original peripheral and using critical sections to coordinate + /// access between multiple new instances. + /// + /// Additionally, other software such as HALs may rely on only one + /// peripheral instance existing to ensure memory safety; ensure + /// no stolen instances are passed to such software. + #[inline] + pub unsafe fn steal() -> Self { + Self::new() + } + } }); } if let Some(plic) = &c.plic { let p = peripherals.iter().find(|&p| p.name == plic.name).unwrap(); - let base = TokenStream::from_str(&format!("base 0x{:X},", p.base_address)).unwrap(); - let ctxs = harts - .iter() - .map(|(name, value)| { - let ctx_name = TokenStream::from_str(&format!("ctx{value}")).unwrap(); - let doc = format!("[{value}](crate::interrupt::Hart::{name})"); - quote! {#ctx_name = (crate::interrupt::Hart::#name, #doc)} - }) - .collect::>(); - let ctxs = match ctxs.len() { - 0 => quote! {}, - _ => quote! {ctxs [ #(#ctxs),* ],}, + + let span = Span::call_site(); + let vis = match plic.pub_new { + true => quote! {pub}, + false => quote! {}, }; + let name = util::ident(&p.name, config, "peripheral", span); + let base = TokenStream::from_str(&format!("base 0x{:X},", p.base_address)).unwrap(); riscv_peripherals.extend(quote! { - riscv_peripheral::plic_codegen!(#base #ctxs); + riscv_peripheral::plic_codegen!(#vis #name, #base #harts); + impl #name { + /// Steal an instance of this peripheral + /// + /// # Safety + /// + /// Ensure that the new instance of the peripheral cannot be used in a way + /// that may race with any existing instances, for example by only + /// accessing read-only or write-only registers, or by consuming the + /// original peripheral and using critical sections to coordinate + /// access between multiple new instances. + /// + /// Additionally, other software such as HALs may rely on only one + /// peripheral instance existing to ensure memory safety; ensure + /// no stolen instances are passed to such software. + #[inline] + pub unsafe fn steal() -> Self { + Self::new() + } + } }); if let Some(core_interrupt) = &plic.core_interrupt { @@ -294,8 +316,9 @@ pub fn render( mod_items.extend(quote! { #[cfg(feature = "rt")] #[riscv_rt::core_interrupt(CoreInterrupt::#core_interrupt)] - fn plic_handler() { - let claim = crate::PLIC::#ctx.claim(); + unsafe fn plic_handler() { + let plic = unsafe { crate::#name::steal() }; + let claim = plic.#ctx.claim(); if let Some(s) = claim.claim::() { unsafe { _dispatch_external_interrupt(s.number()) } claim.complete(s);