You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
519: Be more careful computing the size of an array Cluster. r=burrbull a=rcls
`cluster_size_in_bits` was ignoring array information, leading to incorrect padding with nested clusters.
I noticed this as incorrect padding on the three SARs in PASS0 on the Cypress cyt4bb. (The .svd for this requires registration on the Cypress website.)
It also shows up as incorrect padding on the TCPWM0 in the Cypress PSOC6_04 (svd at https://github.com/cypresssemiconductorco/psoc6pdl/blob/master/devices/svd/psoc6_04.svd)
E.g., for the PSOC TCPWM0, the diffs on the generated code from this change are:
```
diff --git a/src/tcpwm0.rs b/src/tcpwm0.rs
index 678d146..7165c46 100644
--- a/src/tcpwm0.rs
+++ b/src/tcpwm0.rs
@@ -3,7 +3,7 @@
pub struct RegisterBlock {
#[doc = "0x00 - Group of counters"]
pub grp0: GRP,
- _reserved1: [u8; 32640usize],
+ _reserved1: [u8; 31744usize],
#[doc = "0x8000 - Group of counters"]
pub grp1: GRP,
}
```
Eyeballing the GRP, it has 8 * 128byte entries = 1024 bytes, and the correct padding is then 32768 - 1024 = 31744 bytes.
Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
Co-authored-by: Ralph Loader <ralph1loader@gmail.com>
0 commit comments