Skip to content

regz: infer the base of inlined ATDF register groups - #1091

Open
matpala wants to merge 1 commit into
ZigEmbeddedGroup:mainfrom
matpala:regz/atdf-inlined-offsets
Open

matpala wants to merge 1 commit into
ZigEmbeddedGroup:mainfrom
matpala:regz/atdf-inlined-offsets

Conversation

@matpala

@matpala matpala commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Fix #1072

Cuando un modulo tiene un solo grupo de registros con su mismo nombre, regz lo inlinea, y la instancia quedaba en offset 0 con los registros en direcciones absolutas.
Por eso perifericos como el SPI del ATmega328P salian en la direccion 0. Ahora, si todas las instancias del modulo estan en offset 0, el registro mas bajo pasa a ser la base (SPI en 0x4C, SPCR en 0). Si alguna instancia esta en otra direccion, los offsets quedan como estaban (SYSCFG del ATtiny1616).
Los HAL de SPI e interrupciones del ATmega328P ahora usan chip.peripherals.SPI y chip.peripherals.CPU en vez del workaround con @offsetof.

Lo probe con los tests de regz, los de los ports, los ejemplos de atmega y attiny dan .hex identicos. La salida de regz para ATSAMD51J19A y ATtiny1616 no cambia.

@matpala
matpala force-pushed the regz/atdf-inlined-offsets branch from c1f2f2c to 730a9a0 Compare October 15, 2026 16:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regz: AVR peripherals generated at address 0 when the register-group name matches the module (ATDF)

1 participant