Commit df775abc authored by jdelange's avatar jdelange

* aadlv2/lua/ping.h

   - Add LUA variant of the ping example



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@3671 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent b8577b2e
LUA_FILES = $(srcdir)/hello.lua $(srcdir)/hello2.lua
AADL_FILES = \
$(srcdir)/lua-ping.aadl \
$(srcdir)/lua-simple.aadl
SCENARIO_FILES = \
$(srcdir)/scenario.aadl \
$(srcdir)/scenario-ping.aadl
include $(srcdir)/../../Makefile.common
EXTRA_DIST = $(AADL_FILES) $(SCENARIO_FILES) $(LUA_FILES)
CLEANDIRS = lua_impl lua_ping_local_i
package Software
public
with Data_Model;
----------
-- Data --
----------
data Simple_Type
properties
Type_Source_Name => "custom_int";
Data_Model::Data_Representation => Integer;
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 => lua;
source_name => "do_ping";
source_text => ("ping.lua");
end Do_Ping_Spg;
subprogram Ping_Spg
features
Data_Sink : in parameter Simple_Type;
properties
source_language => LUA;
source_name => "receive_ping";
source_text => ("ping.lua");
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
Dispatch_Protocol => Periodic;
Period => 10 Ms;
Deadline => 10 ms;
Priority => 2;
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;
package lua_ping
public
with Deployment;
with Software;
---------------
-- Processor --
---------------
processor the_processor
properties
Deployment::Execution_Platform => native;
end the_processor;
processor implementation the_processor.Impl
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255;
end the_processor.Impl;
---------------
-- Processes --
---------------
process A
end A;
process implementation A.Impl
subcomponents
Pinger : thread Software::P.Impl;
Ping_Me : thread Software::Q.Impl;
connections
port Pinger.Data_Source -> Ping_Me.Data_Sink;
end A.Impl;
------------
-- System --
------------
system lua_ping_local
end lua_ping_local;
system implementation lua_ping_local.i
subcomponents
Node_A : process A.Impl;
CPU : processor the_processor.Impl;
properties
actual_processor_binding => (reference (CPU)) applies to Node_A;
end lua_ping_local.i;
end lua_ping;
#ifndef __PING_H_
#define __PING_H_
typedef int custom_int;
#endif
print ("Hello from ping.lua");
data_source = 10;
function do_ping ()
data_source = math.random(1, 100);
end
function receive_ping (val)
print ("value : " .. val);
end
system lua_ping
properties
Ocarina_Config::Timeout_Property => 4000ms;
Ocarina_Config::AADL_Files =>
("lua-ping.aadl");
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;
end lua_ping;
system implementation lua_ping.i
end lua_ping.i;
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