Commit 7e5c5f96 authored by yoogx's avatar yoogx
Browse files

Merge branch 'master' of https://github.com/OpenAADL/polyorb-hi-c

parents 59965273 b2838051
...@@ -2,10 +2,11 @@ Current maintainer is ...@@ -2,10 +2,11 @@ Current maintainer is
- Jerome Hugues - Jerome Hugues
Contributors Contributors
- Raphael Defoin (2018)
- Antonia Francis (2018) - Antonia Francis (2018)
- Hariprasath Shanmugasundaram (2017) - Hariprasath Shanmugasundaram (2017)
The initial design team of PolyORB-HI/C was The initial design team of PolyORB-HI/C was
- Julien Delange (up to 2016) - Julien Delange (initial author, up to 2016)
- Jerome Hugues - Jerome Hugues
- Laurent Pautet (up to 2009) - Laurent Pautet (up to 2009)
...@@ -221,9 +221,11 @@ AC_OUTPUT([ ...@@ -221,9 +221,11 @@ AC_OUTPUT([
examples/aadlv2/file-store/Makefile examples/aadlv2/file-store/Makefile
examples/aadlv2/latency/Makefile examples/aadlv2/latency/Makefile
examples/aadlv2/rma/Makefile examples/aadlv2/rma/Makefile
examples/aadlv2/rpc/Makefile
examples/aadlv2/some-types/Makefile examples/aadlv2/some-types/Makefile
examples/aadlv2/some-types-stdint/Makefile examples/aadlv2/some-types-stdint/Makefile
examples/aadlv2/sunseeker/Makefile examples/aadlv2/sunseeker/Makefile
examples/aadlv2/torture_gqueue/Makefile
tools/Makefile tools/Makefile
tools/check-symbols/Makefile tools/check-symbols/Makefile
tools/check-symbols/examples/Makefile tools/check-symbols/examples/Makefile
......
SUBDIRS = d3.1.3-1 ping rma sunseeker producer-consumer some-types \ SUBDIRS = d3.1.3-1 ping rma sunseeker producer-consumer some-types \
some-types-stdint flight-mgmt import monitor lua cpp \ some-types-stdint flight-mgmt import monitor lua cpp \
packet-store file-store latency code_coverage packet-store file-store latency code_coverage torture_gqueue \
rpc
SAMPLE_DIR = ${shell $(CYGPATH_U) '$(OCARINA_PREFIX)/examples/ocarina/polyorb-hi-c/aadlv2'} SAMPLE_DIR = ${shell $(CYGPATH_U) '$(OCARINA_PREFIX)/examples/ocarina/polyorb-hi-c/aadlv2'}
......
#!/bin/sh
for i in "$@"
do
case $i in
--output-dir-name=*)
OUTPUT_DIR="${i#*=}" #ONLY NAME OF DIR
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
if [ -z "$OUTPUT_DIR" ]; then
OUTPUT_DIR=./gcov_output
else
OUTPUT_DIR=./$OUTPUT_DIR
fi
if (! test -d $OUTPUT_DIR )
then
echo "Missing path: $OUTPUT_DIR. Creating directory..."
mkdir $OUTPUT_DIR
fi
lcov -c -i -d . -o .coverage.base
lcov -c -d . -o .coverage.run
lcov -d . -a .coverage.base -a .coverage.run -o .coverage.total
genhtml --no-branch-coverage -o $OUTPUT_DIR .coverage.total
rm -f .coverage.base .coverage.run .coverage.total
This diff is collapsed.
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <types.h>
int16_t boolean_type_var = 0; int16_t boolean_type_var = 0;
int32_t integer_type_var = 0; int32_t integer_type_var = 0;
int64_t natural_type_var = 0;
void user_emit_boolean( int16_t* boolean) int8_t int8_type_var = 0;
int16_t int16_type_var = 0;
int32_t int32_type_var = 0;
int64_t int64_type_var = 0;
uint8_t uint8_type_var = 0;
uint16_t uint16_type_var = 0;
uint32_t uint32_type_var = 0;
uint64_t uint64_type_var = 0;
float_t float0_type_var = 0.0;
float_t float32_type_var = 0.0;
double_t float64_type_var = 0.0;
char char_type_var = 'A';
/* Macros Definition */
/* Integer */
#define EMIT_TYPE_INT(TYPE, VAR, FORMAT) \
void user_emit_##TYPE (VAR * type) \
{\
TYPE##_type_var++; \
*type = TYPE##_type_var;\
printf("Emetting integer : ");\
printf(FORMAT, *type);\
printf("\n"); \
fflush (stdout); \
}
#define RECEIVE_TYPE_INT(TYPE, VAR, FORMAT) \
void user_receive_##TYPE (VAR type)\
{\
printf("Receiving integer : ");\
printf(FORMAT, type);\
printf("\n"); \
fflush (stdout); \
}
/* Float */
#define EMIT_TYPE_FLOAT(TYPE, VAR, FORMAT) \
void user_emit_##TYPE (VAR * type) \
{\
TYPE##_type_var++; \
*type = TYPE##_type_var;\
printf("Emetting float : ");\
printf(FORMAT, *type);\
printf("\n"); \
fflush (stdout); \
}
#define RECEIVE_TYPE_FLOAT(TYPE, VAR, FORMAT) \
void user_receive_##TYPE (VAR type)\
{\
printf("Receiving float : ");\
printf(FORMAT, type);\
printf("\n"); \
fflush (stdout); \
}
/* Boolean sub case */
void user_emit_boolean(int16_t* boolean)
{ {
if (boolean_type_var == 1) if (boolean_type_var == 1)
{ {
...@@ -16,21 +85,93 @@ void user_emit_boolean( int16_t* boolean) ...@@ -16,21 +85,93 @@ void user_emit_boolean( int16_t* boolean)
} }
*boolean = boolean_type_var; *boolean = boolean_type_var;
printf ("Sending boolean : %d\n", *boolean); printf ("Sending boolean : %d\n", *boolean);
fflush (stdout);
} }
void user_receive_boolean (int16_t boolean) void user_receive_boolean (int16_t boolean)
{ {
printf ("Receiving boolean : %d\n", boolean); printf ("Receiving boolean : %d\n", boolean);
fflush (stdout);
} }
void user_emit_integer( int32_t* integer)
/* Char sub case */
void user_emit_char (char* character)
{ {
integer_type_var++;
*integer = integer_type_var; char_type_var = 'A' + ((char_type_var - 'A' +1) %26) ;
printf ("Emetting integer : %d\n", *integer); *character = (char)char_type_var;
printf ("Emetting char : %c\n", *character);
fflush (stdout);
} }
void user_receive_integer (int32_t integer) void user_receive_char (char character)
{ {
printf ("Receiving integer : %d\n", integer); printf ("Receiving char : %c\n", character);
fflush (stdout);
} }
/* Array sub case */
void user_emit_array (software__array_type* data)
{
int i;
for (i = 0; i < 16; i++)
{(*data)[i]=i;}
printf ("Emetting array\n");
fflush (stdout);
}
void user_receive_array (software__array_type data)
{
int i;
printf("Receive array: ");
for (i = 0; i < 16; i++)
{assert (data[i] == i);}
printf ("OK \n");
fflush(stdout);
}
/* Appel des fonctions */
EMIT_TYPE_INT(integer, int32_t, "%d")
RECEIVE_TYPE_INT(integer, int32_t, "%d")
EMIT_TYPE_INT(natural, int64_t, "%lld")
RECEIVE_TYPE_INT(natural, int64_t, "%lld")
EMIT_TYPE_INT(int8,int8_t, "%hhd")
RECEIVE_TYPE_INT(int8,int8_t, "%hhd")
EMIT_TYPE_INT(int16,int16_t, "%d")
RECEIVE_TYPE_INT(int16,int16_t, "%d")
EMIT_TYPE_INT(int32,int32_t, "%d")
RECEIVE_TYPE_INT(int32,int32_t, "%d")
EMIT_TYPE_INT(int64,int64_t, "%ld")
RECEIVE_TYPE_INT(int64,int64_t, "%ld")
EMIT_TYPE_INT(uint8,uint8_t, "%hhu")
RECEIVE_TYPE_INT(uint8,uint8_t, "%hhu")
EMIT_TYPE_INT(uint16,uint16_t, "%u")
RECEIVE_TYPE_INT(uint16,uint16_t, "%u")
EMIT_TYPE_INT(uint32,uint32_t,"%u")
RECEIVE_TYPE_INT(uint32,uint32_t, "%u")
EMIT_TYPE_INT(uint64,uint64_t, "%lu")
RECEIVE_TYPE_INT(uint64,uint64_t, "%lu")
EMIT_TYPE_FLOAT(float0,float_t, "%lf")
RECEIVE_TYPE_FLOAT(float0,float_t, "%lf")
EMIT_TYPE_FLOAT(float32,float_t, "%lf")
RECEIVE_TYPE_FLOAT(float32,float_t, "%lf")
EMIT_TYPE_FLOAT(float64,double_t, "%llf")
RECEIVE_TYPE_FLOAT(float64,double_t,"%llf")
package Some_types package Some_types
public public
with Software; with Software;
with Deployment; with Deployment;
with ocarina_drivers; with ocarina_drivers;
with ocarina_buses; with ocarina_buses;
--------------- ---------------
-- Processor -- -- Processor --
--------------- ---------------
processor the_processor processor the_processor
properties properties
Deployment::Execution_Platform => Native; Deployment::Execution_Platform => Native;
end the_processor; end the_processor;
--------------- ---------------
-- Processes -- -- Processes --
--------------- ---------------
process A process A
features features
Out_Boolean : out event data port Software::Boolean_Type; Out_Boolean : out event data port Software::Boolean_Type;
Out_Integer : out event data port Software::Integer_Type; Out_Integer : out event data port Software::Integer_Type;
end A; Out_Natural : out event data port Software::Natural_Type;
Out_Array : out event data port Software::Array_Type;
process implementation A.Impl
subcomponents Out_Integer_8 : out event data port Software::Integer_8_Type;
Emitter_Thread : thread Software::Emitter.Impl; Out_Integer_16 : out event data port Software::Integer_16_Type;
connections Out_Integer_32 : out event data port Software::Integer_32_Type;
port Emitter_Thread.Boolean_Source -> Out_Boolean; Out_Integer_64 : out event data port Software::Integer_64_Type;
port Emitter_Thread.Integer_Source -> Out_Integer;
end A.Impl; Out_Unsigned_8 : out event data port Software::Unsigned_8_Type;
Out_Unsigned_16 : out event data port Software::Unsigned_16_Type;
process B Out_Unsigned_32 : out event data port Software::Unsigned_32_Type;
features Out_Unsigned_64 : out event data port Software::Unsigned_64_Type;
In_Boolean : in event data port Software::Boolean_Type;
In_Integer : in event data port Software::Integer_Type; Out_Float : out event data port Software::Float_Type;
end B; Out_Float_32 : out event data port Software::Float_32_Type;
Out_Float_64 : out event data port Software::Float_64_Type;
process implementation B.Impl Out_Character : out event data port Software::Character_Type;
subcomponents
Boolean_Rcv_Thread : thread Software::Boolean_Receiver.Impl; end A;
Integer_Rcv_Thread : thread Software::Integer_Receiver.Impl;
connections process implementation A.Impl
port In_Boolean -> Boolean_Rcv_Thread.Data_Sink; subcomponents
port In_Integer -> Integer_Rcv_Thread.Data_Sink; Emitter_Thread : thread Software::Emitter.Impl;
end B.Impl; connections
port Emitter_Thread.Boolean_Source -> Out_Boolean;
process singleProcess port Emitter_Thread.Integer_Source -> Out_Integer;
end singleProcess; port Emitter_Thread.Natural_Source -> Out_Natural;
port Emitter_Thread.Array_Source -> Out_Array;
process implementation singleProcess.impl
subcomponents port Emitter_Thread.Integer_8_Source -> Out_Integer_8;
Emitter_Thread : thread Software::Emitter.Impl; port Emitter_Thread.Integer_16_Source -> Out_Integer_16;
Boolean_Rcv_Thread : thread Software::Boolean_Receiver.Impl; port Emitter_Thread.Integer_32_Source -> Out_Integer_32;
Integer_Rcv_Thread : thread Software::Integer_Receiver.Impl; port Emitter_Thread.Integer_64_Source -> Out_Integer_64;
connections
port Emitter_Thread.Boolean_Source -> Boolean_Rcv_Thread.Data_Sink; port Emitter_Thread.Unsigned_8_Source -> Out_Unsigned_8;
port Emitter_Thread.Integer_Source -> Integer_Rcv_Thread.Data_Sink; port Emitter_Thread.Unsigned_16_Source -> Out_Unsigned_16;
end singleProcess.impl; port Emitter_Thread.Unsigned_32_Source -> Out_Unsigned_32;
port Emitter_Thread.Unsigned_64_Source -> Out_Unsigned_64;
------------
-- System -- port Emitter_Thread.Float_Source -> Out_Float;
------------ port Emitter_Thread.Float_32_Source -> Out_Float_32;
port Emitter_Thread.Float_64_Source -> Out_Float_64;
system Some_Types_Stdint port Emitter_Thread.Character_Source -> Out_Character;
end Some_Types_Stdint;
end A.Impl;
system implementation Some_Types_Stdint.Impl
subcomponents process B
Node_A : process A.Impl; features
Node_B : process B.Impl; In_Boolean : in event data port Software::Boolean_Type;
Device_A : device ocarina_drivers::generic_sockets_ip.pohic In_Integer : in event data port Software::Integer_Type;
{Source_Text => ("devicesconf.c");}; In_Natural : in event data port Software::Natural_Type;
Device_B : device ocarina_drivers::generic_sockets_ip.pohic In_Array : in event data port Software::Array_Type;
{Source_Text => ("devicesconf.c");};
CPU_A : processor the_processor; In_Integer_8 : in event data port Software::Integer_8_Type;
CPU_B : processor the_processor; In_Integer_16 : in event data port Software::Integer_16_Type;
the_bus : bus ocarina_buses::ip.i; In_Integer_32 : in event data port Software::Integer_32_Type;
connections In_Integer_64 : in event data port Software::Integer_64_Type;
bus access the_bus -> Device_A.link;
bus access the_bus -> Device_B.link; In_Unsigned_8 : in event data port Software::Unsigned_8_Type;
In_Unsigned_16 : in event data port Software::Unsigned_16_Type;
port Node_A.Out_Boolean -> Node_B.In_Boolean In_Unsigned_32 : in event data port Software::Unsigned_32_Type;
{Actual_Connection_Binding => (reference (the_bus));}; In_Unsigned_64 : in event data port Software::Unsigned_64_Type;
port Node_A.Out_Integer -> Node_B.In_Integer
{Actual_Connection_Binding => (reference (the_bus));}; In_Float : in event data port Software::Float_Type;
properties In_Float_32 : in event data port Software::Float_32_Type;
actual_processor_binding => (reference (CPU_A)) applies to Node_A; In_Float_64 : in event data port Software::Float_64_Type;
actual_processor_binding => (reference (CPU_B)) applies to Node_B; In_Character : in event data port Software::Character_Type;
actual_processor_binding => (reference (CPU_A)) applies to Device_A; end B;
actual_processor_binding => (reference (CPU_B)) applies to Device_B;
end Some_Types_Stdint.Impl; process implementation B.Impl
subcomponents
system Some_Types_local Boolean_Rcv_Thread : thread Software::Boolean_Receiver.Impl;
end Some_Types_local; Integer_Rcv_Thread : thread Software::Integer_Receiver.Impl;
Natural_Rcv_Thread : thread Software::Natural_Receiver.Impl;
system implementation Some_Types_local.impl Array_Rcv_Thread : thread Software::Array_Receiver.Impl;
subcomponents
CPU_A: processor the_processor; Integer_8_Rcv_Thread : thread Software::Integer_8_Receiver.Impl;
sometypesstdint: process singleProcess.impl; Integer_16_Rcv_Thread : thread Software::Integer_16_Receiver.Impl;
properties Integer_32_Rcv_Thread : thread Software::Integer_32_Receiver.Impl;
Actual_Processor_Binding => reference (CPU_A) applies to sometypesstdint; Integer_64_Rcv_Thread : thread Software::Integer_64_Receiver.Impl;
end Some_Types_local.impl;
Unsigned_8_Rcv_Thread : thread Software::Unsigned_8_Receiver.Impl;
system implementation Some_Types_local.Xenomai Unsigned_16_Rcv_Thread : thread Software::Unsigned_16_Receiver.Impl;
extends Some_Types_local.impl Unsigned_32_Rcv_Thread : thread Software::Unsigned_32_Receiver.Impl;
properties Unsigned_64_Rcv_Thread : thread Software::Unsigned_64_Receiver.Impl;
Deployment::Execution_Platform => linux32_xenomai_native applies to CPU_A;
end Some_Types_local.Xenomai; Float_Rcv_Thread : thread Software::Float_Receiver.Impl;
Float_32_Rcv_Thread : thread Software::Float_32_Receiver.Impl;
system implementation Some_Types_local.RTEMS Float_64_Rcv_Thread : thread Software::Float_64_Receiver.Impl;
extends Some_Types_local.impl Character_Rcv_Thread : thread Software::Character_Receiver.Impl;
properties
Deployment::Execution_platform => LEON_RTEMS applies to CPU_A ; connections
end Some_Types_local.RTEMS; port In_Boolean -> Boolean_Rcv_Thread.Data_Sink;
port In_Integer -> Integer_Rcv_Thread.Data_Sink;
port In_Natural -> Natural_Rcv_Thread.Data_Sink;
port In_Array -> Array_Rcv_Thread.Data_Sink;
port In_Integer_8 -> Integer_8_Rcv_Thread.Data_Sink;
port In_Integer_16 -> Integer_16_Rcv_Thread.Data_Sink;
port In_Integer_32 -> Integer_32_Rcv_Thread.Data_Sink;
port In_Integer_64 -> Integer_64_Rcv_Thread.Data_Sink;
port In_Unsigned_8 -> Unsigned_8_Rcv_Thread.Data_Sink;
port In_Unsigned_16 -> Unsigned_16_Rcv_Thread.Data_Sink;
port In_Unsigned_32 -> Unsigned_32_Rcv_Thread.Data_Sink;
port In_Unsigned_64 -> Unsigned_64_Rcv_Thread.Data_Sink;
port In_Float -> Float_Rcv_Thread.Data_Sink;
port In_Float_32 -> Float_32_Rcv_Thread.Data_Sink;
port In_Float_64 -> Float_64_Rcv_Thread.Data_Sink;
port In_Character -> Character_Rcv_Thread.Data_Sink;
end B.Impl;
process singleProcess
end singleProcess;
process implementation singleProcess.impl
subcomponents
Emitter_Thread : thread Software::Emitter.Impl;
Boolean_Rcv_Thread : thread Software::Boolean_Receiver.Impl;
Integer_Rcv_Thread : thread Software::Integer_Receiver.Impl;
Natural_Rcv_Thread : thread Software::Natural_Receiver.Impl;
Array_Rcv_Thread : thread Software::Array_Receiver.Impl;
Integer_8_Rcv_Thread : thread Software::Integer_8_Receiver.Impl;
Integer_16_Rcv_Thread : thread Software::Integer_16_Receiver.Impl;
Integer_32_Rcv_Thread : thread Software::Integer_32_Receiver.Impl;
Integer_64_Rcv_Thread : thread Software::Integer_64_Receiver.Impl;
Unsigned_8_Rcv_Thread : thread Software::Unsigned_8_Receiver.Impl;
Unsigned_16_Rcv_Thread : thread Software::Unsigned_16_Receiver.Impl;
Unsigned_32_Rcv_Thread : thread Software::Unsigned_32_Receiver.Impl;
Unsigned_64_Rcv_Thread : thread Software::Unsigned_64_Receiver.Impl;
Float_Rcv_Thread : thread Software::Float_Receiver.Impl;
Float_32_Rcv_Thread : thread Software::Float_32_Receiver.Impl;
Float_64_Rcv_Thread : thread Software::Float_64_Receiver.Impl;
Character_Rcv_Thread : thread Software::Character_Receiver.Impl;
connections
port Emitter_Thread.Boolean_Source -> Boolean_Rcv_Thread.Data_Sink;
port Emitter_Thread.Integer_Source -> Integer_Rcv_Thread.Data_Sink;
port Emitter_Thread.Natural_Source -> Natural_Rcv_Thread.Data_Sink;
port Emitter_Thread.Array_Source -> Array_Rcv_Thread.Data_Sink;
port Emitter_Thread.Integer_8_Source -> Integer_8_Rcv_Thread.Data_Sink;
port Emitter_Thread.Integer_16_Source -> Integer_16_Rcv_Thread.Data_Sink;
port Emitter_Thread.Integer_32_Source -> Integer_32_Rcv_Thread.Data_Sink;
port Emitter_Thread.Integer_64_Source -> Integer_64_Rcv_Thread.Data_Sink;
port Emitter_Thread.Unsigned_8_Source -> Unsigned_8_Rcv_Thread.Data_Sink;
port Emitter_Thread.Unsigned_16_Source -> Unsigned_16_Rcv_Thread.Data_Sink;
port Emitter_Thread.Unsigned_32_Source -> Unsigned_32_Rcv_Thread.Data_Sink;
port Emitter_Thread.Unsigned_64_Source -> Unsigned_64_Rcv_Thread.Data_Sink;
port Emitter_Thread.Float_Source -> Float_Rcv_Thread.Data_Sink;
port Emitter_Thread.Float_32_Source -> Float_32_Rcv_Thread.Data_Sink;
port Emitter_Thread.Float_64_Source -> Float_64_Rcv_Thread.Data_Sink;
port Emitter_Thread.Character_Source -> Character_Rcv_Thread.Data_Sink;
end singleProcess.impl;
------------
-- System --
------------
system Some_Types_Stdint
end Some_Types_Stdint;
system implementation Some_Types_Stdint.Impl
subcomponents
Node_A : process A.Impl;
Node_B : process B.Impl;
Device_A : device ocarina_drivers::generic_sockets_ip.pohic
{Source_Text => ("devicesconf.c");};
Device_B : device ocarina_drivers::generic_sockets_ip.pohic
{Source_Text => ("devicesconf.c");};
CPU_A : processor the_processor;
CPU_B : processor the_processor;
the_bus : bus ocarina_buses::ip.i;
connections
bus access the_bus -> Device_A.link;
bus access the_bus -> Device_B.link;
port Node_A.Out_Boolean -> Node_B.In_Boolean
{Actual_Connection_Binding => (reference (the_bus));};
port Node_A.Out_Integer -> Node_B.In_Integer