diff --git a/Demo_DLL/.gitignore b/Demo_DLL/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..67a21505fb1412e02025853ef9bd1b405d3750fb --- /dev/null +++ b/Demo_DLL/.gitignore @@ -0,0 +1,2 @@ +simple_c_function.zip +DataView.aadl diff --git a/Demo_DLL/D_view.aadl b/Demo_DLL/D_view.aadl new file mode 100644 index 0000000000000000000000000000000000000000..e3c4e6fc956af0a89b8a7e78f1a07cb41b0b5ecb --- /dev/null +++ b/Demo_DLL/D_view.aadl @@ -0,0 +1,237 @@ +-------------------------------------------------------- +--! File generated by asn2aadl v2.1.2: DO NOT EDIT ! +-------------------------------------------------------- + +package DataView + +public + +DATA T_Int8 +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/tmp/uniqhomeasserttool-srctestSuitesRegression_AADLv2Demo_CInterfaceView.aadl/dataview-uniq.asn"); + Ada_Package_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 B; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-Int8"; + -- what kind of type is this? + assert_properties::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 => (data ASSERT_Types::Stream_Element); +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::uint32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_Int8_Buffer.impl; + +DATA T_Boolean +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/tmp/uniqhomeasserttool-srctestSuitesRegression_AADLv2Demo_CInterfaceView.aadl/dataview-uniq.asn"); + Ada_Package_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 B; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-Boolean"; + -- what kind of type is this? + assert_properties::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 => (data ASSERT_Types::Stream_Element); +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::uint32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_Boolean_Buffer.impl; + +DATA T_Int32 +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/tmp/uniqhomeasserttool-srctestSuitesRegression_AADLv2Demo_CInterfaceView.aadl/dataview-uniq.asn"); + Ada_Package_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 B; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-Int32"; + -- what kind of type is this? + assert_properties::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 => (data ASSERT_Types::Stream_Element); +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::uint32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_Int32_Buffer.impl; + +DATA MyInteger +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/tmp/uniqhomeasserttool-srctestSuitesRegression_AADLv2Demo_CInterfaceView.aadl/dataview-uniq.asn"); + Ada_Package_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 B; + -- name of the corresponding data type in the source file: + Type_Source_Name => "MyInteger"; + -- what kind of type is this? + assert_properties::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 => (data ASSERT_Types::Stream_Element); +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::uint32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END MyInteger_Buffer.impl; + +DATA T_UInt8 +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/tmp/uniqhomeasserttool-srctestSuitesRegression_AADLv2Demo_CInterfaceView.aadl/dataview-uniq.asn"); + Ada_Package_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 B; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-UInt8"; + -- what kind of type is this? + assert_properties::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 => (data ASSERT_Types::Stream_Element); +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::uint32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_UInt8_Buffer.impl; + +DATA T_UInt32 +PROPERTIES + -- name of the ASN.1 source file: + Source_Text => ("/tmp/uniqhomeasserttool-srctestSuitesRegression_AADLv2Demo_CInterfaceView.aadl/dataview-uniq.asn"); + Ada_Package_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 B; + -- name of the corresponding data type in the source file: + Type_Source_Name => "T-UInt32"; + -- what kind of type is this? + assert_properties::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 => (data ASSERT_Types::Stream_Element); +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::uint32; +PROPERTIES + Data_Model::Data_Representation => Struct; +END T_UInt32_Buffer.impl; + +end DataView; diff --git a/Demo_DLL/DataView.asn b/Demo_DLL/DataView.asn new file mode 100644 index 0000000000000000000000000000000000000000..a9187a0521df2405fc3e894d05c4802c4a960e73 --- /dev/null +++ b/Demo_DLL/DataView.asn @@ -0,0 +1,7 @@ +DataView DEFINITIONS ::= +BEGIN + +MyInteger ::= INTEGER (0..65535) + +END + diff --git a/Demo_DLL/DeploymentView.aadl b/Demo_DLL/DeploymentView.aadl new file mode 100644 index 0000000000000000000000000000000000000000..64c6e6d14eed8f7fd9d3421120b095e36eb24b02 --- /dev/null +++ b/Demo_DLL/DeploymentView.aadl @@ -0,0 +1,68 @@ +--------------------------------------------------- +-- AADL2.0 +-- TASTE +-- +-- +--------------------------------------------------- + +PACKAGE deploymentview::DV::obj75 +PUBLIC + +WITH Taste; +WITH Deployment; +WITH TASTE_DV_Properties; +PROCESS demo_c +END demo_c; + +PROCESS IMPLEMENTATION demo_c.others +END demo_c.others; + +END deploymentview::DV::obj75; + +PACKAGE deploymentview::DV +PUBLIC + +WITH ocarina_processors_x86; +WITH deploymentview::DV::obj75; +WITH Taste; +WITH Deployment; +WITH interfaceview::IV; +WITH TASTE_DV_Properties; +SYSTEM obj75 +END obj75; + +SYSTEM IMPLEMENTATION obj75.others +SUBCOMPONENTS + IV_Simple_C_Function : SYSTEM interfaceview::IV::Simple_C_Function.others { + Taste::coordinates => "1161 619 1727 810"; + Taste::FunctionName => "Simple_C_Function"; + }; + demo_c : PROCESS deploymentview::DV::obj75::demo_c.others { + Taste::coordinates => "1019 511 1928 873"; + Deployment::Port_Number => 0; + }; + p : PROCESSOR ocarina_processors_x86::x86.linux_dll { + Taste::coordinates => "890 391 2002 919"; + }; +PROPERTIES + Taste::APLC_Binding => (reference (demo_c)) APPLIES TO IV_Simple_C_Function; + Actual_Processor_Binding => (reference (p)) APPLIES TO demo_c; +END obj75.others; + +SYSTEM deploymentview +END deploymentview; + +SYSTEM IMPLEMENTATION deploymentview.others +SUBCOMPONENTS + obj75 : SYSTEM obj75.others { + Taste::coordinates => "545 244 2768 1299"; + }; + interfaceview : SYSTEM interfaceview::IV::interfaceview.others; +END deploymentview.others; + +PROPERTIES + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "1.3.18"; + Taste::interfaceView => "InterfaceView.aadl"; + Taste::HWLibraries => ("~/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl"); +END deploymentview::DV; diff --git a/Demo_DLL/InterfaceView.aadl b/Demo_DLL/InterfaceView.aadl new file mode 100644 index 0000000000000000000000000000000000000000..56272313fe04004d82ac39c50912b22cd2b05766 --- /dev/null +++ b/Demo_DLL/InterfaceView.aadl @@ -0,0 +1,78 @@ +--------------------------------------------------- +-- AADL2.0 +-- TASTE +-- +-- +--------------------------------------------------- + +PACKAGE interfaceview::FV::Simple_C_Function +PUBLIC + +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SUBPROGRAM PI_cyclic_operation +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_cyclic_operation; + +SUBPROGRAM IMPLEMENTATION PI_cyclic_operation.others +END PI_cyclic_operation.others; + +END interfaceview::FV::Simple_C_Function; + +PACKAGE interfaceview::IV +PUBLIC + +WITH interfaceview::FV::Simple_C_Function; +WITH interfaceview::FV; +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SYSTEM Simple_C_Function +FEATURES + PI_cyclic_operation : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Simple_C_Function::PI_cyclic_operation.others { + Taste::coordinates => "1042 584"; + Taste::RCMoperationKind => cyclic; + Taste::RCMperiod => 2000 ms; + Taste::Deadline => 2000 ms; + Taste::InterfaceName => "cyclic_operation"; + }; +PROPERTIES + Source_Language => (C); +END Simple_C_Function; + +SYSTEM IMPLEMENTATION Simple_C_Function.others +SUBCOMPONENTS + cyclic_operation_impl : SUBPROGRAM interfaceview::FV::Simple_C_Function::PI_cyclic_operation.others { + Compute_Execution_Time => 0 ms .. 2000 ms; + }; +CONNECTIONS + OpToPICnx_cyclic_operation_impl : SUBPROGRAM ACCESS cyclic_operation_impl -> PI_cyclic_operation; +END Simple_C_Function.others; + +SYSTEM interfaceview +END interfaceview; + +SYSTEM IMPLEMENTATION interfaceview.others +SUBCOMPONENTS + Simple_C_Function : SYSTEM interfaceview::IV::Simple_C_Function.others { + Taste::coordinates => "1042 432 1706 1121"; + }; +END interfaceview.others; + +PROPERTIES + Taste::dataView => ("DataView"); + Taste::dataViewPath => ("DataView.aadl"); + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "1.3.18"; +END interfaceview::IV; + +PACKAGE interfaceview::FV +PUBLIC + +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +END interfaceview::FV; + diff --git a/Demo_DLL/README.md b/Demo_DLL/README.md new file mode 100644 index 0000000000000000000000000000000000000000..56a2558cb8c2096214bd1a63a569e9daa79bced6 --- /dev/null +++ b/Demo_DLL/README.md @@ -0,0 +1,7 @@ +Demo C +------ + +This is the simplest possible system you can do in TASTE: +a single periodic C function. + +This build generates a dynamic library, its main entrypoint is aadl_start diff --git a/Demo_DLL/build-script.sh b/Demo_DLL/build-script.sh new file mode 100755 index 0000000000000000000000000000000000000000..4b6317269ef4adc4aa6f80cb97a2d7ca7c7f848a --- /dev/null +++ b/Demo_DLL/build-script.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +mkdir -p .cache +export PROJECT_CACHE=$(pwd)/.cache + +rm -f simple_c_function.zip +zip simple_c_function simple_c_function/* + +[ ! -z "$CLEANUP" ] && rm -rf binary.* + +# C runtime +assert-builder-ocarina.py \ + -f \ + -p \ + --aadlv2 \ + --keep-case \ + --interfaceView InterfaceView.aadl \ + --deploymentView DeploymentView.aadl \ + -o binary.linux.pohic \ + --subC simple_c_function:simple_c_function.zip diff --git a/Demo_DLL/regression.py b/Demo_DLL/regression.py new file mode 100755 index 0000000000000000000000000000000000000000..3755cfdf4e27c0a39de2551423ce5625ea0f645d --- /dev/null +++ b/Demo_DLL/regression.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python2 +import sys + +timeout = 5 + +binaries = [ + "binary.linux.ada/binaries/demo_c", + "binary.linux.pohic/binaries/demo_c"] + +expected = [ + '\[Startup\] Expected output: "Hello, world..." every 2 seconds', + 'Hello, world...', + 'Hello, world...', + 'Hello, world...', + 'Hello, world...' +] + +sys.path.append("..") +import commonRegression +result = commonRegression.test(binaries, expected, timeout) +sys.exit(result) diff --git a/Demo_DLL/simple_c_function/simple_c_function.c b/Demo_DLL/simple_c_function/simple_c_function.c new file mode 100644 index 0000000000000000000000000000000000000000..7e4c78169436ad49b3b25774938dd0907a77a693 --- /dev/null +++ b/Demo_DLL/simple_c_function/simple_c_function.c @@ -0,0 +1,28 @@ +/* Functions to be filled by the user (never overwritten by buildsupport tool) */ + +#include "simple_c_function.h" +#include +#include +#include + +void myhandler (); + +void simple_c_function_startup() +{ + /* Write your initialization code here, + but do not make any call to a required interface!! */ + printf ("[Startup] Expected output: \"Hello, world...\" every 2 seconds\n"); + (void) signal (SIGINT, myhandler); +} + +void myhandler () +{ + printf ("Ctrl-C hit!\n"); + exit (0); +} + +void simple_c_function_PI_cyclic_operation() +{ + printf ("Hello, world...\n"); +} + diff --git a/Demo_DLL/simple_c_function/simple_c_function.h b/Demo_DLL/simple_c_function/simple_c_function.h new file mode 100644 index 0000000000000000000000000000000000000000..2259f0fa370585e99050848faef66ac4e40301d6 --- /dev/null +++ b/Demo_DLL/simple_c_function/simple_c_function.h @@ -0,0 +1,13 @@ +/* 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_simple_c_function__ +#define __USER_CODE_H_simple_c_function__ + +void simple_c_function_startup(); + +void simple_c_function_PI_cyclic_operation(); + + +#endif