Skip to content

SPARK mode consideration #96

Open
Open
@kevlar700

Description

@kevlar700

After discovering that Spark supports overlays. I was just investigating whether it would be possible for svd2ada generated files to pass SPARK mode compliance checks.

With arrays off. Most discriminant records dissappear. For STM32 a couple remain such as for timers and USB_OTG.

Most of these are easily solved by removing the by value option for arrays if a --no-discriminant flag is passed. It would seem that --no-arrays would create a lot of client code duplication. I have seen @simonjwright use --no-arrays. I am not sure how he avoids e.g. 30 item case statements for EXTI/Interrupts etc.. Unless he overlays a 32 bit value or boolean array with an address or unchecked_conversion in the client code?

However, I am unsure of how to solve e.g. the Timer discriminant issue for svd functionality. Whereby depending upon the mode that the timer is in (Input/Output) then the bits of the CCMR1 register differ. The C code just has multiple defines with little/no protection. Is that the only way to make it SPARK compatible or does any one have any ideas?

I wonder if @Fabien-Chouteau unchecked_conversion work could play into solving this?

#40

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions