Commit 4d387604 authored by yoogx's avatar yoogx

* Add PING example for AIR

parent 559dc5fb
......@@ -76,6 +76,7 @@ AC_OUTPUT([
examples/Makefile
examples/air/Makefile
examples/air/hello/Makefile
examples/air/ping/Makefile
examples/adiru/Makefile
examples/ahrs_discovery/Makefile
examples/aocs/Makefile
......
SUBDIRS= hello
SUBDIRS= hello ping
clean-local:
-rm -rf *~
AADL_SOURCES = $(srcdir)/ping-air.aadl
AADL_ROOT = ping.ima
OTHER_FILES =
CLEANDIRS = hello_impl
CLEANFILES =
include $(srcdir)/../../Makefile.common
AVAILABLE_TARGETS= parse-aadl
package PING
public
with Software;
with Deployment;
with ARINC653;
---------------
-- Processes --
---------------
process A
features
Data_Source : out event data port Software::Simple_Type;
end A;
process implementation A.Impl
subcomponents
Pinger : thread Software::P.Impl;
connections
port Pinger.Data_Source -> Data_Source;
end A.Impl;
process B
features
Data_Sink : in event data port Software::Simple_Type;
end B;
process implementation B.Impl
subcomponents
Ping_Me : thread Software::Q.Impl ;
connections
port Data_Sink -> Ping_Me.Data_Sink;
end B.Impl;
memory myram
end myram;
memory segment
end segment;
memory implementation segment.i
end segment.i;
memory implementation myram.stram
properties
Base_Address => 40000000;
Byte_Count => 4194304;
end myram.stram;
memory implementation myram.sdram
subcomponents
segment1 : memory segment.i
{Base_Address => 40100000; Byte_Count => 524288;};
segment2 : memory segment.i
{Base_Address => 40180000; Byte_Count => 524288;};
end myram.sdram;
processor leon3
end leon3;
virtual processor AIR_partition
end AIR_partition;
virtual processor implementation AIR_partition.generic
end AIR_partition.generic;
processor implementation leon3.AIR
properties
Deployment::Execution_Platform => AIR;
end leon3.AIR;
processor implementation leon3.AIR_2partitions extends leon3.AIR
subcomponents
part1 : virtual processor AIR_partition.generic
{ Deployment::Execution_Platform => AIR;};
part2 : virtual processor AIR_partition.generic
{ Deployment::Execution_Platform => AIR;};
properties
ARINC653::Module_Schedule =>
( [Partition => reference (part1);
Duration => 20 ms;
Periodic_Processing_Start => true;],
[Partition => reference (part2);
Duration => 10 ms;
Periodic_Processing_Start => true;]
);
ARINC653::Module_Major_Frame => 40ms;
end leon3.AIR_2partitions;
------------
-- System --
------------
system PING
end PING;
system implementation PING.IMA
subcomponents
Node_A : process A.Impl;
Node_B : process B.Impl;
memst : memory myram.stram;
mem : memory myram.sdram;
cpu : processor leon3.AIR_2partitions;
connections
port Node_A.Data_Source -> Node_B.Data_Sink;
properties
actual_processor_binding => (reference (cpu.part1)) applies to Node_A;
actual_processor_binding => (reference (cpu.part2)) applies to Node_B;
actual_memory_binding => (reference (mem.segment1)) applies to Node_A;
actual_memory_binding => (reference (mem.segment2)) applies to Node_B;
end PING.IMA;
end PING;
-- This AADL model illustrates how to model a simple interaction
-- between tasks, in a local or distributed environment.
--
-- One task pings another, sending a data periodically.
--
-- $Id: software.aadl 344 2007-04-17 14:48:16Z zalila $
package Software
public
with Data_Model;
----------
-- Data --
----------
data Simple_Type
properties
Type_Source_Name => "custom_int";
Source_Text => ("ping");
Source_Data_Size => 8 Bytes;
end Simple_Type;
-----------------
-- Subprograms --
-----------------
subprogram Do_Ping_Spg
features
Data_Source : out parameter Simple_Type;
properties
source_language => C;
source_name => "user_do_ping_spg";
source_text => ("ping.c");
end Do_Ping_Spg;
subprogram Ping_Spg
features
Data_Sink : in parameter Simple_Type;
properties
source_language => C;
source_name => "user_ping_spg";
source_text => ("ping.c");
end Ping_Spg;
-------------
-- Threads --
-------------
thread P
features
Data_Source : out event data port Simple_Type;
end P;
thread implementation P.Impl
calls
Mycalls: {
P_Spg : subprogram Do_Ping_Spg;
};
connections
parameter P_Spg.Data_Source -> Data_Source;
properties
Recover_Entrypoint_Source_Text => "recover";
Dispatch_Protocol => Periodic;
Period => 2000 Ms;
Deadline => 2000 ms;
Priority => 2;
Dispatch_Offset => 500 Ms;
end P.Impl;
thread Q
features
Data_Sink : in event data port Simple_Type;
end Q;
thread implementation Q.Impl
calls
Mycalls: {
Q_Spg : subprogram Ping_Spg;
};
connections
parameter Data_Sink -> Q_Spg.Data_Sink;
properties
Dispatch_Protocol => Sporadic;
Period => 10 Ms;
deadline => 10 Ms;
Priority => 1;
end Q.Impl;
end Software;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment