Volatile records containing an array

svd2ada generates volatile arrays.

e.g. IMR_MR_Field_Array

There are two other options that I believe will work easily with spark. The .Val Hal.UInt32 or a record of booleans with different names instead of the array.

The array makes for simpler code. So before I switch to the value. Could anyone suggest how the Spark compatibility error may be avoided. Editing the svds isn’t ideal but possible. A function or procedure local instantiation would be ideal. Any ideas?

IMR1.MR.Arr(Var) := True;

error: volatile object cannot appear in this context. Spark RM 7.1.3 (10).


Well. I feel stupid for not treating an array like any other value.

EXTI_Dev : STM32_SVD.EXTI.EXTI_Peripheral renames STM32_SVD.EXTI.EXTI_Periph;
IMR1_Arr : STM32_SVD.EXTI.IMR1_MR_Field_Array := EXTI_Dev.IMR1.Arr;
IMR1_Arr (Index/Var in first message) := True;
EXTI_Dev.IMR1.Arr := IMR1_Arr;
1 Like