From d57839227d8aeadc2a102734db555dbb8379b818 Mon Sep 17 00:00:00 2001 From: Maxime Perrotin Date: Mon, 26 Aug 2019 09:24:55 +0200 Subject: [PATCH] Add Demo_Distrib --- test/Demo_Distrib/DataView.aadl | 325 ++++++++++++++++++++++++++ test/Demo_Distrib/DataView.asn | 5 + test/Demo_Distrib/DeploymentView.aadl | 176 ++++++++++++++ test/Demo_Distrib/InterfaceView.aadl | 166 +++++++++++++ test/Demo_Distrib/Makefile | 54 +++++ test/Demo_Distrib/README | 6 + test/Demo_Distrib/build-script.sh | 24 ++ test/Demo_Distrib/regression.py | 39 ++++ test/Demo_Distrib/skels/a/a.c | 27 +++ test/Demo_Distrib/skels/a/a.h | 19 ++ test/Demo_Distrib/skels/b/b.c | 19 ++ test/Demo_Distrib/skels/b/b.h | 17 ++ 12 files changed, 877 insertions(+) create mode 100644 test/Demo_Distrib/DataView.aadl create mode 100644 test/Demo_Distrib/DataView.asn create mode 100644 test/Demo_Distrib/DeploymentView.aadl create mode 100644 test/Demo_Distrib/InterfaceView.aadl create mode 100644 test/Demo_Distrib/Makefile create mode 100644 test/Demo_Distrib/README create mode 100755 test/Demo_Distrib/build-script.sh create mode 100755 test/Demo_Distrib/regression.py create mode 100644 test/Demo_Distrib/skels/a/a.c create mode 100644 test/Demo_Distrib/skels/a/a.h create mode 100644 test/Demo_Distrib/skels/b/b.c create mode 100644 test/Demo_Distrib/skels/b/b.h diff --git a/test/Demo_Distrib/DataView.aadl b/test/Demo_Distrib/DataView.aadl new file mode 100644 index 0000000..8777ac9 --- /dev/null +++ b/test/Demo_Distrib/DataView.aadl @@ -0,0 +1,325 @@ +-------------------------------------------------------- +--! File generated by asn2aadl v2.1.38: DO NOT EDIT ! +-------------------------------------------------------- +--! InputASN1FileChecksum:0e33b3111ca43a9af18489d279ecae68:/home/taste/tool-src/kazoo/test/Demo_Distrib/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 My_Integer +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/home/taste/tool-src/kazoo/test/Demo_Distrib/DataView.asn"); + TASTE::Ada_Package_Name => "DataView"; + Deployment::ASN1_Module_Name => "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 => "My-Integer"; + TASTE::Position_In_File => [ line => 3 ; column => 1 ; ]; + -- what kind of type is this? + TASTE::ASN1_Basic_Type =>aINTEGER; +END My_Integer; + +DATA IMPLEMENTATION My_Integer.impl +END My_Integer.impl; + +DATA My_Integer_Buffer_Max +END My_Integer_Buffer_Max; + +DATA IMPLEMENTATION My_Integer_Buffer_Max.impl + -- Buffer to hold a marshalled data of type My_Integer +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 My_Integer_Buffer_Max.impl; + +DATA My_Integer_Buffer +END My_Integer_Buffer; + +DATA IMPLEMENTATION My_Integer_Buffer.impl + -- Buffer to hold a marshalled data of type My_Integer +SUBCOMPONENTS + Buffer : data My_Integer_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 My_Integer_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 + My_Integer : DATA My_Integer.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; +end DataView; diff --git a/test/Demo_Distrib/DataView.asn b/test/Demo_Distrib/DataView.asn new file mode 100644 index 0000000..28e8225 --- /dev/null +++ b/test/Demo_Distrib/DataView.asn @@ -0,0 +1,5 @@ +DataView DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +My-Integer ::= INTEGER (0 .. 65535) + +END diff --git a/test/Demo_Distrib/DeploymentView.aadl b/test/Demo_Distrib/DeploymentView.aadl new file mode 100644 index 0000000..5931e6e --- /dev/null +++ b/test/Demo_Distrib/DeploymentView.aadl @@ -0,0 +1,176 @@ +--------------------------------------------------- +-- AADL2.2 +-- TASTE type deploymentview +-- +-- generated code: do not edit +--------------------------------------------------- + +PACKAGE deploymentview::DV::pb1 +PUBLIC + +WITH ocarina_buses; +WITH ocarina_drivers; +WITH Taste; +WITH Deployment; +WITH TASTE_DV_Properties; +PROCESS pinger +END pinger; + +PROCESS IMPLEMENTATION pinger.others +END pinger.others; + +DEVICE ethernet1 +EXTENDS ocarina_drivers::generic_sockets_ip +FEATURES + link : REFINED TO REQUIRES BUS ACCESS ocarina_buses::ip.i { + Taste::coordinates => "729 966"; + }; +PROPERTIES + Taste::Interface_Coordinates => "1145 1062" APPLIES TO link; + Deployment::Configuration => "{devname ""eth0"", address ""127.0.0.1"", version ipv4, port 5115 }"; + Deployment::Config => "~/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/ip.asn"; + Deployment::Version => "0.1beta"; +END ethernet1; + +DEVICE IMPLEMENTATION ethernet1.others +EXTENDS ocarina_drivers::generic_sockets_ip.pohic +END ethernet1.others; + +END deploymentview::DV::pb1; + +PACKAGE deploymentview::DV::pb2 +PUBLIC + +WITH ocarina_buses; +WITH ocarina_drivers; +WITH Taste; +WITH Deployment; +WITH TASTE_DV_Properties; +PROCESS pingee +END pingee; + +PROCESS IMPLEMENTATION pingee.others +END pingee.others; + +DEVICE ethernet2 +EXTENDS ocarina_drivers::generic_sockets_ip +FEATURES + link : REFINED TO REQUIRES BUS ACCESS ocarina_buses::ip.i { + Taste::coordinates => "2276 780"; + }; +PROPERTIES + Taste::Interface_Coordinates => "1710 1062" APPLIES TO link; + Deployment::Configuration => "{devname ""eth0"", address ""127.0.0.1"", version ipv4, port 5116 }"; + Deployment::Config => "~/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/ip.asn"; + Deployment::Version => "0.1beta"; +END ethernet2; + +DEVICE IMPLEMENTATION ethernet2.others +EXTENDS ocarina_drivers::generic_sockets_ip.pohic +END ethernet2.others; + +END deploymentview::DV::pb2; + +PACKAGE deploymentview::DV +PUBLIC + +WITH interfaceview::IV::A; +WITH ocarina_processors_x86; +WITH deploymentview::DV::pb1; +WITH interfaceview::IV::B; +WITH deploymentview::DV::pb2; +WITH ocarina_buses; +WITH Taste; +WITH Deployment; +WITH interfaceview::IV; +WITH TASTE_DV_Properties; +SYSTEM pb1 +FEATURES + ethernet1_eth0 : REQUIRES BUS ACCESS ocarina_buses::ip.i; +END pb1; + +SYSTEM IMPLEMENTATION pb1.others +SUBCOMPONENTS + IV_A : SYSTEM interfaceview::IV::A::A.others { + Taste::FunctionName => "A"; + }; + pinger : PROCESS deploymentview::DV::pb1::pinger.others { + Taste::coordinates => "420 296 680 747"; + Deployment::Port_Number => 0; + }; + p1 : PROCESSOR ocarina_processors_x86::x86.linux { + Taste::coordinates => "391 255 719 754"; + }; + ethernet1 : DEVICE deploymentview::DV::pb1::ethernet1.others { + Taste::coordinates => "457 793 850 966"; + }; +CONNECTIONS + ethernet1_eth0_link : BUS ACCESS ethernet1_eth0 -> ethernet1.link; +PROPERTIES + Taste::APLC_Binding => (reference (pinger)) APPLIES TO IV_A; + Actual_Processor_Binding => (reference (p1)) APPLIES TO pinger; + Actual_Processor_Binding => (reference (p1)) APPLIES TO ethernet1; +END pb1.others; + +SYSTEM pb2 +FEATURES + ethernet2_eth0 : REQUIRES BUS ACCESS ocarina_buses::ip.i; +END pb2; + +SYSTEM IMPLEMENTATION pb2.others +SUBCOMPONENTS + IV_B : SYSTEM interfaceview::IV::B::B.others { + Taste::FunctionName => "B"; + }; + pingee : PROCESS deploymentview::DV::pb2::pingee.others { + Taste::coordinates => "2269 363 2584 708"; + Deployment::Port_Number => 0; + }; + p2 : PROCESSOR ocarina_processors_x86::x86.linux { + Taste::coordinates => "2249 307 2591 725"; + }; + ethernet2 : DEVICE deploymentview::DV::pb2::ethernet2.others { + Taste::coordinates => "2276 775 2726 963"; + }; +CONNECTIONS + ethernet2_eth0_link : BUS ACCESS ethernet2_eth0 -> ethernet2.link; +PROPERTIES + Taste::APLC_Binding => (reference (pingee)) APPLIES TO IV_B; + Actual_Processor_Binding => (reference (p2)) APPLIES TO pingee; + Actual_Processor_Binding => (reference (p2)) APPLIES TO ethernet2; +END pb2.others; + +SYSTEM deploymentview +END deploymentview; + +SYSTEM IMPLEMENTATION deploymentview.others +SUBCOMPONENTS + pb1 : SYSTEM pb1.others { + Taste::coordinates => "333 173 913 995"; + }; + pb2 : SYSTEM pb2.others { + Taste::coordinates => "2181 223 2864 1058"; + }; + eth0 : BUS ocarina_buses::ip.i { + Taste::coordinates => "1073 1062 1788 1282"; + }; + interfaceview : SYSTEM interfaceview::IV::interfaceview.others; +CONNECTIONS + obj1366 : BUS ACCESS eth0 -> pb1.ethernet1_eth0 { + Taste::coordinates => "729 966 729 1003 1145 1003 1145 1062"; + }; + obj1487 : BUS ACCESS eth0 -> pb2.ethernet2_eth0 { + Taste::coordinates => "2276 780 1710 780 1710 1062"; + }; +PROPERTIES + Actual_Connection_Binding => (reference (eth0)) APPLIES TO interfaceview.A_PI_ping_B_RI_pong; + Actual_Connection_Binding => (reference (eth0)) APPLIES TO interfaceview.B_PI_ping_A_RI_pong; +END deploymentview.others; + +PROPERTIES + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "2.2"; + Taste::interfaceView => "InterfaceView.aadl"; + Taste::HWLibraries => ("/home/taste/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl"); +END deploymentview::DV; + diff --git a/test/Demo_Distrib/InterfaceView.aadl b/test/Demo_Distrib/InterfaceView.aadl new file mode 100644 index 0000000..194d67a --- /dev/null +++ b/test/Demo_Distrib/InterfaceView.aadl @@ -0,0 +1,166 @@ +--------------------------------------------------- +-- AADL2.2 +-- TASTE type interfaceview +-- +-- generated code: do not edit +--------------------------------------------------- + +PACKAGE interfaceview::IV::A +PUBLIC + +WITH interfaceview::IV::B; +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SUBPROGRAM PI_ping +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_ping; + +SUBPROGRAM IMPLEMENTATION PI_ping.others +PROPERTIES + Compute_Execution_Time => 0 ms .. 1000 ms; +END PI_ping.others; + +SUBPROGRAM PI_cyclic_activation +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_cyclic_activation; + +SUBPROGRAM IMPLEMENTATION PI_cyclic_activation.others +PROPERTIES + Compute_Execution_Time => 0 ms .. 1000 ms; +END PI_cyclic_activation.others; + +SUBPROGRAM RI_pong +FEATURES + p1 : IN PARAMETER DataView::My_Integer { + Taste::encoding => UPER; + }; +END RI_pong; + +SUBPROGRAM IMPLEMENTATION RI_pong.others +END RI_pong.others; + +SYSTEM A +FEATURES + PI_ping : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::A::PI_ping.others { + Taste::coordinates => "1232 1132"; + Taste::RCMoperationKind => sporadic; + Taste::RCMperiod => 1000 ms; + Taste::Deadline => 1000 ms; + Taste::InterfaceName => "ping"; + }; + PI_cyclic_activation : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::A::PI_cyclic_activation.others { + Taste::coordinates => "877 570"; + Taste::RCMoperationKind => cyclic; + Taste::RCMperiod => 2000 ms; + Taste::Deadline => 1000 ms; + Taste::InterfaceName => "cyclic_activation"; + }; + RI_pong : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::B::PI_ping.others { + Taste::coordinates => "1232 672"; + Taste::RCMoperationKind => sporadic; + Taste::InterfaceName => "pong"; + Taste::labelInheritance => "true"; + }; +PROPERTIES + Source_Language => (C); + Taste::Active_Interfaces => enabled; +END A; + +SYSTEM IMPLEMENTATION A.others +END A.others; + +END interfaceview::IV::A; + +PACKAGE interfaceview::IV::B +PUBLIC + +WITH interfaceview::IV::A; +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SUBPROGRAM PI_ping +FEATURES + p1 : IN PARAMETER DataView::My_Integer { + Taste::encoding => UPER; + }; +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_ping; + +SUBPROGRAM IMPLEMENTATION PI_ping.others +PROPERTIES + Compute_Execution_Time => 0 ms .. 1000 ms; +END PI_ping.others; + +SUBPROGRAM RI_pong +END RI_pong; + +SUBPROGRAM IMPLEMENTATION RI_pong.others +END RI_pong.others; + +SYSTEM B +FEATURES + PI_ping : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::B::PI_ping.others { + Taste::coordinates => "1781 671"; + Taste::RCMoperationKind => sporadic; + Taste::RCMperiod => 1000 ms; + Taste::Deadline => 1000 ms; + Taste::InterfaceName => "ping"; + }; + RI_pong : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::A::PI_ping.others { + Taste::coordinates => "1781 1131"; + Taste::RCMoperationKind => sporadic; + Taste::InterfaceName => "pong"; + Taste::labelInheritance => "true"; + }; +PROPERTIES + Source_Language => (C); + Taste::Active_Interfaces => enabled; +END B; + +SYSTEM IMPLEMENTATION B.others +END B.others; + +END interfaceview::IV::B; + +PACKAGE interfaceview::IV +PUBLIC + +WITH interfaceview::IV::A; +WITH interfaceview::IV::B; +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SYSTEM interfaceview +PROPERTIES + Taste::dataView => ("DataView"); + Taste::dataViewPath => ("DataView.aadl"); +END interfaceview; + +SYSTEM IMPLEMENTATION interfaceview.others +SUBCOMPONENTS + A : SYSTEM interfaceview::IV::A::A.others { + Taste::coordinates => "565 570 1232 1245"; + }; + B : SYSTEM interfaceview::IV::B::B.others { + Taste::coordinates => "1781 569 2470 1214"; + }; +CONNECTIONS + A_PI_ping_B_RI_pong : SUBPROGRAM ACCESS A.PI_ping -> B.RI_pong { + Taste::coordinates => "1781 1131 1414 1131 1414 1132 1232 1132"; + }; + B_PI_ping_A_RI_pong : SUBPROGRAM ACCESS B.PI_ping -> A.RI_pong { + Taste::coordinates => "1232 672 1414 672 1414 671 1781 671"; + }; +END interfaceview.others; + +PROPERTIES + Taste::dataView => ("DataView"); + Taste::dataViewPath => ("DataView.aadl"); + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "2.2"; +END interfaceview::IV; + diff --git a/test/Demo_Distrib/Makefile b/test/Demo_Distrib/Makefile new file mode 100644 index 0000000..9df925c --- /dev/null +++ b/test/Demo_Distrib/Makefile @@ -0,0 +1,54 @@ +KAZOO=../../kazoo + +all: c + +ada: test-parse-ada + make -C output.ada + cp skels/a/a.c output.pohic/a/C/src + cp skels/b/b.c output.pohic/b/C/src + cd output.ada/build && \ + ocarina -x main.aadl && \ + make -f Makefile.taste + +c: test-parse-c # Polyorb_HI_C output + cp skels/a/a.c output.pohic/a/C/src + cp skels/b/b.c output.pohic/b/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 -g +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_Distrib/README b/test/Demo_Distrib/README new file mode 100644 index 0000000..e39b492 --- /dev/null +++ b/test/Demo_Distrib/README @@ -0,0 +1,6 @@ +Demo_Distrib + +Tests a distributed system over two linux nodes using TCP/IP connection + +build-script.sh builds with the legacy system (buildsupport/orchestrator) +and make builds with kazoo diff --git a/test/Demo_Distrib/build-script.sh b/test/Demo_Distrib/build-script.sh new file mode 100755 index 0000000..3b125c6 --- /dev/null +++ b/test/Demo_Distrib/build-script.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +mkdir -p .cache +export PROJECT_CACHE=$HOME/.taste_AST_cache + +cd skels +rm -f a.zip +zip a a/* +rm -f b.zip +zip b b/* +cd .. + +[ ! -z "$CLEANUP" ] && rm -rf binary.linux.pohic/ + +assert-builder-ocarina.py \ + -f \ + -p \ + --aadlv2 \ + --keep-case \ + --interfaceView InterfaceView.aadl \ + --deploymentView DeploymentView.aadl \ + -o binary.linux.pohic \ + --subC a:skels/a.zip \ + --subC b:skels/b.zip diff --git a/test/Demo_Distrib/regression.py b/test/Demo_Distrib/regression.py new file mode 100755 index 0000000..1a96e07 --- /dev/null +++ b/test/Demo_Distrib/regression.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +import sys, os, subprocess +sys.path.append(os.path.abspath("..")) +import commonRegression + +timeout = 5 + +expected = [ + "\[B\] Startup", + "\[B\] ping! \(0\)", + "\[B\] ping! \(1\)", + "\[B\] ping! \(2\)", + "\[B\] ping! \(3\)", + "\[B\] ping! \(4\)", + "\[B\] ping! \(5\)", + "\[B\] ping! \(6\)", + "\[B\] ping! \(7\)", + "\[B\] ping! \(8\)", + "\[B\] ping! \(9\)", +] + +p = None +try: + p = subprocess.Popen("binary.linux.pohic/binaries/pinger", stdout=subprocess.PIPE) + if p == None: + sys.exit(1) +except: + sys.exit(1) +result=commonRegression.test( + ["binary.linux.pohic/binaries/pingee"], + expected, + timeout) +if 0!=result: + p.kill() + sys.exit(1) +p.kill() +p.wait() +commonRegression.g_child.terminate(force=True) +sys.exit(result) diff --git a/test/Demo_Distrib/skels/a/a.c b/test/Demo_Distrib/skels/a/a.c new file mode 100644 index 0000000..4c76815 --- /dev/null +++ b/test/Demo_Distrib/skels/a/a.c @@ -0,0 +1,27 @@ +/* Functions to be filled by the user (never overwritten by buildsupport tool) */ + +#include "a.h" +#include + +void a_startup() +{ + /* Write your initialization code here, + but do not make any call to a required interface!! */ + printf ("[A] Startup\n"); +} + +void a_PI_ping() +{ + printf ("[A] ping!\n"); + +} + +void a_PI_cyclic_activation() +{ + /* Write your code here! */ + static asn1SccMy_Integer value = 0; + + a_RI_pong (&value); + value ++; +} + diff --git a/test/Demo_Distrib/skels/a/a.h b/test/Demo_Distrib/skels/a/a.h new file mode 100644 index 0000000..4d18cfb --- /dev/null +++ b/test/Demo_Distrib/skels/a/a.h @@ -0,0 +1,19 @@ +/* This file was generated automatically: DO NOT MODIFY IT ! */ + +/* Declaration of the functions that have to be provided by the user */ + +#ifndef __USER_CODE_H_a__ +#define __USER_CODE_H_a__ + +#include "C_ASN1_Types.h" + +void a_startup(); + +extern void a_RI_pong(const asn1SccMy_Integer *); + +void a_PI_ping(); + +void a_PI_cyclic_activation(); + + +#endif diff --git a/test/Demo_Distrib/skels/b/b.c b/test/Demo_Distrib/skels/b/b.c new file mode 100644 index 0000000..64b5fa3 --- /dev/null +++ b/test/Demo_Distrib/skels/b/b.c @@ -0,0 +1,19 @@ +/* Functions to be filled by the user (never overwritten by buildsupport tool) */ + +#include "b.h" +#include + +void b_startup() +{ + /* Write your initialization code here, + but do not make any call to a required interface!! */ + printf ("[B] Startup\n"); +} + +void b_PI_ping(const asn1SccMy_Integer *IN_p1) +{ + /* Write your code here! */ + printf ("[B] ping! (%lld)\n", *IN_p1); + b_RI_pong(); +} + diff --git a/test/Demo_Distrib/skels/b/b.h b/test/Demo_Distrib/skels/b/b.h new file mode 100644 index 0000000..5192f62 --- /dev/null +++ b/test/Demo_Distrib/skels/b/b.h @@ -0,0 +1,17 @@ +/* This file was generated automatically: DO NOT MODIFY IT ! */ + +/* Declaration of the functions that have to be provided by the user */ + +#ifndef __USER_CODE_H_b__ +#define __USER_CODE_H_b__ + +#include "C_ASN1_Types.h" + +void b_startup(); + +void b_PI_ping(const asn1SccMy_Integer *); + +extern void b_RI_pong(); + + +#endif -- GitLab