diff --git a/test/Demo_Blackbox/DataView.aadl b/test/Demo_Blackbox/DataView.aadl new file mode 100644 index 0000000000000000000000000000000000000000..538ed9d11a5e7677d660b54eb50ec433d51b2fb4 --- /dev/null +++ b/test/Demo_Blackbox/DataView.aadl @@ -0,0 +1,567 @@ +-------------------------------------------------------- +--! File generated by asn2aadl v2.1.41: DO NOT EDIT ! +-------------------------------------------------------- +--! InputASN1FileChecksum:7339ede675595a5275fa70dfb2698aac:/home/taste/tool-src/kazoo/test/Demo_Blackbox/DataView.asn: +--! InputASN1FileChecksum:ee8a7e01f29874c0d50f437d5abb9599:/home/taste/tool-inst/share/taste-types/taste-types.asn: +-------------------------------------------------------- + +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 MyChoice +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-src/kazoo/test/Demo_Blackbox/DataView.asn"); + TASTE::EncodingDefinitionFile => classifier(DataView::ACN_DataView); + 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 => "MyChoice"; + TASTE::Position_In_File => [ line => 16 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aCHOICE; +END MyChoice; + +DATA IMPLEMENTATION MyChoice.impl +END MyChoice.impl; + +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 => (24); -- Size of the buffer + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 40 Bytes; -- Size of the buffer in bytes +END MyChoice_Buffer.impl; + +DATA MyEnum +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-src/kazoo/test/Demo_Blackbox/DataView.asn"); + TASTE::EncodingDefinitionFile => classifier(DataView::ACN_DataView); + 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"; + TASTE::Position_In_File => [ line => 9 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aENUMERATED; +END MyEnum; + +DATA IMPLEMENTATION MyEnum.impl +END MyEnum.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +END MyEnum_Buffer.impl; + +DATA MyInteger +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-src/kazoo/test/Demo_Blackbox/DataView.asn"); + TASTE::EncodingDefinitionFile => classifier(DataView::ACN_DataView); + 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"; + TASTE::Position_In_File => [ line => 5 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END MyInteger; + +DATA IMPLEMENTATION MyInteger.impl +END MyInteger.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +END MyInteger_Buffer.impl; + +DATA MyOctStr +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-src/kazoo/test/Demo_Blackbox/DataView.asn"); + TASTE::EncodingDefinitionFile => classifier(DataView::ACN_DataView); + 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"; + TASTE::Position_In_File => [ line => 23 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aSTRING; +END MyOctStr; + +DATA IMPLEMENTATION MyOctStr.impl +END MyOctStr.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +END MyOctStr_Buffer.impl; + +DATA MySeq +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-src/kazoo/test/Demo_Blackbox/DataView.asn"); + TASTE::EncodingDefinitionFile => classifier(DataView::ACN_DataView); + 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 16; suggested aligned message buffer is... + Source_Data_Size => 16 Bytes; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MySeq"; + TASTE::Position_In_File => [ line => 11 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aSEQUENCE; +END MySeq; + +DATA IMPLEMENTATION MySeq.impl +END MySeq.impl; + +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 => (16); -- Size of the buffer + Source_Data_Size => 16 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 32 Bytes; -- Size of the buffer in bytes +END MySeq_Buffer.impl; + +DATA MySeqOf +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-src/kazoo/test/Demo_Blackbox/DataView.asn"); + TASTE::EncodingDefinitionFile => classifier(DataView::ACN_DataView); + 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"; + TASTE::Position_In_File => [ line => 21 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aSEQUENCEOF; +END MySeqOf; + +DATA IMPLEMENTATION MySeqOf.impl +END MySeqOf.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +END MySeqOf_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"; + TASTE::Position_In_File => [ line => 14 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aBOOLEAN; +END T_Boolean; + +DATA IMPLEMENTATION T_Boolean.impl +END T_Boolean.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +END T_Boolean_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"; + TASTE::Position_In_File => [ line => 6 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END T_Int32; + +DATA IMPLEMENTATION T_Int32.impl +END T_Int32.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +END T_Int32_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"; + TASTE::Position_In_File => [ line => 10 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END T_Int8; + +DATA IMPLEMENTATION T_Int8.impl +END T_Int8.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +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"; + TASTE::Position_In_File => [ line => 8 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END T_UInt32; + +DATA IMPLEMENTATION T_UInt32.impl +END T_UInt32.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +END T_UInt32_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"; + TASTE::Position_In_File => [ line => 12 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END T_UInt8; + +DATA IMPLEMENTATION T_UInt8.impl +END T_UInt8.impl; + +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 + Source_Data_Size => 8 Bytes; -- Size of the buffer in bytes + 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; + Source_Data_Size => 24 Bytes; -- Size of the buffer in bytes +END T_UInt8_Buffer.impl; + +SYSTEM Taste_DataView +END Taste_DataView; + +SYSTEM IMPLEMENTATION Taste_DataView.others +SUBCOMPONENTS + MyChoice : DATA MyChoice.impl; + MyEnum : DATA MyEnum.impl; + MyInteger : DATA MyInteger.impl; + MyOctStr : DATA MyOctStr.impl; + MySeq : DATA MySeq.impl; + MySeqOf : DATA MySeqOf.impl; + T_Boolean : DATA T_Boolean.impl; + T_Int32 : DATA T_Int32.impl; + T_Int8 : DATA T_Int8.impl; + T_UInt32 : DATA T_UInt32.impl; + T_UInt8 : DATA T_UInt8.impl; +END Taste_DataView.others; +DATA ACN_DataView +PROPERTIES + Source_Text => ("/home/taste/tool-src/kazoo/test/Demo_Blackbox/DataView.acn"); + Source_Language => (ACN); +END ACN_DataView; + +end DataView; diff --git a/test/Demo_Blackbox/DataView.acn b/test/Demo_Blackbox/DataView.acn new file mode 100644 index 0000000000000000000000000000000000000000..564018e300b78fb72fd25dcf88c6a52749b6a270 --- /dev/null +++ b/test/Demo_Blackbox/DataView.acn @@ -0,0 +1,33 @@ +/* +Automatically generated ACN grammar +Date was: 04/02/2012 +Time was: 03:59:23 +*/ + +TASTE-Dataview DEFINITIONS ::= BEGIN + + /*A few simple types to start with ASN.1*/ + MyInteger[size 16, encoding pos-int] + +-- MyReal[encoding IEEE754-1985-64] + + MyEnum[size 2, encoding pos-int] + + MySeq[] { + a [] , + b [size 2, encoding pos-int] + } + + MyChoice[] { + a [true-value '11'B] , + b [] + } + + MySeqOf[size 2] { + [] + } + + MyOctStr[size 3] + +END + diff --git a/test/Demo_Blackbox/DataView.asn b/test/Demo_Blackbox/DataView.asn new file mode 100644 index 0000000000000000000000000000000000000000..424810f271f956063a9d9da43cddbe996c7baa5a --- /dev/null +++ b/test/Demo_Blackbox/DataView.asn @@ -0,0 +1,30 @@ +TASTE-Dataview DEFINITIONS ::= +BEGIN + +-- A few simple types to start with ASN.1 +MyInteger ::= INTEGER (0..255) + +--MyReal ::= REAL (0.0 .. 1000.0) + +MyEnum ::= ENUMERATED { hello, world, howareyou } + +MySeq ::= SEQUENCE { + a MyInteger, + b ENUMERATED { taste(1), welcomes(2), you(3) } +} + +MyChoice ::= CHOICE { + a BOOLEAN, + b MySeq +} + +MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum + +MyOctStr ::= OCTET STRING (SIZE (3)) + +-- You can also declare variables (they will be visible in C, Ada and RTDS) +myVar MySeqOf ::= { hello, world } +-- myVar2 MyChoice ::= a:TRUE + +END + diff --git a/test/Demo_Blackbox/DeploymentView.aadl b/test/Demo_Blackbox/DeploymentView.aadl new file mode 100644 index 0000000000000000000000000000000000000000..b2480eeed1b733f9a8d88506280201ab9a8c300e --- /dev/null +++ b/test/Demo_Blackbox/DeploymentView.aadl @@ -0,0 +1,79 @@ +--------------------------------------------------- +-- AADL2.0 +-- TASTE +-- (c)Ellidiss Technologies +-- +--------------------------------------------------- + +PACKAGE deploymentview::DV::obj89 +PUBLIC + +WITH Taste; +WITH Deployment; +WITH TASTE_DV_Properties; +PROCESS demo_driver +END demo_driver; + +PROCESS IMPLEMENTATION demo_driver.others +END demo_driver.others; + +END deploymentview::DV::obj89; + +PACKAGE deploymentview::DV +PUBLIC + +WITH ocarina_processors_x86; +WITH deploymentview::DV::obj89; +WITH Taste; +WITH Deployment; +WITH interfaceview::IV; +WITH TASTE_DV_Properties; +SYSTEM obj89 +END obj89; + +SYSTEM IMPLEMENTATION obj89.others +SUBCOMPONENTS + IV_Caller_in_C : SYSTEM interfaceview::IV::Caller_in_C.others { + Taste::coordinates => "845 443 1395 599"; + Taste::FunctionName => "Caller_in_C"; + }; + IV_Caller_in_Ada : SYSTEM interfaceview::IV::Caller_in_Ada.others { + Taste::coordinates => "1522 439 2637 630"; + Taste::FunctionName => "Caller_in_Ada"; + }; + IV_BlackBox : SYSTEM interfaceview::IV::BlackBox.others { + Taste::coordinates => "1076 724 1996 1165"; + Taste::FunctionName => "BlackBox"; + }; + demo_driver : PROCESS deploymentview::DV::obj89::demo_driver.others { + Taste::coordinates => "785 345 2688 1180"; + Deployment::Port_Number => 0; + }; + obj99 : PROCESSOR ocarina_processors_x86::x86.linux { + Taste::coordinates => "722 211 2801 1211"; + }; +PROPERTIES + Taste::APLC_Binding => (reference (demo_driver)) APPLIES TO IV_Caller_in_C; + Taste::APLC_Binding => (reference (demo_driver)) APPLIES TO IV_Caller_in_Ada; + Taste::APLC_Binding => (reference (demo_driver)) APPLIES TO IV_BlackBox; + Actual_Processor_Binding => (reference (obj99)) APPLIES TO demo_driver; +END obj89.others; + +SYSTEM deploymentview +END deploymentview; + +SYSTEM IMPLEMENTATION deploymentview.others +SUBCOMPONENTS + obj89 : SYSTEM obj89.others { + Taste::coordinates => "485 96 2853 1243"; + }; + interfaceview : SYSTEM interfaceview::IV::interfaceview.others; +END deploymentview.others; + +PROPERTIES + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "1.3.17"; + Taste::interfaceView => "InterfaceView.aadl"; + Taste::HWLibraries => ("~/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl"); +END deploymentview::DV; + diff --git a/test/Demo_Blackbox/InterfaceView.aadl b/test/Demo_Blackbox/InterfaceView.aadl new file mode 100644 index 0000000000000000000000000000000000000000..52e8df46d6d800e17fdddf8c214d1807460c71ec --- /dev/null +++ b/test/Demo_Blackbox/InterfaceView.aadl @@ -0,0 +1,232 @@ +--------------------------------------------------- +-- AADL2.0 +-- TASTE +-- (c)Ellidiss Technologies +-- +--------------------------------------------------- + +PACKAGE interfaceview::FV::Caller_in_Ada +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_RunDriver +FEATURES + inp1_uper : IN PARAMETER DataView::MyInteger { + Taste::encoding => UPER; + }; + inp2_native : IN PARAMETER DataView::MyInteger { + Taste::encoding => ACN; + }; + outp1_native : OUT PARAMETER DataView::MyInteger { + Taste::encoding => ACN; + }; + outp2_uper : OUT PARAMETER DataView::MyInteger { + Taste::encoding => UPER; + }; +END RI_RunDriver; + +SUBPROGRAM IMPLEMENTATION RI_RunDriver.others +END RI_RunDriver.others; + +END interfaceview::FV::Caller_in_Ada; + +PACKAGE interfaceview::FV::BlackBox +PUBLIC + +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SUBPROGRAM PI_RunDriver +FEATURES + inp1_uper : IN PARAMETER DataView::MyInteger { + Taste::encoding => UPER; + }; + inp2_native : IN PARAMETER DataView::MyInteger { + Taste::encoding => ACN; + }; + outp1_native : OUT PARAMETER DataView::MyInteger { + Taste::encoding => ACN; + }; + outp2_uper : OUT PARAMETER DataView::MyInteger { + Taste::encoding => UPER; + }; +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_RunDriver; + +SUBPROGRAM IMPLEMENTATION PI_RunDriver.others +END PI_RunDriver.others; + +END interfaceview::FV::BlackBox; + +PACKAGE interfaceview::FV::Caller_in_C +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_RunDriver +FEATURES + inp1_uper : IN PARAMETER DataView::MyInteger { + Taste::encoding => UPER; + }; + inp2_native : IN PARAMETER DataView::MyInteger { + Taste::encoding => ACN; + }; + outp1_native : OUT PARAMETER DataView::MyInteger { + Taste::encoding => ACN; + }; + outp2_uper : OUT PARAMETER DataView::MyInteger { + Taste::encoding => UPER; + }; +END RI_RunDriver; + +SUBPROGRAM IMPLEMENTATION RI_RunDriver.others +END RI_RunDriver.others; + +END interfaceview::FV::Caller_in_C; + +PACKAGE interfaceview::IV +PUBLIC + +WITH interfaceview::FV::Caller_in_Ada; +WITH interfaceview::FV::BlackBox; +WITH interfaceview::FV::Caller_in_C; +WITH interfaceview::FV; +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SYSTEM Caller_in_Ada +FEATURES + PI_pulse : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Caller_in_Ada::PI_pulse.others { + Taste::coordinates => "587 334"; + Taste::RCMoperationKind => cyclic; + Taste::RCMperiod => 1000 ms; + Taste::Deadline => 0 ms; + Taste::InterfaceName => "pulse"; + }; + RI_RunDriver : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::BlackBox::PI_RunDriver.others { + Taste::coordinates => "1302 384"; + Taste::RCMoperationKind => unprotected; + Taste::InterfaceName => "RunDriver"; + Taste::labelInheritance => "true"; + }; +PROPERTIES + Source_Language => (Ada); +END Caller_in_Ada; + +SYSTEM IMPLEMENTATION Caller_in_Ada.others +SUBCOMPONENTS + pulse_impl : SUBPROGRAM interfaceview::FV::Caller_in_Ada::PI_pulse.others { + Compute_Execution_Time => 0 ms .. 0 ms; + }; +CONNECTIONS + OpToPICnx_pulse_impl : SUBPROGRAM ACCESS pulse_impl -> PI_pulse; +END Caller_in_Ada.others; + +SYSTEM BlackBox +FEATURES + PI_RunDriver : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::BlackBox::PI_RunDriver.others { + Taste::coordinates => "1872 494"; + Taste::RCMoperationKind => unprotected; + Taste::RCMperiod => 0 ms; + Taste::Deadline => 0 ms; + Taste::InterfaceName => "RunDriver"; + }; +PROPERTIES + Source_Language => (Blackbox_device); +END BlackBox; + +SYSTEM IMPLEMENTATION BlackBox.others +SUBCOMPONENTS + RunDriver_impl : SUBPROGRAM interfaceview::FV::BlackBox::PI_RunDriver.others { + Compute_Execution_Time => 0 ms .. 0 ms; + }; +CONNECTIONS + OpToPICnx_RunDriver_impl : SUBPROGRAM ACCESS RunDriver_impl -> PI_RunDriver; +END BlackBox.others; + +SYSTEM Caller_in_C +FEATURES + PI_pulse : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Caller_in_C::PI_pulse.others { + Taste::coordinates => "576 1142"; + Taste::RCMoperationKind => cyclic; + Taste::RCMperiod => 1000 ms; + Taste::Deadline => 0 ms; + Taste::InterfaceName => "pulse"; + }; + RI_RunDriver : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::BlackBox::PI_RunDriver.others { + Taste::coordinates => "1338 1189"; + Taste::RCMoperationKind => unprotected; + Taste::InterfaceName => "RunDriver"; + Taste::labelInheritance => "true"; + }; +PROPERTIES + Source_Language => (C); +END Caller_in_C; + +SYSTEM IMPLEMENTATION Caller_in_C.others +SUBCOMPONENTS + pulse_impl : SUBPROGRAM interfaceview::FV::Caller_in_C::PI_pulse.others { + Compute_Execution_Time => 0 ms .. 0 ms; + }; +CONNECTIONS + OpToPICnx_pulse_impl : SUBPROGRAM ACCESS pulse_impl -> PI_pulse; +END Caller_in_C.others; + +SYSTEM interfaceview +END interfaceview; + +SYSTEM IMPLEMENTATION interfaceview.others +SUBCOMPONENTS + Caller_in_Ada : SYSTEM interfaceview::IV::Caller_in_Ada.others { + Taste::coordinates => "587 243 1302 896"; + }; + BlackBox : SYSTEM interfaceview::IV::BlackBox.others { + Taste::coordinates => "1872 359 2688 1008"; + }; + Caller_in_C : SYSTEM interfaceview::IV::Caller_in_C.others { + Taste::coordinates => "576 1037 1338 1690"; + }; +CONNECTIONS + BlackBox_RunDriver_Caller_in_Ada_RunDriver : SUBPROGRAM ACCESS BlackBox.PI_RunDriver -> Caller_in_Ada.RI_RunDriver { + Taste::coordinates => "1302 384 1579 384 1579 494 1872 494"; + }; + BlackBox_RunDriver_Caller_in_C_RunDriver : SUBPROGRAM ACCESS BlackBox.PI_RunDriver -> Caller_in_C.RI_RunDriver { + Taste::coordinates => "1338 1189 1597 1189 1597 494 1872 494"; + }; +END interfaceview.others; + +PROPERTIES + Taste::dataView => ("DataView"); + Taste::dataViewPath => ("DataView.aadl"); + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "1.3.17"; +END interfaceview::IV; + +PACKAGE interfaceview::FV +PUBLIC + +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +END interfaceview::FV; + diff --git a/test/Demo_Blackbox/Makefile b/test/Demo_Blackbox/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..8c2d3c92e57d55b0bc580a1a6f91bc4465fffe67 --- /dev/null +++ b/test/Demo_Blackbox/Makefile @@ -0,0 +1,53 @@ +KAZOO=../../kazoo + +all: c ada + +ada: test-parse-ada + cp caller_in_c/caller_in_c.c output.ada/caller_in_c/C/src + cp caller_in_ada/caller_in_ada.adb output.ada/caller_in_ada/Ada/src + cp blackbox/blackbox.c output.ada/blackbox/Blackbox_C/src + make -C output.ada + +c: test-parse-c # Polyorb_HI_C output + cp caller_in_c/caller_in_c.c output.pohic/caller_in_c/C/src + cp caller_in_ada/caller_in_ada.adb output.pohic/caller_in_ada/Ada/src + cp blackbox/blackbox.c output.pohic/blackbox/Blackbox_C/src + $(MAKE) -C output.pohic + +test-parse-ada: clean-ada + $(KAZOO) --gw \ + -o output.ada \ + --glue \ + --debug + +test-parse-c: clean-c + $(KAZOO) -p --gw \ + -o output.pohic \ + --glue --debug +buildsupport_pohic: + buildsupport -o output.buildsupport.pohic -p --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl + +buildsupport_pohiada: + buildsupport -o output.buildsupport.ada --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl + +gdb: clean + gdb --args $(KAZOO) --gw \ + -o output.pohic \ + --glue \ + --debug + +clean-ada: + rm -rf output.ada + +clean-c: + rm -rf output.pohic + +skeletons: + $(KAZOO) -p --gw --glue -o code && make -C code dataview + +clean-skeletons: + rm -rf code + +clean: clean-ada clean-c clean-skeletons + +.PHONY: clean clean-ada clean-c test-parse-ada gdb test-parse-c buildsupport_pohic buildsupport_pohiada c skeletons clean-skeletons diff --git a/test/Demo_Blackbox/README b/test/Demo_Blackbox/README new file mode 100644 index 0000000000000000000000000000000000000000..16cdc08ea7f5262446177682cd5c604f5357dc21 --- /dev/null +++ b/test/Demo_Blackbox/README @@ -0,0 +1,8 @@ +Demo_BlackBox + +This demo shows how to use blackbox devices with parameters encoded in ACN and uPER +The BB device parameters are received in binary format (not decoded) and can be sent as is to the physical device. +The interface to the BB Device is synchronous (unprotected). It could be asynchronous... +There are two callers, one in C and one in Ada, and the build is done for both runtimes (C and Ada) + + diff --git a/test/Demo_Blackbox/blackbox/blackbox.c b/test/Demo_Blackbox/blackbox/blackbox.c new file mode 100644 index 0000000000000000000000000000000000000000..7bca57ab72fe7fba07b5326ac6cbc48ae541a1b4 --- /dev/null +++ b/test/Demo_Blackbox/blackbox/blackbox.c @@ -0,0 +1,24 @@ +/* Functions to be filled by the user (never overwritten by buildsupport tool) */ + +#include "blackbox.h" +#include +#include + + +void init_blackbox() +{ + printf ("[blackbox] startup\n"); +} + +void blackbox_RunDriver + (const char *IN_inp1_uper, size_t IN_inp1_uper_len, + const char *IN_inp2_native, size_t IN_inp2_native_len, + char *OUT_outp1_native, size_t *OUT_outp1_native_len, + char *OUT_outp2_uper, size_t *OUT_outp2_uper_len) +{ + memcpy(OUT_outp1_native, IN_inp2_native, IN_inp2_native_len); + memcpy(OUT_outp2_uper, IN_inp1_uper, IN_inp1_uper_len); + *OUT_outp1_native_len = IN_inp2_native_len; + *OUT_outp2_uper_len = IN_inp1_uper_len; +} + diff --git a/test/Demo_Blackbox/build-script.sh b/test/Demo_Blackbox/build-script.sh new file mode 100755 index 0000000000000000000000000000000000000000..3e7960db0f4002a327f56b630f1ecaadec0dba5a --- /dev/null +++ b/test/Demo_Blackbox/build-script.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# This script will build your TASTE system. + +# You must check it before running it: it may need to be adapted to your context: +# 1) You may need to fix some paths and filenames (path to interface/deployment views) +# 2) You may need to specify additional paths for the compiler to find .h file +# (e.g. "export C_INCLUDE_PATH=/usr/include/xenomai/analogy/:$C_INCLUDE_PATH") +# 3) You may need to link with pre-built libraries, using the -l option +# (e.g. -l /usr/lib/libanalogy.a,/usr/lib/librtdm.a) +# 4) You may need to change the runtime (add -p flag to select PolyORB-HI-C) +# etc. + +# Note: TASTE will not overwrite your changes - if you need to update some parts +# you will have to merge the changes with the newly-created "build-script.new.sh" file. + +mkdir -p .cache +export PROJECT_CACHE=$HOME/.taste_AST_cache + +if [ -z "$DEPLOYMENTVIEW" ] +then + DEPLOYMENTVIEW=DeploymentView.aadl +fi + +SKELS="./" + +cd "$SKELS" +rm -f caller_in_ada.zip +zip caller_in_ada caller_in_ada/* +rm -f blackbox.zip +zip blackbox blackbox/* +rm -f caller_in_c.zip +zip caller_in_c caller_in_c/* +cd "$OLDPWD" + +[ ! -z "$CLEANUP" ] && rm -rf binary* + +echo 'Building the system with the Ada runtime (add -p in the build script to replace with C)' +assert-builder-ocarina.py \ + -f \ + -g \ + --aadlv2 \ + --keep-case \ + --interfaceView InterfaceView.aadl \ + --deploymentView "$DEPLOYMENTVIEW" \ + -o binary.ada \ + --subAda caller_in_ada:"$SKELS"/caller_in_ada.zip \ + --subC blackbox:"$SKELS"/blackbox.zip \ + --subC caller_in_c:"$SKELS"/caller_in_c.zip + +echo 'Building the system with the C runtime' +assert-builder-ocarina.py \ + -f \ + -g -p \ + --aadlv2 \ + --keep-case \ + --interfaceView InterfaceView.aadl \ + --deploymentView "$DEPLOYMENTVIEW" \ + -o binary.pohic \ + --subAda caller_in_ada:"$SKELS"/caller_in_ada.zip \ + --subC blackbox:"$SKELS"/blackbox.zip \ + --subC caller_in_c:"$SKELS"/caller_in_c.zip diff --git a/test/Demo_Blackbox/caller_in_ada/caller_in_ada.adb b/test/Demo_Blackbox/caller_in_ada/caller_in_ada.adb new file mode 100644 index 0000000000000000000000000000000000000000..d1c4f9c4117490af93eb5c62c095f8b9e2b67f79 --- /dev/null +++ b/test/Demo_Blackbox/caller_in_ada/caller_in_ada.adb @@ -0,0 +1,48 @@ +-- User implementation of the caller_in_ada function +-- This file will never be overwritten once edited and modified +-- Only the interface of functions is regenerated (in the .ads file) +with adaasn1rtl; +use adaasn1rtl; + +with taste_dataview; +use taste_dataview; + +with system.io; + +with interfaces; +use interfaces; + +package body caller_in_ada is + i1: asn1sccMyInteger := 0; + i2: asn1SccMyInteger := 1; + o1: asn1SccMyInteger; + o2: asn1SccMyInteger; + + + --------------------------------------------------------- + -- Provided interface "pulse" + --------------------------------------------------------- + procedure pulse is + begin + + RunDriver(i1, i2, o1, o2); + system.io.put("[Ada] i1="); + system.io.put(asn1sccMyInteger'image(i1)); + system.io.put(" i2="); + system.io.put(asn1sccMyInteger'image(i2)); + system.io.put(" o1="); + system.io.put(asn1sccMyInteger'image(o1)); + system.io.put(" o2="); + system.io.put(asn1sccMyInteger'image(o2)); + if i1 /= o2 or i2 /= o1 then + system.io.put_line("[...ERROR!"); + else system.io.put_line("...OK"); + end if; + i1 := i1 + 1; + i2 := i2 + 1; + + end pulse; + begin + system.io.put_line("[Ada] startup"); + +end caller_in_ada; diff --git a/test/Demo_Blackbox/caller_in_c/caller_in_c.c b/test/Demo_Blackbox/caller_in_c/caller_in_c.c new file mode 100644 index 0000000000000000000000000000000000000000..603804fb51f4cd1388130402dab4fe1759f67f27 --- /dev/null +++ b/test/Demo_Blackbox/caller_in_c/caller_in_c.c @@ -0,0 +1,27 @@ +/* Functions to be filled by the user (never overwritten by buildsupport tool) */ + +#include "caller_in_c.h" +#include + +void caller_in_c_startup() +{ + printf("[C] startup\n"); +} + +void caller_in_c_PI_pulse() +{ + static asn1SccMyInteger i1=0, i2=1, o1, o2; + + caller_in_c_RI_RunDriver(&i1, &i2, &o1, &o2); + + printf ("[C] i1 = %lld, i2 = %lld, o1 = %lld, o2 = %lld", i1,i2,o1,o2); + if (i1 != o2 || i2 != o1) { + printf ("... ERROR!\n"); + exit(-1); + } + else printf("...OK\n"); + i1++; + i2++; + +} +