Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
PolyORB-HI-C
Commits
f901ed2c
Commit
f901ed2c
authored
Apr 04, 2017
by
yoogx
Browse files
* Reorganize examples to reduce code duplication
For issue
#18
parent
6e67bf23
Changes
64
Hide whitespace changes
Inline
Side-by-side
examples/aadlv2/Makefile.am
View file @
f901ed2c
SUBDIRS
=
d3.1.3-1 ping rma sunseeker producer-consumer some-types
\
some-types-stdint flight-mgmt import monitor
packet-store
\
file-store
lua cpp
some-types-stdint flight-mgmt import monitor
lua cpp
\
packet-store
file-store
SAMPLE_DIR
=
${
shell
$(CYGPATH_U)
'
$(OCARINA_PREFIX)
/examples/ocarina/polyorb-hi-c/aadlv2'
}
...
...
examples/aadlv2/cpp/Makefile.am
View file @
f901ed2c
C_FILES
=
$(srcdir)
/hello.cc
AADL_FILES
=
$(srcdir)
/cpp_test.aadl
SCENARIO_FILES
=
$(srcdir)
/scenario.aadl
SCENARIO_FILES
=
$(srcdir)
/scenario.aadl
$(srcdir)
/scenario_rtems.aadl
include
$(srcdir)/../../Makefile.common
...
...
examples/aadlv2/cpp/cpp_test.aadl
View file @
f901ed2c
...
...
@@ -2,73 +2,85 @@ package CPP_Test
public
with
Deployment
;
-----------------
--
Subprograms
--
-----------------
subprogram
Hello_Spg_1
properties
source_language
=>
(
CPP
);
source_name
=>
"hello_world"
;
source_text
=>
(
"hello.cc"
);
end
Hello_Spg_1
;
-------------
--
Threads
--
-------------
thread
Task
end
Task
;
thread
implementation
Task
.
impl_1
calls
Mycalls
:
{
P_Spg
:
subprogram
Hello_Spg_1
;
};
properties
Dispatch_Protocol
=>
periodic
;
Period
=>
1000
ms
;
end
Task
.
impl_1
;
---------------
--
Processor
--
---------------
processor
cpurm
properties
Deployment
::
Execution_Platform
=>
Native
;
end
cpurm
;
processor
implementation
cpurm
.
impl
properties
Scheduling_Protocol
=>
(
Posix_1003_Highest_Priority_First_Protocol
);
end
cpurm
.
impl
;
---------------
--
Processes
--
---------------
process
node_a
end
node_a
;
process
implementation
node_a
.
impl
subcomponents
Task1
:
thread
Task
.
impl_1
;
end
node_a
.
impl
;
------------
--
System
--
------------
system
cpp_test
end
cpp_test
;
-----------------
--
Subprograms
--
-----------------
subprogram
Hello_Spg_1
properties
source_language
=>
(
CPP
);
source_name
=>
"hello_world"
;
source_text
=>
(
"hello.cc"
);
end
Hello_Spg_1
;
-------------
--
Threads
--
-------------
thread
Task
end
Task
;
thread
implementation
Task
.
impl_1
calls
Mycalls
:
{
P_Spg
:
subprogram
Hello_Spg_1
;
};
properties
Dispatch_Protocol
=>
periodic
;
Period
=>
1000
ms
;
end
Task
.
impl_1
;
---------------
--
Processor
--
---------------
processor
cpurm
properties
Deployment
::
Execution_Platform
=>
Native
;
end
cpurm
;
processor
implementation
cpurm
.
impl
properties
Scheduling_Protocol
=>
(
Posix_1003_Highest_Priority_First_Protocol
);
end
cpurm
.
impl
;
system
implementation
cpp_test
.
impl
subcomponents
node_a
:
process
node_a
.
impl
;
cpu_rm
:
processor
cpurm
.
impl
;
properties
Actual_Processor_Binding
=>
(
reference
(
cpu_rm
))
applies
to
node_a
;
end
cpp_test
.
impl
;
---------------
--
Processes
--
---------------
end
CPP_Test
;
process
node_a
end
node_a
;
process
implementation
node_a
.
impl
subcomponents
Task1
:
thread
Task
.
impl_1
;
end
node_a
.
impl
;
------------
--
System
--
------------
system
cpp_test
end
cpp_test
;
system
implementation
cpp_test
.
impl
subcomponents
cpptest
:
process
node_a
.
impl
;
cpu_rm
:
processor
cpurm
.
impl
;
properties
Actual_Processor_Binding
=>
(
reference
(
cpu_rm
))
applies
to
cpptest
;
end
cpp_test
.
impl
;
system
implementation
cpp_test
.
Xenomai
extends
cpp_test
.
impl
properties
Deployment
::
Execution_Platform
=>
linux32_xenomai_native
applies
to
cpu_rm
;
end
cpp_test
.
Xenomai
;
system
implementation
cpp_test
.
RTEMS
extends
cpp_test
.
impl
properties
Deployment
::
Execution_platform
=>
LEON_RTEMS
applies
to
cpu_rm
;
end
cpp_test
.
RTEMS
;
end
cpp_test
;
examples/aadlv2/cpp/hello.cc
View file @
f901ed2c
...
...
@@ -8,5 +8,5 @@ extern "C" {
void
hello_world
(
void
)
{
std
::
cout
<<
"Hello, new world!
\n
"
;
std
::
cout
<<
"Hello, new world!
\n
"
;
}
examples/aadlv2/cpp/scenario.aadl
View file @
f901ed2c
...
...
@@ -3,6 +3,7 @@ properties
Ocarina_Config::AADL_Files =>
("cpp_test.aadl");
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Root_System_Name => "cpp_test.impl";
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
value (Ocarina_Config::Deployment),
...
...
@@ -12,4 +13,3 @@ end cpp;
system implementation cpp.Impl
end cpp.Impl;
examples/aadlv2/cpp/scenario_rtems.aadl
0 → 100644
View file @
f901ed2c
-- This is a scenario file describing the AADL application Flight
-- Management
-- $Id: scenario_local.aadl 424 2007-07-10 13:46:33Z zalila $
system cpptest
properties
Ocarina_Config::Timeout_Property => 1000ms;
Ocarina_Config::Referencial_Files =>
("cpptest", "cpptest.ref");
Ocarina_Config::AADL_Files =>
("cpp_test.aadl");
Ocarina_Config::Root_System_Name => "cpp_test.RTEMS";
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
value (Ocarina_Config::Deployment),
value (Ocarina_Config::Cheddar_Properties));
Ocarina_Config::AADL_Version => AADLv2;
Ocarina_Config::Use_Components_Library => true;
end cpptest;
system implementation cpptest.Impl
end cpptest.Impl;
examples/aadlv2/d3.1.3-1/Makefile.am
View file @
f901ed2c
C_FILES
=
$(srcdir)
/toy.c
AADL_FILES
=
$(srcdir)
/toy_example.aadl
SCENARIO_FILES
=
$(srcdir)
/scenario_local.aadl
\
$(srcdir)
/scenario_local_xenomai_posix.aadl
\
$(srcdir)
/scenario_local_xenomai_native.aadl
SCENARIO_FILES
=
$(srcdir)
/scenario_local.aadl
\
$(srcdir)
/scenario_local_xenomai_posix.aadl
\
$(srcdir)
/scenario_local_xenomai_native.aadl
\
$(srcdir)
/scenario_rtems.aadl
include
$(srcdir)/../../Makefile.common
...
...
examples/aadlv2/d3.1.3-1/scenario_local.aadl
View file @
f901ed2c
...
...
@@ -17,6 +17,7 @@ properties
value (Ocarina_Config::Deployment),
value (Ocarina_Config::Cheddar_Properties));
Ocarina_Config::AADL_Version => AADLv2;
Ocarina_Config::Use_Components_Library => true;
end d3_1_3_1;
system implementation d3_1_3_1.Impl
...
...
examples/aadlv2/d3.1.3-1/scenario_rtems.aadl
0 → 100644
View file @
f901ed2c
-- This is a scenario file describing the AADL
-- application d3_1_3_1
-- $Id: scenario_local.aadl 407 2007-06-19 15:24:28Z delange $
system d3_1_3_1
properties
Ocarina_Config::Timeout_Property => 4000ms;
Ocarina_Config::Referencial_Files =>
("gnc_tmtc_pos", "gnc_tmtc_pos.ref");
Ocarina_Config::AADL_Files =>
("toy_example.aadl");
Ocarina_Config::Root_System_Name => "toy_example.RTEMS";
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
value (Ocarina_Config::Deployment),
value (Ocarina_Config::Cheddar_Properties));
Ocarina_Config::AADL_Version => AADLv2;
Ocarina_Config::Use_Components_Library => true;
end d3_1_3_1;
system implementation d3_1_3_1.Impl
end d3_1_3_1.Impl;
examples/aadlv2/d3.1.3-1/toy_example.aadl
View file @
f901ed2c
...
...
@@ -229,16 +229,20 @@ public
system
implementation
toy_example
.
xenomai
extends
toy_example
::
toy_example
.
native
properties
Deployment
::
Execution_Platform
=>
LINUX32_XENOMAI_NATIVE
applies
to
P1
;
end
toy_example
.
xenomai
;
system
implementation
toy_example
.
xenomai_posix
extends
toy_example
::
toy_example
.
native
properties
Deployment
::
Execution_Platform
=>
LINUX32_XENOMAI_POSIX
applies
to
P1
;
end
toy_example
.
xenomai_posix
;
system
implementation
toy_example
.
RTEMS
extends
toy_example
::
toy_example
.
native
properties
Deployment
::
Execution_Platform
=>
LEON_RTEMS
applies
to
P1
;
end
toy_example
.
RTEMS
;
end
Toy_Example
;
examples/aadlv2/file-store/Makefile.am
View file @
f901ed2c
...
...
@@ -3,8 +3,9 @@ AADL_FILES = \
$(srcdir)
/software.aadl
\
$(srcdir)
/ping.aadl
SCENARIO_FILES
=
\
$(srcdir)
/scenario.aadl
SCENARIO_FILES
=
$(srcdir)
/scenario.aadl
# $(srcdir)/scenario_rtems.aadl $(srcdir)/scenario_local.aadl
include
$(srcdir)/../../Makefile.common
...
...
examples/aadlv2/file-store/ping.aadl
View file @
f901ed2c
--
This
model
completes
the
PING
example
by
adding
deployment
--
information
.
--
--
In
this
deployment
,
two
nodes
are
defined
,
one
task
per
node
.
--
--
$
Id
:
ping
.
aadl
401
2007
-
06
-
07
15
:
04
:
01
Z
hugues
$
package
PING
public
with
Software
;
...
...
@@ -11,87 +5,120 @@ public
with
ocarina_drivers
;
with
ocarina_buses
;
---------------
--
Processor
--
---------------
processor
the_processor
properties
Deployment
::
location
=>
"127.0.0.1"
;
Deployment
::
Execution_Platform
=>
Native
;
Priority_Range
=>
0
..
255
;
Scheduling_Protocol
=>
(
Posix_1003_Highest_Priority_First_Protocol
);
end
the_processor
;
---------
--
Bus
--
---------
bus
Ethernet_Bus
properties
Deployment
::
Transport_API
=>
BSD_Sockets
;
end
Ethernet_Bus
;
---------------
--
Processes
--
---------------
process
A
features
Out_Port
:
out
event
data
port
Software
::
Simple_Type
;
end
A
;
process
implementation
A
.
Impl
subcomponents
Pinger
:
thread
Software
::
P
.
Impl
;
produce_pkts
:
thread
software
::
packet_producer
.
i
;
connections
port
Pinger
.
Data_Source
->
Out_Port
;
end
A
.
Impl
;
process
B
features
In_Port
:
in
event
data
port
Software
::
Simple_Type
;
end
B
;
process
implementation
B
.
Impl
subcomponents
Ping_Me
:
thread
Software
::
Q
.
Impl
;
connections
port
In_Port
->
Ping_Me
.
Data_Sink
;
end
B
.
Impl
;
------------
--
System
--
------------
system
PING
end
PING
;
system
implementation
PING
.
Impl
subcomponents
Node_A
:
process
A
.
Impl
;
Node_B
:
process
B
.
Impl
;
Device_A
:
device
ocarina_drivers
::
generic_sockets_ip
.
pohic
---------------
--
Processor
--
---------------
processor
the_processor
properties
Deployment
::
location
=>
"127.0.0.1"
;
Deployment
::
Execution_Platform
=>
Native
;
Priority_Range
=>
0
..
255
;
Scheduling_Protocol
=>
(
Posix_1003_Highest_Priority_First_Protocol
);
end
the_processor
;
---------
--
Bus
--
---------
bus
Ethernet_Bus
properties
Deployment
::
Transport_API
=>
BSD_Sockets
;
end
Ethernet_Bus
;
---------------
--
Processes
--
---------------
process
A
features
Out_Port
:
out
event
data
port
Software
::
Simple_Type
;
end
A
;
process
implementation
A
.
Impl
subcomponents
Pinger
:
thread
Software
::
P
.
Impl
;
produce_pkts
:
thread
software
::
packet_producer
.
i
;
connections
port
Pinger
.
Data_Source
->
Out_Port
;
end
A
.
Impl
;
process
B
features
In_Port
:
in
event
data
port
Software
::
Simple_Type
;
end
B
;
process
implementation
B
.
Impl
subcomponents
Ping_Me
:
thread
Software
::
Q
.
Impl
;
connections
port
In_Port
->
Ping_Me
.
Data_Sink
;
end
B
.
Impl
;
process
singleProcess
end
singleProcess
;
process
implementation
singleProcess
.
Impl
subcomponents
Pinger
:
thread
Software
::
P
.
Impl
;
produce_pkts
:
thread
software
::
packet_producer
.
i
;
Ping_Me
:
thread
Software
::
Q
.
Impl
;
connections
port
Pinger
.
Data_Source
->
Ping_Me
.
Data_Sink
;
end
singleProcess
.
Impl
;
------------
--
System
--
------------
system
PING
end
PING
;
system
implementation
PING
.
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
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
;
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_Port
->
Node_B
.
In_Port
port
Node_A
.
Out_Port
->
Node_B
.
In_Port
{
Actual_Connection_Binding
=>
(
reference
(
the_bus
));};
properties
actual_processor_binding
=>
reference
(
CPU_A
)
applies
to
Node_A
;
actual_processor_binding
=>
reference
(
CPU_B
)
applies
to
Node_B
;
actual_processor_binding
=>
(
reference
(
CPU_A
))
applies
to
Device_A
;
actual_processor_binding
=>
(
reference
(
CPU_B
))
applies
to
Device_B
;
end
PING
.
Impl
;
properties
actual_processor_binding
=>
reference
(
CPU_A
)
applies
to
Node_A
;
actual_processor_binding
=>
reference
(
CPU_B
)
applies
to
Node_B
;
actual_processor_binding
=>
(
reference
(
CPU_A
))
applies
to
Device_A
;
actual_processor_binding
=>
(
reference
(
CPU_B
))
applies
to
Device_B
;
end
PING
.
Impl
;
system
implementation
PING
.
Local
subcomponents
filestore
:
process
singleProcess
.
Impl
;
CPU_A
:
processor
the_processor
;
properties
actual_processor_binding
=>
reference
(
CPU_A
)
applies
to
filestore
;
end
PING
.
Local
;
system
implementation
PING
.
Xenomai
extends
PING
.
Local
properties
Deployment
::
Execution_Platform
=>
linux32_xenomai_native
applies
to
CPU_A
;
end
PING
.
Xenomai
;
system
implementation
PING
.
RTEMS
extends
PING
.
local
properties
Deployment
::
Execution_platform
=>
LEON_RTEMS
applies
to
CPU_A
;
end
PING
.
RTEMS
;
end
PING
;
examples/aadlv2/file-store/pinger.c
View file @
f901ed2c
#include
<stdio.h>
#include
<request.h>
#include
<deployment.h>
#include
<request.h>
#include
<deployment.h>
#include
<po_hi_storage.h>
#include
<po_hi_gqueue.h>
#define FILENAME "pinger.dat"
...
...
@@ -27,7 +28,6 @@ void user_produce_pkts_init ()
printf
(
"*** /!
\\
ERROR WHEN OPENING THE FILE %s /!
\\
***
\n
"
,
FILENAME
);
}
fflush
(
stdout
);
}
...
...
@@ -81,6 +81,7 @@ void user_do_ping_spg ()
fflush
(
stdout
);
}
void
recover
(
void
)
{
printf
(
"*** RECOVER ACTION ***
\n
"
);
...
...
examples/aadlv2/file-store/pingme.c
View file @
f901ed2c
...
...
@@ -5,9 +5,9 @@ void user_ping_spg (int i)
printf
(
"*** PING *** %d
\n
"
,
i
);
fflush
(
stdout
);
}
/* redundant
void recover (void)
{
printf ("*** RECOVER ACTION ***\n");
fflush (stdout);
}
}
*/
examples/aadlv2/file-store/scenario.aadl
View file @
f901ed2c
...
...
@@ -7,6 +7,7 @@ properties
"node_b", "node_b.ref");
Ocarina_Config::AADL_Files =>
("ping.aadl" , "software.aadl");
Ocarina_Config::Root_System_Name => "PING.impl";
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
...
...
examples/aadlv2/file-store/scenario_local.aadl
0 → 100644
View file @
f901ed2c
system ping
properties
Ocarina_Config::Timeout_Property => 4000ms;
Ocarina_Config::Referencial_Files =>
("node_a", "node_a.ref");
Ocarina_Config::AADL_Files =>
("ping.aadl" , "software.aadl");
Ocarina_Config::Root_System_Name => "PING.local";
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
value (Ocarina_Config::Deployment),
value (Ocarina_Config::Cheddar_Properties));
Ocarina_Config::AADL_Version => AADLv2;
Ocarina_Config::Use_Components_Library => true;
end ping;
system implementation ping.impl
end ping.impl;
examples/aadlv2/file-store/scenario_rtems.aadl
0 → 100644
View file @
f901ed2c
system ping
properties
Ocarina_Config::Timeout_Property => 4000ms;
Ocarina_Config::Referencial_Files =>
("node_a", "node_a.ref");
Ocarina_Config::AADL_Files =>
("ping.aadl" , "software.aadl");
Ocarina_Config::Root_System_Name => "PING.RTEMS";
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
value (Ocarina_Config::Deployment),
value (Ocarina_Config::Cheddar_Properties));
Ocarina_Config::AADL_Version => AADLv2;
Ocarina_Config::Use_Components_Library => true;
end ping;
system implementation ping.impl
end ping.impl;
examples/aadlv2/flight-mgmt/Makefile.am
View file @
f901ed2c
C_FILES
=
$(srcdir)
/flight-mgmt.c
AADL_FILES
=
$(srcdir)
/flt_mgmt.aadl
$(srcdir)
/software.aadl
SCENARIO_FILES
=
$(srcdir)
/scenario_local.aadl
\
$(srcdir)
/scenario_local_xenomai.aadl
SCENARIO_FILES
=
$(srcdir)
/scenario_local.aadl
\
$(srcdir)
/scenario_local_xenomai.aadl
\
$(srcdir)
/scenario_rtems.aadl
include
$(srcdir)/../../Makefile.common
...
...
examples/aadlv2/flight-mgmt/flt_mgmt.aadl
View file @
f901ed2c
...
...
@@ -43,18 +43,24 @@ public
system
Flight_Mgmt