OpenAADL / ocarina

AADL model processor: mappings to code (C, Ada); Petri Nets; scheduling tools (MAST, Cheddar); WCET; REAL
http://www.openaadl.org
Other
64 stars 29 forks source link

type declaration error when using Arinc 653 Blackboard with POK #16

Closed etienne-zante closed 9 years ago

etienne-zante commented 10 years ago

When using intra partition communication with Pok, ocarina-backends-pok_c-deployment.adb check wether ARINC 653 is used or not but in both case the final type used is uint8_t. In fact in case of using ARINC653, BLACK_BOARD_ID_TYPE is a 32 bits integer and not a 8 bits. This will not result in a compilation error but probably in an execution error (misaligned address for example).

To correct this problem, I suggest to change lines 2306 to 2309 of ocarina-backends-pok_c-deployment.adb :

CTU.Make_Variable_Declaration
                         (Defining_Identifier =>
                            CTU.Make_Defining_Identifier (Map_Port_Var (F)),
                          Used_Type => RE (RE_Uint8_T));

by :

CTU.Make_Variable_Declaration
                         (Defining_Identifier =>
                            CTU.Make_Defining_Identifier (Map_Port_Var (F)),
                          Used_Type => Type_Used);

I also suggest to change "RH_Types" line 644 of ocarina-backends-pok_c-runtime.ads by "RH_Blackboard" in order to add the correct header

yoogx commented 9 years ago

Two questions: do you have a reproducer for these issues that exhibits wrong behavior? I sent your questions to pok-devel to know whether this is OK

juli1 commented 9 years ago

Is this patch/change tested and validated? I am wondering if the code compiles with such changes.

yoogx commented 9 years ago

Patch has been approved through discussion on pok-devel. Closing the ticket