-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Co-authored-by: Ralph Loader <[email protected]>
- Loading branch information
Showing
2 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters