olofk / ipyxact

Python-based IP-XACT parser
MIT License
124 stars 48 forks source link

Update examples to account for addressUnitBits property #40

Closed amykyta3 closed 10 months ago

amykyta3 commented 1 year ago

Hi Olof!

This PR adjusts your example C and Markdown generators to account for this (very often overlooked) feature of IP-XACT: addressUnitBits.

The IP-XACT addressUnitBits property defines the scale factor used for address increments. In most cases, this property is not used and defaults to 8. However often some of the "big-name" vendors will provide IP definitions that use a less common AUB value of 16 or 32 in order to communicate that the addressing is word-based rather than byte-based. This means that for every +1 increment in IP-XACT baseAddress or addressOffset, the true byte address increment is +2 or +4 respectively. Some colleagues of mine were using your C header generator example and were confused why the resulting address offsets were off by a factor of 2.

Description from the IP-XACT spec: image

This diagram is another way to visualize the concept which is somewhat helpful: image

olofk commented 10 months ago

Thanks for the fix and the excellent explanation. Picked and pushed!