diff --git a/Demo_Crazyflie_Blink/DataView.aadl b/Demo_Crazyflie_Blink/DataView.aadl new file mode 100644 index 0000000000000000000000000000000000000000..8e1397893ccac305b6a44ef36effc1b06e84e208 --- /dev/null +++ b/Demo_Crazyflie_Blink/DataView.aadl @@ -0,0 +1,550 @@ +-------------------------------------------------------- +--! File generated by asn2aadl v2.1.3: DO NOT EDIT ! +-------------------------------------------------------- + +package DataView + +public + + with Data_Model; + with Taste; + with Base_Types; + with Deployment; + +DATA Simulink_Tunable_Parameter +PROPERTIES + TASTE::Ada_Package_Name => "TASTE_Directives"; + Type_Source_Name => "Simulink-Tunable-Parameter"; + Deployment::ASN1_Module_Name => "TASTE-Directives"; + TASTE::Forbid_in_PI => true; +END Simulink_Tunable_Parameter; + +DATA Timer +PROPERTIES + TASTE::Ada_Package_Name => "TASTE_Directives"; + Type_Source_Name => "Timer"; + Deployment::ASN1_Module_Name => "TASTE-Directives"; + TASTE::Forbid_in_PI => true; +END Timer; + +DATA Taste_directive +PROPERTIES + TASTE::Ada_Package_Name => "TASTE_Directives"; + Type_Source_Name => "Taste-directive"; + Deployment::ASN1_Module_Name => "TASTE-Directives"; + TASTE::Forbid_in_PI => true; +END Taste_directive; + +data Stream_Element_Buffer + -- Root type for buffer elements +properties + Data_Model::Data_Representation => Character; +end Stream_Element_Buffer; +DATA MySeqOf +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/work/crazytaste-blink/DataView.asn"); + TASTE::Ada_Package_Name => "TASTE_Dataview"; + Deployment::ASN1_Module_Name => "TASTE-Dataview"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 8; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MySeqOf"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aSEQUENCEOF; +END MySeqOf; + +DATA MySeqOf_Buffer_Max +END MySeqOf_Buffer_Max; + +DATA IMPLEMENTATION MySeqOf_Buffer_Max.impl + -- Buffer to hold a marshalled data of type MySeqOf +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END MySeqOf_Buffer_Max.impl; + +DATA MySeqOf_Buffer +END MySeqOf_Buffer; + +DATA IMPLEMENTATION MySeqOf_Buffer.impl + -- Buffer to hold a marshalled data of type MySeqOf +SUBCOMPONENTS + Buffer : data MySeqOf_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MySeqOf_Buffer.impl; + +DATA MySeq +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/work/crazytaste-blink/DataView.asn"); + TASTE::Ada_Package_Name => "TASTE_Dataview"; + Deployment::ASN1_Module_Name => "TASTE-Dataview"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 24; suggested aligned message buffer is... + Source_Data_Size => 24 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MySeq"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aSEQUENCE; +END MySeq; + +DATA MySeq_Buffer_Max +END MySeq_Buffer_Max; + +DATA IMPLEMENTATION MySeq_Buffer_Max.impl + -- Buffer to hold a marshalled data of type MySeq +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (24); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END MySeq_Buffer_Max.impl; + +DATA MySeq_Buffer +END MySeq_Buffer; + +DATA IMPLEMENTATION MySeq_Buffer.impl + -- Buffer to hold a marshalled data of type MySeq +SUBCOMPONENTS + Buffer : data MySeq_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MySeq_Buffer.impl; + +DATA T_Boolean +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn"); + TASTE::Ada_Package_Name => "TASTE_BasicTypes"; + Deployment::ASN1_Module_Name => "TASTE-BasicTypes"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 1; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-Boolean"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aBOOLEAN; +END T_Boolean; + +DATA T_Boolean_Buffer_Max +END T_Boolean_Buffer_Max; + +DATA IMPLEMENTATION T_Boolean_Buffer_Max.impl + -- Buffer to hold a marshalled data of type T_Boolean +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END T_Boolean_Buffer_Max.impl; + +DATA T_Boolean_Buffer +END T_Boolean_Buffer; + +DATA IMPLEMENTATION T_Boolean_Buffer.impl + -- Buffer to hold a marshalled data of type T_Boolean +SUBCOMPONENTS + Buffer : data T_Boolean_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_Boolean_Buffer.impl; + +DATA MyChoice +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/work/crazytaste-blink/DataView.asn"); + TASTE::Ada_Package_Name => "TASTE_Dataview"; + Deployment::ASN1_Module_Name => "TASTE-Dataview"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 32; suggested aligned message buffer is... + Source_Data_Size => 32 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MyChoice"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aCHOICE; +END MyChoice; + +DATA MyChoice_Buffer_Max +END MyChoice_Buffer_Max; + +DATA IMPLEMENTATION MyChoice_Buffer_Max.impl + -- Buffer to hold a marshalled data of type MyChoice +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (32); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END MyChoice_Buffer_Max.impl; + +DATA MyChoice_Buffer +END MyChoice_Buffer; + +DATA IMPLEMENTATION MyChoice_Buffer.impl + -- Buffer to hold a marshalled data of type MyChoice +SUBCOMPONENTS + Buffer : data MyChoice_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MyChoice_Buffer.impl; + +DATA T_Int32 +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn"); + TASTE::Ada_Package_Name => "TASTE_BasicTypes"; + Deployment::ASN1_Module_Name => "TASTE-BasicTypes"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 8; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-Int32"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END T_Int32; + +DATA T_Int32_Buffer_Max +END T_Int32_Buffer_Max; + +DATA IMPLEMENTATION T_Int32_Buffer_Max.impl + -- Buffer to hold a marshalled data of type T_Int32 +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END T_Int32_Buffer_Max.impl; + +DATA T_Int32_Buffer +END T_Int32_Buffer; + +DATA IMPLEMENTATION T_Int32_Buffer.impl + -- Buffer to hold a marshalled data of type T_Int32 +SUBCOMPONENTS + Buffer : data T_Int32_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_Int32_Buffer.impl; + +DATA T_UInt8 +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn"); + TASTE::Ada_Package_Name => "TASTE_BasicTypes"; + Deployment::ASN1_Module_Name => "TASTE-BasicTypes"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 8; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-UInt8"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END T_UInt8; + +DATA T_UInt8_Buffer_Max +END T_UInt8_Buffer_Max; + +DATA IMPLEMENTATION T_UInt8_Buffer_Max.impl + -- Buffer to hold a marshalled data of type T_UInt8 +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END T_UInt8_Buffer_Max.impl; + +DATA T_UInt8_Buffer +END T_UInt8_Buffer; + +DATA IMPLEMENTATION T_UInt8_Buffer.impl + -- Buffer to hold a marshalled data of type T_UInt8 +SUBCOMPONENTS + Buffer : data T_UInt8_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_UInt8_Buffer.impl; + +DATA MyEnum +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/work/crazytaste-blink/DataView.asn"); + TASTE::Ada_Package_Name => "TASTE_Dataview"; + Deployment::ASN1_Module_Name => "TASTE-Dataview"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 4; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MyEnum"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aENUMERATED; +END MyEnum; + +DATA MyEnum_Buffer_Max +END MyEnum_Buffer_Max; + +DATA IMPLEMENTATION MyEnum_Buffer_Max.impl + -- Buffer to hold a marshalled data of type MyEnum +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END MyEnum_Buffer_Max.impl; + +DATA MyEnum_Buffer +END MyEnum_Buffer; + +DATA IMPLEMENTATION MyEnum_Buffer.impl + -- Buffer to hold a marshalled data of type MyEnum +SUBCOMPONENTS + Buffer : data MyEnum_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MyEnum_Buffer.impl; + +DATA MyReal +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/work/crazytaste-blink/DataView.asn"); + TASTE::Ada_Package_Name => "TASTE_Dataview"; + Deployment::ASN1_Module_Name => "TASTE-Dataview"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 13; suggested aligned message buffer is... + Source_Data_Size => 16 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MyReal"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aREAL; +END MyReal; + +DATA MyReal_Buffer_Max +END MyReal_Buffer_Max; + +DATA IMPLEMENTATION MyReal_Buffer_Max.impl + -- Buffer to hold a marshalled data of type MyReal +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (16); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END MyReal_Buffer_Max.impl; + +DATA MyReal_Buffer +END MyReal_Buffer; + +DATA IMPLEMENTATION MyReal_Buffer.impl + -- Buffer to hold a marshalled data of type MyReal +SUBCOMPONENTS + Buffer : data MyReal_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MyReal_Buffer.impl; + +DATA T_Int8 +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn"); + TASTE::Ada_Package_Name => "TASTE_BasicTypes"; + Deployment::ASN1_Module_Name => "TASTE-BasicTypes"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 8; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-Int8"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END T_Int8; + +DATA T_Int8_Buffer_Max +END T_Int8_Buffer_Max; + +DATA IMPLEMENTATION T_Int8_Buffer_Max.impl + -- Buffer to hold a marshalled data of type T_Int8 +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END T_Int8_Buffer_Max.impl; + +DATA T_Int8_Buffer +END T_Int8_Buffer; + +DATA IMPLEMENTATION T_Int8_Buffer.impl + -- Buffer to hold a marshalled data of type T_Int8 +SUBCOMPONENTS + Buffer : data T_Int8_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_Int8_Buffer.impl; + +DATA T_UInt32 +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn"); + TASTE::Ada_Package_Name => "TASTE_BasicTypes"; + Deployment::ASN1_Module_Name => "TASTE-BasicTypes"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 8; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-UInt32"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END T_UInt32; + +DATA T_UInt32_Buffer_Max +END T_UInt32_Buffer_Max; + +DATA IMPLEMENTATION T_UInt32_Buffer_Max.impl + -- Buffer to hold a marshalled data of type T_UInt32 +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END T_UInt32_Buffer_Max.impl; + +DATA T_UInt32_Buffer +END T_UInt32_Buffer; + +DATA IMPLEMENTATION T_UInt32_Buffer.impl + -- Buffer to hold a marshalled data of type T_UInt32 +SUBCOMPONENTS + Buffer : data T_UInt32_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_UInt32_Buffer.impl; + +DATA MyOctStr +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/work/crazytaste-blink/DataView.asn"); + TASTE::Ada_Package_Name => "TASTE_Dataview"; + Deployment::ASN1_Module_Name => "TASTE-Dataview"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 3; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MyOctStr"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aSTRING; +END MyOctStr; + +DATA MyOctStr_Buffer_Max +END MyOctStr_Buffer_Max; + +DATA IMPLEMENTATION MyOctStr_Buffer_Max.impl + -- Buffer to hold a marshalled data of type MyOctStr +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END MyOctStr_Buffer_Max.impl; + +DATA MyOctStr_Buffer +END MyOctStr_Buffer; + +DATA IMPLEMENTATION MyOctStr_Buffer.impl + -- Buffer to hold a marshalled data of type MyOctStr +SUBCOMPONENTS + Buffer : data MyOctStr_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MyOctStr_Buffer.impl; + +DATA MyBool +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/work/crazytaste-blink/DataView.asn"); + TASTE::Ada_Package_Name => "TASTE_Dataview"; + Deployment::ASN1_Module_Name => "TASTE-Dataview"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 1; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MyBool"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aBOOLEAN; +END MyBool; + +DATA MyBool_Buffer_Max +END MyBool_Buffer_Max; + +DATA IMPLEMENTATION MyBool_Buffer_Max.impl + -- Buffer to hold a marshalled data of type MyBool +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END MyBool_Buffer_Max.impl; + +DATA MyBool_Buffer +END MyBool_Buffer; + +DATA IMPLEMENTATION MyBool_Buffer.impl + -- Buffer to hold a marshalled data of type MyBool +SUBCOMPONENTS + Buffer : data MyBool_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MyBool_Buffer.impl; + +DATA MyInteger +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/work/crazytaste-blink/DataView.asn"); + TASTE::Ada_Package_Name => "TASTE_Dataview"; + Deployment::ASN1_Module_Name => "TASTE-Dataview"; + Source_Language => ASN1; + -- Size of a buffer to cover all forms of message representation: + -- Real message size is 8; suggested aligned message buffer is... + Source_Data_Size => 8 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MyInteger"; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END MyInteger; + +DATA MyInteger_Buffer_Max +END MyInteger_Buffer_Max; + +DATA IMPLEMENTATION MyInteger_Buffer_Max.impl + -- Buffer to hold a marshalled data of type MyInteger +PROPERTIES + Data_Model::Data_Representation => array; + Data_Model::Dimension => (8); -- Size of the buffer + Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer)); +END MyInteger_Buffer_Max.impl; + +DATA MyInteger_Buffer +END MyInteger_Buffer; + +DATA IMPLEMENTATION MyInteger_Buffer.impl + -- Buffer to hold a marshalled data of type MyInteger +SUBCOMPONENTS + Buffer : data MyInteger_Buffer_Max.impl; + Length : data Base_Types::Unsigned_32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MyInteger_Buffer.impl; + +end DataView; diff --git a/Demo_Crazyflie_Blink/DataView.asn b/Demo_Crazyflie_Blink/DataView.asn new file mode 100644 index 0000000000000000000000000000000000000000..feb2e3acc326c6c810f6ab6d0b43a565f56d1fcd --- /dev/null +++ b/Demo_Crazyflie_Blink/DataView.asn @@ -0,0 +1,33 @@ +TASTE-Dataview DEFINITIONS ::= +BEGIN +IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes; + +-- A few simple types to start with ASN.1 +MyInteger ::= T-UInt8 + +MyReal ::= REAL (0.0 .. 1000.0) + +MyBool ::= BOOLEAN + +MyEnum ::= ENUMERATED { hello, world, howareyou } + +MySeq ::= SEQUENCE { + input-data MyInteger, + output-data MyInteger, + validity ENUMERATED { valid, invalid } +} + +MyChoice ::= CHOICE { + a BOOLEAN, + b MySeq +} + +MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum + +MyOctStr ::= OCTET STRING (SIZE (3)) + +-- You can also declare constants +myVar MySeqOf ::= { hello, world } + +END + diff --git a/Demo_Crazyflie_Blink/DeploymentView.aadl b/Demo_Crazyflie_Blink/DeploymentView.aadl new file mode 100644 index 0000000000000000000000000000000000000000..55d295cfe2722667a65688eea65c2798823e967a --- /dev/null +++ b/Demo_Crazyflie_Blink/DeploymentView.aadl @@ -0,0 +1,74 @@ +--------------------------------------------------- +-- AADL2.0 +-- TASTE +-- +-- +--------------------------------------------------- + +PACKAGE deploymentview::DV::Node1 +PUBLIC + +WITH Taste; +WITH Deployment; +WITH TASTE_DV_Properties; +PROCESS cortex_m_partition +END cortex_m_partition; + +PROCESS IMPLEMENTATION cortex_m_partition.others +END cortex_m_partition.others; + +END deploymentview::DV::Node1; + +PACKAGE deploymentview::DV +PUBLIC + +WITH ocarina_processors_arm; +WITH deploymentview::DV::Node1; +WITH Taste; +WITH Deployment; +WITH interfaceview::IV; +WITH TASTE_DV_Properties; +SYSTEM Node1 +END Node1; + +SYSTEM IMPLEMENTATION Node1.others +SUBCOMPONENTS + IV_Function1 : SYSTEM interfaceview::IV::Function1.others { + Taste::coordinates => "708 975 1103 1303"; + Taste::FunctionName => "Function1"; + }; + IV_Function2 : SYSTEM interfaceview::IV::Function2.others { + Taste::coordinates => "1195 928 1565 1334"; + Taste::FunctionName => "Function2"; + }; + cortex_m_partition : PROCESS deploymentview::DV::Node1::cortex_m_partition.others { + Taste::coordinates => "653 746 1769 1453"; + Deployment::Port_Number => 0; + }; + cortex_m_i : PROCESSOR ocarina_processors_arm::cortex_m.i { + Taste::coordinates => "513 544 1909 1554"; + }; +PROPERTIES + Taste::APLC_Binding => (reference (cortex_m_partition)) APPLIES TO IV_Function1; + Taste::APLC_Binding => (reference (cortex_m_partition)) APPLIES TO IV_Function2; + Actual_Processor_Binding => (reference (cortex_m_i)) APPLIES TO cortex_m_partition; +END Node1.others; + +SYSTEM deploymentview +END deploymentview; + +SYSTEM IMPLEMENTATION deploymentview.others +SUBCOMPONENTS + Node1 : SYSTEM Node1.others { + Taste::coordinates => "339 256 2083 1698"; + }; + interfaceview : SYSTEM interfaceview::IV::interfaceview.others; +END deploymentview.others; + +PROPERTIES + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "1.3.19"; + Taste::interfaceView => "InterfaceView.aadl"; + Taste::HWLibraries => ("../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl"); +END deploymentview::DV; + diff --git a/Demo_Crazyflie_Blink/InterfaceView.aadl b/Demo_Crazyflie_Blink/InterfaceView.aadl new file mode 100644 index 0000000000000000000000000000000000000000..5686f56fc68d079caf907834568395637fbba71c --- /dev/null +++ b/Demo_Crazyflie_Blink/InterfaceView.aadl @@ -0,0 +1,144 @@ +--------------------------------------------------- +-- AADL2.0 +-- TASTE +-- +-- +--------------------------------------------------- + +PACKAGE interfaceview::FV::Function1 +PUBLIC + +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SUBPROGRAM PI_pulse +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_pulse; + +SUBPROGRAM IMPLEMENTATION PI_pulse.others +END PI_pulse.others; + +SUBPROGRAM RI_Blink +FEATURES + EnableDisable : IN PARAMETER DataView::MyBool { + Taste::encoding => NATIVE; + }; +END RI_Blink; + +SUBPROGRAM IMPLEMENTATION RI_Blink.others +END RI_Blink.others; + +END interfaceview::FV::Function1; + +PACKAGE interfaceview::FV::Function2 +PUBLIC + +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SUBPROGRAM PI_Blink +FEATURES + EnableDisable : IN PARAMETER DataView::MyBool { + Taste::encoding => NATIVE; + }; +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_Blink; + +SUBPROGRAM IMPLEMENTATION PI_Blink.others +END PI_Blink.others; + +END interfaceview::FV::Function2; + +PACKAGE interfaceview::IV +PUBLIC + +WITH interfaceview::FV::Function1; +WITH interfaceview::FV::Function2; +WITH interfaceview::FV; +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SYSTEM Function1 +FEATURES + PI_pulse : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Function1::PI_pulse.others { + Taste::coordinates => "308 559"; + Taste::RCMoperationKind => cyclic; + Taste::RCMperiod => 1000 ms; + Taste::Deadline => 0 ms; + Taste::InterfaceName => "pulse"; + }; + RI_Blink : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::Function2::PI_Blink.others { + Taste::coordinates => "1165 595"; + Taste::RCMoperationKind => any; + Taste::InterfaceName => "Blink"; + Taste::labelInheritance => "true"; + }; +PROPERTIES + Source_Language => (SDL); +END Function1; + +SYSTEM IMPLEMENTATION Function1.others +SUBCOMPONENTS + pulse_impl : SUBPROGRAM interfaceview::FV::Function1::PI_pulse.others { + Compute_Execution_Time => 0 ms .. 0 ms; + }; +CONNECTIONS + OpToPICnx_pulse_impl : SUBPROGRAM ACCESS pulse_impl -> PI_pulse; +END Function1.others; + +SYSTEM Function2 +FEATURES + PI_Blink : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Function2::PI_Blink.others { + Taste::coordinates => "1534 616"; + Taste::RCMoperationKind => unprotected; + Taste::RCMperiod => 0 ms; + Taste::Deadline => 0 ms; + Taste::InterfaceName => "Blink"; + }; +PROPERTIES + Source_Language => (Ada); +END Function2; + +SYSTEM IMPLEMENTATION Function2.others +SUBCOMPONENTS + Blink_impl : SUBPROGRAM interfaceview::FV::Function2::PI_Blink.others { + Compute_Execution_Time => 0 ms .. 0 ms; + }; +CONNECTIONS + OpToPICnx_Blink_impl : SUBPROGRAM ACCESS Blink_impl -> PI_Blink; +END Function2.others; + +SYSTEM interfaceview +END interfaceview; + +SYSTEM IMPLEMENTATION interfaceview.others +SUBCOMPONENTS + Function1 : SYSTEM interfaceview::IV::Function1.others { + Taste::coordinates => "308 421 1165 1247"; + }; + Function2 : SYSTEM interfaceview::IV::Function2.others { + Taste::coordinates => "1534 415 2334 1205"; + }; +CONNECTIONS + Function2_Blink_Function1_Blink : SUBPROGRAM ACCESS Function2.PI_Blink -> Function1.RI_Blink { + Taste::coordinates => "1165 595 1347 595 1347 616 1534 616"; + }; +END interfaceview.others; + +PROPERTIES + Taste::dataView => ("DataView"); + Taste::dataViewPath => ("DataView.aadl"); + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "1.3.19"; +END interfaceview::IV; + +PACKAGE interfaceview::FV +PUBLIC + +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +END interfaceview::FV; + diff --git a/Demo_Crazyflie_Blink/build-script.sh b/Demo_Crazyflie_Blink/build-script.sh new file mode 100755 index 0000000000000000000000000000000000000000..716d2fec21da8273d1247efb6acbd2ecb8aba7f8 --- /dev/null +++ b/Demo_Crazyflie_Blink/build-script.sh @@ -0,0 +1,97 @@ +#!/bin/bash + +# This script will build your TASTE system (by default with the C runtime). + +# You should not change this file as it was automatically generated. + +# If you need additional preprocessing, create a file named 'user_init_pre.sh' +# and/or 'user_init_post.sh - They will never get overwritten.' + +# Inside these files you may set some environment variables: +# C_INCLUDE_PATH=/usr/include/xenomai/analogy/:${C_INCLUDE_PATH} +# unset USE_POHIC + +CWD=$(pwd) + +if [ -t 0 ] ; then + COLORON="\e[1m\e[32m" + COLOROFF="\e[0m" +else + COLORON="" + COLOROFF="" +fi +INFO="${COLORON}[INFO]${COLOROFF}" + +if [ -f user_init_pre.sh ] +then + echo -e "${INFO} Executing user-defined init script" + source user_init_pre.sh +fi + + +# Detect models from Ellidiss tools v2, and convert them to 1.3 +INTERFACEVIEW=InterfaceView.aadl +grep "version => \"2" InterfaceView.aadl >/dev/null && { + echo -e "${INFO} Converting interface view from V2 to V1.3" + TASTE --load-interface-view InterfaceView.aadl --export-interface-view-to-1_3 __iv_1_3.aadl + INTERFACEVIEW=__iv_1_3.aadl +}; + +if [ -z "$DEPLOYMENTVIEW" ] +then + DEPLOYMENTVIEW=DeploymentView.aadl +fi + +# Detect models from Ellidiss tools v2, and convert them to 1.3 +grep "version => \"2" "$DEPLOYMENTVIEW" >/dev/null && { + echo -e "${INFO} Converting deployment view from V2 to V1.3" + TASTE --load-deployment-view "$DEPLOYMENTVIEW" --export-deployment-view-to-1_3 __dv_1_3.aadl + DEPLOYMENTVIEW=__dv_1_3.aadl +}; + +SKELS="./" + +# Update the data view with local paths +taste-update-data-view + +# Generate code for OpenGEODE function function1 +cd "$SKELS"/function1 && opengeode --toAda function1.pr system_structure.pr && cd $OLDPWD + +cd "$SKELS" && rm -f function1.zip && zip function1 function1/* && cd $OLDPWD + +cd "$SKELS" && rm -f function2.zip && zip function2 function2/* && cd $OLDPWD + +[ ! -z "$CLEANUP" ] && rm -rf binary* + +if [ -f ConcurrencyView.pro ] +then + ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView.pro " +fi + +if [ ! -z "$USE_POHIC" ] +then + OUTPUTDIR=binary.c + ORCHESTRATOR_OPTIONS+=" -p " +elif [ ! -z "$USE_POHIADA" ] +then + OUTPUTDIR=binary.ada +else + OUTPUTDIR=binary +fi + +if [ -f user_init_post.sh ] +then + echo -e "${INFO} Executing user-defined init script" + source user_init_post.sh +fi + +cd "$CWD" && assert-builder-ocarina.py \ + --fast \ + --aadlv2 \ + --keep-case \ + --interfaceView "$INTERFACEVIEW" \ + --deploymentView "$DEPLOYMENTVIEW" \ + -o "$OUTPUTDIR" \ + --subAda function1:"$SKELS"/function1.zip \ + --subAda function2:"$SKELS"/function2.zip \ + $ORCHESTRATOR_OPTIONS diff --git a/Demo_Crazyflie_Blink/function1/dataview-uniq.asn b/Demo_Crazyflie_Blink/function1/dataview-uniq.asn new file mode 100644 index 0000000000000000000000000000000000000000..f5e9fa94d231adae57bfe7ff400887baaab0b60a --- /dev/null +++ b/Demo_Crazyflie_Blink/function1/dataview-uniq.asn @@ -0,0 +1,50 @@ +TASTE-Dataview DEFINITIONS ::= +BEGIN +IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes; + +-- A few simple types to start with ASN.1 +MyInteger ::= T-UInt8 + +MyReal ::= REAL (0.0 .. 1000.0) + +MyBool ::= BOOLEAN + +MyEnum ::= ENUMERATED { hello, world, howareyou } + +MySeq ::= SEQUENCE { + input-data MyInteger, + output-data MyInteger, + validity ENUMERATED { valid, invalid } +} + +MyChoice ::= CHOICE { + a BOOLEAN, + b MySeq +} + +MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum + +MyOctStr ::= OCTET STRING (SIZE (3)) + +-- You can also declare constants +myVar MySeqOf ::= { hello, world } + +END + +TASTE-BasicTypes DEFINITIONS ::= +BEGIN + +-- Set of TASTE predefined basic types + +T-Int32 ::= INTEGER (-2147483648 .. 2147483647) + +T-UInt32 ::= INTEGER (0 .. 4294967295) + +T-Int8 ::= INTEGER (-128 .. 127) + +T-UInt8 ::= INTEGER (0 .. 255) + +T-Boolean ::= BOOLEAN + +END + diff --git a/Demo_Crazyflie_Blink/function1/function1.pr b/Demo_Crazyflie_Blink/function1/function1.pr new file mode 100644 index 0000000000000000000000000000000000000000..efee66487b4d6da4143bcb05749598ea397d49b1 --- /dev/null +++ b/Demo_Crazyflie_Blink/function1/function1.pr @@ -0,0 +1,21 @@ +/* CIF PROCESS (250, 150), (150, 75) */ +process function1; + /* CIF TEXT (670, 174), (270, 140) */ + dcl mode MyBool := false; + /* CIF ENDTEXT */ + /* CIF START (409, 22), (70, 35) */ + START; + /* CIF NEXTSTATE (409, 72), (70, 35) */ + NEXTSTATE Wait; + /* CIF state (409, 72), (70, 35) */ + state Wait; + /* CIF input (409, 127), (70, 35) */ + input pulse; + /* CIF PROCEDURECALL (394, 182), (99, 35) */ + call Blink(mode); + /* CIF task (378, 237), (131, 35) */ + task mode := not mode; + /* CIF NEXTSTATE (409, 292), (70, 35) */ + NEXTSTATE Wait; + endstate; +endprocess function1; \ No newline at end of file diff --git a/Demo_Crazyflie_Blink/function1/system_structure.pr b/Demo_Crazyflie_Blink/function1/system_structure.pr new file mode 100644 index 0000000000000000000000000000000000000000..aa64ad8f52ea3b39a07cb1afc2934cc1e5f2829b --- /dev/null +++ b/Demo_Crazyflie_Blink/function1/system_structure.pr @@ -0,0 +1,27 @@ +/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */ +USE Datamodel; +SYSTEM function1; + + SIGNAL pulse; + + PROCEDURE Blink COMMENT '#c_predef'; + FPAR + IN EnableDisable MyBool; + EXTERNAL; + + CHANNEL c + FROM ENV TO function1 WITH pulse; + ENDCHANNEL; + + BLOCK function1; + + SIGNALROUTE r + FROM ENV TO function1 WITH pulse; + + CONNECT c and r; + + PROCESS function1 REFERENCED; + + ENDBLOCK; + +ENDSYSTEM; \ No newline at end of file diff --git a/Demo_Crazyflie_Blink/function2/function2.adb b/Demo_Crazyflie_Blink/function2/function2.adb new file mode 100644 index 0000000000000000000000000000000000000000..8b9654c361c174254b35ff788e6b8446a1e5fdcc --- /dev/null +++ b/Demo_Crazyflie_Blink/function2/function2.adb @@ -0,0 +1,40 @@ +-- User implementation of the function2 function +-- This file will never be overwritten once edited and modified +-- Only the interface of functions is regenerated (in the .ads file) + +pragma style_checks (off); +pragma warnings (off); +with adaasn1rtl; +use adaasn1rtl; + +with TASTE_Dataview; +use TASTE_Dataview; + +with STM32.Board; +use STM32.Board; +with STM32.GPIO; +use STM32.GPIO; +with STM32.Device; +use STM32.Device; + +package body function2 is + + --------------------------------------------------------- + -- Provided interface "Blink" + --------------------------------------------------------- + procedure Blink(EnableDisable: access asn1sccMyBool) is + pragma suppress (all_checks); + My_Led : User_LED renames PD5; + begin + if boolean(EnableDisable.all) then + All_LEDs_On; + else + All_LEDs_Off; + + end if; + end Blink; + + begin + STM32.Board.Initialize_LEDs; + +end function2; diff --git a/Demo_Crazyflie_Blink/function2/function2.ads b/Demo_Crazyflie_Blink/function2/function2.ads new file mode 100644 index 0000000000000000000000000000000000000000..a405a84b6131a6abcc63be680703f4185d5d8fb2 --- /dev/null +++ b/Demo_Crazyflie_Blink/function2/function2.ads @@ -0,0 +1,28 @@ +-- This file was generated automatically: DO NOT MODIFY IT ! + +-- Declaration of the provided and required interfaces + +pragma style_checks (off); +pragma warnings (off); +with adaasn1rtl; +use adaasn1rtl; + +with TASTE_Dataview; +use TASTE_Dataview; + +package function2 is + + --------------------------------------------------------- + -- Provided interface "Blink" + --------------------------------------------------------- + procedure Blink(EnableDisable: access asn1sccMyBool); + pragma export(C, Blink, "function2_PI_Blink"); + + --------------------------------------------------------- + -- Provided interface "pulse" + --------------------------------------------------------- + procedure pulse; + pragma export(C, pulse, "function2_PI_pulse"); + + +end function2; diff --git a/Demo_Crazyflie_Blink/taste-types.asn b/Demo_Crazyflie_Blink/taste-types.asn new file mode 100644 index 0000000000000000000000000000000000000000..6078c6fecb0f947c8cff3c84cc8b9820969e83fb --- /dev/null +++ b/Demo_Crazyflie_Blink/taste-types.asn @@ -0,0 +1,17 @@ +TASTE-BasicTypes DEFINITIONS ::= +BEGIN + +-- Set of TASTE predefined basic types + +T-Int32 ::= INTEGER (-2147483648 .. 2147483647) + +T-UInt32 ::= INTEGER (0 .. 4294967295) + +T-Int8 ::= INTEGER (-128 .. 127) + +T-UInt8 ::= INTEGER (0 .. 255) + +T-Boolean ::= BOOLEAN + +END +