pok-kernel / pok

POK kernel. Safe and secure for safety-critical systems.
https://pok-kernel.github.io/
BSD 2-Clause "Simplified" License
94 stars 61 forks source link

AADL models are not syntaxically correct, please fix them ! #4

Open AtirChaudary opened 7 years ago

AtirChaudary commented 7 years ago

this happens when I run Makefile there is a syntax error in your code can you help me on this ? this happens for arnic653-events and arnic653-queueing and i am running others also so maybe its in them also

juli1 commented 7 years ago

Having a trace/comment might help :)

AtirChaudary commented 7 years ago

atir@ubuntu:~/Desktop/pok/examples/arinc653-events$ ls Makefile model.aadl model.aadl~ receive.c atir@ubuntu:~/Desktop/pok/examples/arinc653-events$ make /home/atir/Desktop/POK/pok-master/misc/pok-toolchain.pl --arinc653 --models=model.aadl --no-run AADL models are not syntaxically correct, please fix them ! make: *** [build] Error 1 atir@ubuntu:~/Desktop/pok/examples/arinc653-events$

juli1 commented 7 years ago

looks like a problem with @yoogx and ocarina!

AtirChaudary commented 7 years ago

how can buffer and blackboard can run then ?

they both are running but events queueing are not :( i have reinstalled the ocarina but still this issue is there

AtirChaudary commented 7 years ago

there is not much help on the internet.You are the last person who can solve this :)

juli1 commented 7 years ago

I appreciate the compliment. Please note that POK and Ocarina are open source and contributions are more than appreciated.

AtirChaudary commented 7 years ago

i have corrected them thanks for your time

On Thu, Jul 13, 2017 at 7:39 PM, Julien notifications@github.com wrote:

I appreciate the compliment. Please note that POK and Ocarina are open source and contributions are more than appreciated.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pok-kernel/pok/issues/4#issuecomment-315097689, or mute the thread https://github.com/notifications/unsubscribe-auth/AS1UIokiNNI97lBOdvl83ddMn1_7aJRWks5sNiwGgaJpZM4OWg6A .

yoogx commented 7 years ago

@AtirChaudary, can you please send us a patch with your corrections ? These would also help us providing an updated version of the tool. Thanks

khchenTW commented 6 years ago

@AtirChaudary @yoogx, is this issue solved to the end? I also have the same error. It would be nice if there is a patch.

yoogx commented 6 years ago

No, I did not hear back from @AtirChaudary since last August. And I lack resources to update these models.

AtirChaudary commented 6 years ago

see the .aadl file and see which functions you are using in your model.There are some mistakes like where we define language if = C but it should be (C) because thats how functions are accepting it. so i use it for my own and modified it but i am not working on this anymore so i dont have access to those files now.I moved to other project hope this helps @yoogx @kuanhsunchen

gchamp20 commented 5 years ago

Hi,

It seems most of the errors were introduced around the time this commit was merged into ocarina. Mainly, it seems Module_Major_Frame, Partition_Slots, Slots_Allocation from ARINC653:: has to be replaced by POK::Major_Frame, POK::Slots, POK::Slots_Allocation. Plus what @AtirChaudary said about source_language => (C).

However, after correcting the model i'm getting the error from the script:

ARINC653 deployment file is NOT conform to XSD schema

These are the format errors:

cpu_arinc653-conf.xml:0: Schemas validity error : Element 'System_HM_Table': Missing child element(s). Expected is ( System_State_Entry ).

cpu_arinc653-conf.xml:0: Schemas validity error : Element 'Module_HM_Table': Missing child element(s). Expected is ( System_State_Entry ).

cpu_arinc653-conf.xml:0: Schemas validity error : Element 'Memory_Requirements': The attribute 'Type' is required but missing.

cpu_arinc653-conf.xml:0: Schemas validity error : Element 'Memory_Requirements': The attribute 'Access' is required but missing.

cpu_arinc653-conf.xml:0: Schemas validity error : Element 'Partition_HM_Table': The attribute 'PartitionIdentifier' is required but missing.

cpu_arinc653-conf.xml:0: Schemas validity error : Element 'Partition_HM_Table': Missing child element(s). Expected is ( System_State_Entry ).

cpu_arinc653-conf.xml:0: Schemas validity error : Element 'ARINC_653_Module': Missing child element(s). Expected is one of ( Partition_HM_Table, Connection_Table ).

The code still compiles even if the xml is not valid. I'm willing to correct the models, but I'm wondering is using ocarina the common workflow for using POK? Because commits are getting merged, but none of the examples using ocarina are buildable out of the box for me.

If I want to fix the models, what is the best way to go about it? Is there any example of currently valid ARINC653 model working for ocarina? I tried ocarina/examples/real/safety/model.aadl, but those don't seem to be valid either.

juli1 commented 5 years ago

Can you please send:

  1. The version of ocarina you are using
  2. The version of pok you are using
  3. The commands you are using

Having a way to reproduce the bug will definitively help us to fix it :-)

gchamp20 commented 5 years ago

Sorry for the late reply.

1 - Ocarina 2017.1 (Working Copy from rfb77e27) --> Github binaries 2 - Latest pok master (commit ddca1c4) 3 - make in examples/arinc653-events or any other arinc653-* test.

The build scripts hide the error output from the subcommand, so I've executed ocarina -k no-assert -k arinc653 -aadlv2 -f -g pok_c model.aadl $POK_PATH/misc/aadl-library.aadl to debug the AADL model and ../../../misc/check-arinc653-conffile.pl cpu_arinc653-conf.xml to validate the XML configuration files after I got the model compiling.

juli1 commented 5 years ago

I will look into this over the week end.

juli1 commented 5 years ago

follow-up on this.

The reason is because the property set changed. Obviously, the ocarina compiler would need some love to be fixed and generate the HM policy based on the new property set. It will have to read the literals from the new property set and so on.

I managed to generate arinc653-blackboard but the generated code needs to be manually modified to compile (adding POK_NEEDS_THREADS and POK_NEEDS_FUNCTION_TIME_GET in the deployment.h file).

This is a long change that requires some time, please submit a patch to fix the issue and/or try to get commercial support if this is something you really need.

gchamp20 commented 5 years ago

Thank you for the answer.

If I understand correctly the ocarina compiler is not correctly using its property set defined in ocarina/resources/AADLv2/arinc653.aadl, so the backend for POK defined in ocarina/src/backends/arinc653/ requires some modification? On top of that, the models used by the arinc653-* tests in the pok repository would need to be updated to use the same property set?

I am not using POK for anything commercial, so don't worry! :-)

juli1 commented 5 years ago

You are totally correct:

wenting83 commented 3 years ago
  • based on the new properties.

Yes, exactly. Any update? Thank you!