Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AADLib
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
AADLib
Commits
f6fc7f07
Commit
f6fc7f07
authored
May 15, 2019
by
yoogx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Added producer/consummer example using the BA
For openaadl/ocarina#190
parent
b0319a1f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
205 additions
and
2 deletions
+205
-2
configure.ac
configure.ac
+2
-1
examples/Makefile.am
examples/Makefile.am
+2
-1
examples/producer_consumer_ba/Makefile.am
examples/producer_consumer_ba/Makefile.am
+12
-0
examples/producer_consumer_ba/devicesconf.c
examples/producer_consumer_ba/devicesconf.c
+4
-0
examples/producer_consumer_ba/producer_consumer.c
examples/producer_consumer_ba/producer_consumer.c
+8
-0
examples/producer_consumer_ba/producer_consumer_ba.aadl
examples/producer_consumer_ba/producer_consumer_ba.aadl
+177
-0
No files found.
configure.ac
View file @
f6fc7f07
...
...
@@ -97,7 +97,7 @@ AC_OUTPUT([
examples/isr/Makefile
examples/line_follower/Makefile
examples/memory/Makefile
examples/minepump/Makefile
examples/minepump/Makefile
examples/mixin/Makefile
examples/mjpeg/Makefile
examples/mosart/Makefile
...
...
@@ -106,6 +106,7 @@ AC_OUTPUT([
examples/pathfinder_system/Makefile
examples/perseus/Makefile
examples/producer_consumer/Makefile
examples/producer_consumer_ba/Makefile
examples/radar/Makefile
examples/rap/Makefile
examples/rap_code/Makefile
...
...
examples/Makefile.am
View file @
f6fc7f07
...
...
@@ -4,7 +4,8 @@ SUBDIRS= adiru ahrs_discovery aocs aram ardupilot arinc653_annex asl \
pathfinder_system perseus producer_consumer ravenscar radar
\
rap rap_code redundancy rma robot round_robin time_triggered
\
units uxv voter satellite stm32discovery_ada robot_ba
\
pacemaker doors rosace mjpeg crazyflie air minepump
pacemaker doors rosace mjpeg crazyflie air minepump
\
producer_consumer_ba
EXTRA_DIST
=
$(srcdir)
/Makefile.common
...
...
examples/producer_consumer_ba/Makefile.am
0 → 100644
View file @
f6fc7f07
AADL_SOURCES
=
$(srcdir)
/producer_consumer_ba.aadl
AADL_ROOT
=
pc_simple.native
OTHER_FILES
=
CLEANDIRS
=
pc_simple_native
CLEANFILES
=
*
.lnt demo.svl
include
$(srcdir)/../Makefile.common
AVAILABLE_TARGETS
=
parse-aadl build_c
examples/producer_consumer_ba/devicesconf.c
0 → 100644
View file @
f6fc7f07
#include <drivers/configuration/ip.h>
__po_hi_c_ip_conf_t
pohidrv_device_a
=
{
.
devname
=
"eth0"
,
.
address
=
"127.0.0.1"
,
.
version
=
__po_hi_c_ipv4
,
.
port
=
1234
};
__po_hi_c_ip_conf_t
pohidrv_device_b
=
{
.
devname
=
"eth0"
,
.
address
=
"127.0.0.1"
,
.
version
=
__po_hi_c_ipv4
,
.
port
=
1235
};
examples/producer_consumer_ba/producer_consumer.c
0 → 100644
View file @
f6fc7f07
#include<stdio.h>
#include<types.h>
void
print_spg
(
producer__consumer__alpha_type
a_data_in
)
{
printf
(
"%d
\n
"
,
a_data_in
);
}
examples/producer_consumer_ba/producer_consumer_ba.aadl
0 → 100644
View file @
f6fc7f07
package
Producer
::
Consumer
public
with
Deployment
;
with
Data_Model
;
with
Buses
::
Ethernet
;
with
Processors
;
with
Native_Sockets
;
----------
--
Data
--
----------
data
Alpha_Type
properties
Data_Model
::
Data_Representation
=>
Integer
;
end
Alpha_Type
;
-----------------
--
Subprograms
--
-----------------
subprogram
Produce_Spg
features
Data_Source
:
out
parameter
Alpha_Type
;
end
Produce_Spg
;
subprogram
implementation
Produce_Spg
.
Impl
annex
behavior_specification
{**
states
s
:
initial
final
state
;
transitions
s
-[
]->
s
{
Data_Source
:=
1
;
Print_Spg
!(Data_Source) };
**};
end
Produce_Spg
.
Impl
;
subprogram
Print_Spg
features
A_Data_In
:
in
parameter
Alpha_Type
;
properties
Source_Language
=>
(
C
);
Source_Name
=>
"print_spg"
;
Source_Text
=>
(
"producer_consumer.c"
);
end
Print_Spg
;
subprogram
Consume_Spg
features
Data_Sink
:
in
parameter
Alpha_Type
;
properties
Source_Language
=>
(
C
);
Source_Name
=>
"consume_spg"
;
Source_Text
=>
(
"producer_consumer.c"
);
end
Consume_Spg
;
-------------
--
Threads
--
-------------
thread
P
features
Data_Source
:
out
event
data
port
Alpha_Type
;
--
XXX
Data
seems
corrupted
if
Data_Source
is
an
out
data
port
properties
Dispatch_Protocol
=>
Periodic
;
Compute_Execution_Time
=>
1
ms
..
10
ms
;
Priority
=>
1
;
Period
=>
500
ms
;
end
P
;
thread
implementation
P
.
Impl
calls
Mycall
:
{
P_Spg
:
subprogram
Produce_Spg
.
Impl
;
};
connections
Z1
:
parameter
P_Spg
.
Data_Source
->
Data_Source
;
end
P
.
Impl
;
thread
Q
features
Data_Sink
:
in
event
data
port
Alpha_Type
;
properties
Dispatch_Protocol
=>
Sporadic
;
Compute_Execution_Time
=>
1
ms
..
20
ms
;
Priority
=>
2
;
Period
=>
10
ms
;
end
Q
;
thread
implementation
Q
.
Impl
calls
Mycall
:
{
Q_Spg
:
subprogram
Consume_Spg
;
};
connections
Z2
:
parameter
Data_Sink
->
Q_Spg
.
Data_Sink
;
end
Q
.
Impl
;
---------------
--
Processor
--
---------------
processor
the_processor
properties
Deployment
::
Execution_Platform
=>
Native
;
end
the_processor
;
---------------
--
Processes
--
---------------
process
A
features
Alpha
:
out
data
port
Alpha_Type
;
end
A
;
process
implementation
A
.
Impl
subcomponents
Producer
:
thread
P
.
Impl
;
connections
Z3
:
port
Producer
.
Data_Source
->
Alpha
;
end
A
.
Impl
;
process
B
features
Beta
:
in
data
port
Alpha_Type
;
end
B
;
process
implementation
B
.
Impl
subcomponents
Consumer
:
thread
Q
.
Impl
;
connections
Z4
:
port
Beta
->
Consumer
.
Data_Sink
;
end
B
.
Impl
;
------------
--
System
--
------------
system
PC_Simple
end
PC_Simple
;
system
implementation
PC_Simple
.
Native
subcomponents
pr_A
:
process
A
.
Impl
;
pr_B
:
process
B
.
Impl
{
Deployment
::
port_number
=>
4002
;};
Device_A
:
device
Native_Sockets
::
Native_Sockets
.
pohic
{
Source_Text
=>
(
"devicesconf.c"
);};
Device_B
:
device
Native_Sockets
::
Native_Sockets
.
pohic
{
Source_Text
=>
(
"devicesconf.c"
);};
CPU_A
:
processor
the_processor
;
CPU_B
:
processor
the_processor
;
the_bus
:
bus
Buses
::
Ethernet
::
Ethernet
.
impl
;
connections
Z1
:
bus
access
the_bus
->
Device_A
.
Eth
;
Z2
:
bus
access
the_bus
->
Device_B
.
Eth
;
--
Z5
:
bus
access
the_bus
->
CPU
.
ETH
;
Z6
:
port
pr_A
.
Alpha
->
pr_B
.
Beta
;
properties
Actual_Processor_Binding
=>
(
reference
(
CPU_A
))
applies
to
pr_A
;
Actual_Processor_Binding
=>
(
reference
(
CPU_B
))
applies
to
pr_B
;
Actual_Connection_Binding
=>
(
reference
(
the_bus
))
applies
to
Z6
;
actual_processor_binding
=>
(
reference
(
CPU_A
))
applies
to
Device_A
;
actual_processor_binding
=>
(
reference
(
CPU_B
))
applies
to
Device_B
;
annex
real_specification
{**
theorem
flow_latency
foreach
s
in
system_set
do
requires
(
Latency
);
check
(
1
=
1
);
end
flow_latency
;
**};
end
PC_Simple
.
Native
;
end
Producer
::
Consumer
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment