[pok-devel] [20] * Add model for both distributed and local version |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/pok-devel Archives
]
Revision: 20
Author: julien
Date: 2011-09-21 21:46:19 +0200 (Wed, 21 Sep 2011)
Log Message:
-----------
* Add model for both distributed and local version
Modified Paths:
--------------
trunk/examples/case-study-osadl11/Makefile
trunk/examples/case-study-osadl11/model.aadl
Added Paths:
-----------
trunk/examples/case-study-osadl11/README
trunk/examples/case-study-osadl11/model-distributed.aadl
trunk/examples/case-study-osadl11/rtl8029.aadl
trunk/examples/case-study-osadl11/runtime.aadl
trunk/examples/case-study-osadl11/software.aadl
Modified: trunk/examples/case-study-osadl11/Makefile
===================================================================
--- trunk/examples/case-study-osadl11/Makefile 2011-08-28 06:50:48 UTC (rev 19)
+++ trunk/examples/case-study-osadl11/Makefile 2011-09-21 19:46:19 UTC (rev 20)
@@ -1,4 +1,4 @@
-BUILD = --models=model.aadl --no-run
+BUILD = --models=model.aadl,software.aadl --no-run
TESTS = compile-x86 compile-ppc compile-sparc
include $(POK_PATH)/misc/mk/examples.mk
Added: trunk/examples/case-study-osadl11/README
===================================================================
--- trunk/examples/case-study-osadl11/README (rev 0)
+++ trunk/examples/case-study-osadl11/README 2011-09-21 19:46:19 UTC (rev 20)
@@ -0,0 +1,13 @@
+Generate code :
+ocarina -g pok_c -f -aadlv2 model-distributed.aadl software.aadl rtl8029.aadl runtime.aadl
+
+
+
+Launch sender :
+qemu -kernel pok.elf -nographic -net nic,model=ne2k_pci,macaddr=00:1F:C6:BF:74:06 -net socket,listen=127.0.0.1:1234
+
+Launch receiver :
+qemu -kernel pok.elf -nographic -net nic,model=ne2k_pci,macaddr=00:0F:FE:5F:7B:2F -net socket,connect=127.0.0.1:1234
+
+To get output, edit deployment.h from the kernel and uncomment the line to get DEBUG
+
Added: trunk/examples/case-study-osadl11/model-distributed.aadl
===================================================================
--- trunk/examples/case-study-osadl11/model-distributed.aadl (rev 0)
+++ trunk/examples/case-study-osadl11/model-distributed.aadl 2011-09-21 19:46:19 UTC (rev 20)
@@ -0,0 +1,131 @@
+--
+-- POK header
+--
+-- The following file is a part of the POK project. Any modification should
+-- be made according to the POK licence. You CANNOT use this file or a part
+-- of a file for your own project.
+--
+-- For more information on the POK licence, please see our LICENCE FILE
+--
+-- Please follow the coding guidelines described in doc/CODING_GUIDELINES
+--
+-- Copyright (c) 2007-2011 POK team
+--
+-- Created by julien on Thu Jan 15 23:34:13 2009
+--
+
+
+package case_study_osal
+
+public
+
+with Data_Model;
+with rtl8029;
+with POK;
+with case_study_osal_software;
+with runtime;
+
+
+data integer
+properties
+ Data_Model::Data_Representation => integer;
+end integer;
+
+virtual processor partition
+properties
+ POK::Scheduler => RR;
+ POK::Recovery_Errors => (Numeric_Error, Illegal_Request);
+ POK::Recovery_Actions => (Partition_Restart, Partition_Restart);
+ POK::Additional_Features => (console, libc_stdio);
+end partition;
+
+virtual processor implementation partition.common
+properties
+ POK::Timeslice => 500 ms;
+ POK::Recovery_Errors => (Partition_Init, Partition_Scheduling);
+ POK::Recovery_Actions => (Partition_Stop, Partition_Stop);
+end partition.common;
+
+processor pok_kernel
+properties
+ POK::Architecture => x86;
+ POK::BSP => x86_qemu;
+ POK::Recovery_Errors => (Hardware_Fault);
+ POK::Recovery_Actions => (Kernel_Restart);
+end pok_kernel;
+
+processor implementation pok_kernel.i
+subcomponents
+ partition_app : virtual processor partition.common {POK::Additional_Features => (libc_stdlib, io, pci, libc_stdio, console);};
+ partition_drv : virtual processor partition.common {POK::Additional_Features => (libc_stdlib, io, pci, libc_stdio, console);};
+properties
+ POK::Major_Frame => 1000ms;
+ POK::Scheduler => static;
+ POK::Slots => (500ms, 500ms);
+ POK::Slots_Allocation => ( reference (partition_app),
+ reference (partition_drv));
+ POK::Recovery_Errors => (Kernel_Init, Kernel_Scheduling);
+ POK::Recovery_Actions => (Kernel_Stop, Kernel_Stop);
+ POK::Additional_Features => (console, libc_stdio, libc);
+end pok_kernel.i;
+
+memory segment
+properties
+ Word_Count => 80000;
+end segment;
+
+memory implementation segment.i
+end segment.i;
+
+memory ram
+end ram;
+
+memory implementation ram.i
+subcomponents
+ seg1: memory segment.i;
+ seg2: memory segment.i;
+end ram.i;
+
+system osal
+end osal;
+
+system implementation osal.i
+subcomponents
+ sender_cpu : processor pok_kernel.i;
+ sender : process case_study_osal_software::snd_prs.i;
+ sender_netif : device rtl8029::rtl8029.i {POK::Hw_Addr => "00:1F:C6:BF:74:06";};
+ sender_mem : memory ram.i;
+
+ receiver : process case_study_osal_software::recv_prs.i;
+ receiver_netif : device rtl8029::rtl8029.i {POK::Hw_Addr => "00:0F:FE:5F:7B:2F";};
+ receiver_cpu : processor pok_kernel.i;
+ receiver_mem : memory ram.i;
+
+ ethernet_bus : bus runtime::ethernet.unsecure;
+connections
+ port sender.pdataout -> sender_netif.incoming;
+ port sender_netif.outgoing -> receiver_netif.incoming;
+ port receiver_netif.outgoing -> receiver.pdatain;
+ bus access ethernet_bus -> sender_netif.ethernet_access;
+ bus access ethernet_bus -> receiver_netif.ethernet_access;
+properties
+ actual_processor_binding =>
+ (reference (receiver_cpu.partition_app)) applies to receiver;
+ actual_processor_binding =>
+ (reference (receiver_cpu.partition_drv)) applies to receiver_netif;
+ actual_processor_binding =>
+ (reference (sender_cpu.partition_app)) applies to sender;
+ actual_processor_binding =>
+ (reference (sender_cpu.partition_drv)) applies to sender_netif;
+
+ actual_memory_binding =>
+ (reference (sender_mem.seg1)) applies to sender;
+ actual_memory_binding =>
+ (reference (sender_mem.seg2)) applies to sender_netif;
+ actual_memory_binding =>
+ (reference (receiver_mem.seg1)) applies to receiver;
+ actual_memory_binding =>
+ (reference (receiver_mem.seg2)) applies to receiver_netif;
+end osal.i;
+
+end case_study_osal;
Modified: trunk/examples/case-study-osadl11/model.aadl
===================================================================
--- trunk/examples/case-study-osadl11/model.aadl 2011-08-28 06:50:48 UTC (rev 19)
+++ trunk/examples/case-study-osadl11/model.aadl 2011-09-21 19:46:19 UTC (rev 20)
@@ -20,14 +20,26 @@
public
with Data_Model;
+with case_study_osal_software;
with POK;
-
-data integer
+memory segment
properties
- Data_Model::Data_Representation => integer;
-end integer;
+ Word_Count => 80000;
+end segment;
+memory implementation segment.i
+end segment.i;
+
+memory ram
+end ram;
+
+memory implementation ram.i
+subcomponents
+ seg1: memory segment.i;
+ seg2: memory segment.i;
+end ram.i;
+
virtual processor partition
properties
POK::Scheduler => RR;
@@ -36,24 +48,7 @@
POK::Additional_Features => (console, libc_stdio);
end partition;
-subprogram snd_spg
-features
- output : out parameter integer;
-properties
- source_name => "user_send";
- source_language => C;
- POK::Source_Location => "../../../send.o";
-end snd_spg;
-subprogram recv_spg
-features
- input : in parameter integer;
-properties
- POK::Source_Location => "../../../receive.o";
- source_language => C;
- source_name => "user_receive";
-end recv_spg;
-
virtual processor implementation partition.common
properties
POK::Timeslice => 500 ms;
@@ -84,97 +79,16 @@
POK::Additional_Features => (console, libc_stdio, libc);
end pok_kernel.i;
-thread recv_thr
-features
- datain : in event data port integer;
-properties
- Dispatch_Protocol => Periodic;
- Recover_Execution_Time => 10 ms .. 20 ms;
- Period => 500 Ms;
-end recv_thr;
-thread send_thr
-features
- dataout : out event data port integer {Compute_Deadline => 40 ms;};
-properties
- Dispatch_Protocol => Periodic;
- Period => 1000 Ms;
- Recover_Execution_Time => 10 ms .. 20 ms;
-end send_thr;
-thread implementation send_thr.i
-calls
- call1 : { pspg : subprogram snd_spg;};
-connections
- parameter pspg.output -> dataout;
-properties
- POK::Recovery_Errors => (Deadline_Missed, Application_Error, Numeric_Error);
- POK::Recovery_Actions => (Thread_Restart, Thread_Restart, Partition_Restart);
-end send_thr.i;
-
-thread implementation recv_thr.i
-calls
- call1 : { pspg : subprogram recv_spg;};
-connections
- parameter datain -> pspg.input;
-properties
- POK::Recovery_Errors => (Deadline_Missed, Application_Error, Numeric_Error);
- POK::Recovery_Actions => (Thread_Restart, Thread_Restart, Partition_Restart);
-end recv_thr.i;
-
-process recv_prs
-features
- pdatain : in event data port integer;
-properties
- POK::Needed_Memory_Size => 120 Kbyte;
-end recv_prs;
-
-process snd_prs
-features
- pdataout : out event data port integer;
-properties
- POK::Needed_Memory_Size => 120 Kbyte;
-end snd_prs;
-
-process implementation recv_prs.i
-subcomponents
- thr : thread recv_thr.i;
-connections
- port pdatain -> thr.datain;
-end recv_prs.i;
-
-process implementation snd_prs.i
-subcomponents
- thr : thread send_thr.i;
-connections
- port thr.dataout -> pdataout;
-end snd_prs.i;
-
-memory segment
-properties
- Word_Count => 80000;
-end segment;
-
-memory implementation segment.i
-end segment.i;
-
-memory ram
-end ram;
-
-memory implementation ram.i
-subcomponents
- seg1: memory segment.i;
- seg2: memory segment.i;
-end ram.i;
-
system osal
end osal;
system implementation osal.i
subcomponents
cpu : processor pok_kernel.i;
- sender : process snd_prs.i;
- receiver : process recv_prs.i;
+ sender : process case_study_osal_software::snd_prs.i;
+ receiver : process case_study_osal_software::recv_prs.i;
mem : memory ram.i;
connections
port sender.pdataout -> receiver.pdatain;
Added: trunk/examples/case-study-osadl11/rtl8029.aadl
===================================================================
--- trunk/examples/case-study-osadl11/rtl8029.aadl (rev 0)
+++ trunk/examples/case-study-osadl11/rtl8029.aadl 2011-09-21 19:46:19 UTC (rev 20)
@@ -0,0 +1,103 @@
+--
+-- POK header
+--
+-- The following file is a part of the POK project. Any modification should
+-- be made according to the POK licence. You CANNOT use this file or a part
+-- of a file for your own project.
+--
+-- For more information on the POK licence, please see our LICENCE FILE
+--
+-- Please follow the coding guidelines described in doc/CODING_GUIDELINES
+--
+-- Copyright (c) 2007-2009 POK team
+--
+-- Created by julien on Mon May 18 18:44:51 2009
+--
+package rtl8029
+public
+with POK;
+with case_study_osal_software;
+with runtime;
+
+ data anydata
+ end anydata;
+
+ subprogram init
+ properties
+ source_name => "rtl8029_init";
+ source_language => C;
+ end init;
+
+ subprogram poll
+ properties
+ source_name => "rtl8029_polling";
+ source_language => C;
+ end poll;
+
+
+ thread thr_poller
+ properties
+ Dispatch_Protocol => Periodic;
+ Compute_Execution_Time => 0 ms .. 1 ms;
+ Period => 100 Ms;
+ end thr_poller;
+
+ thread implementation thr_poller.i
+ calls
+ call1 : { pspg : subprogram poll;};
+ end thr_poller.i;
+
+ thread thr_handler
+ features
+ outgoing : out data port case_study_osal_software::integer;
+ incoming : in data port case_study_osal_software::integer;
+ properties
+ Dispatch_Protocol => Periodic;
+ Compute_Execution_Time => 0 ms .. 1 ms;
+ Period => 1000 Ms;
+ Source_Code_Size => 3 Kbyte;
+ Source_Data_Size => 0 Kbyte;
+ Source_Stack_Size => 3000 Kbyte;
+ end thr_handler;
+
+ thread implementation thr_handler.i
+ connections
+ port incoming -> outgoing;
+ end thr_handler.i;
+
+ process driver
+ end driver;
+
+ process implementation driver.i
+ subcomponents
+ data_handler : thread thr_handler.i;
+ poller : thread thr_poller.i;
+ properties
+ POK::Needed_Memory_Size => 160 Kbyte;
+ end driver.i;
+
+ device rtl8029
+ features
+ outgoing : out data port case_study_osal_software::integer;
+ incoming : in data port case_study_osal_software::integer;
+ ethernet_access : requires bus access runtime::ethernet.unsecure;
+ properties
+ Initialize_Entrypoint => classifier (rtl8029::init);
+ POK::Device_Name => "rtl8029";
+ end rtl8029;
+
+ abstract driver_container
+ end driver_container;
+
+ abstract implementation driver_container.i
+ subcomponents
+ p : process driver.i;
+ end driver_container.i;
+
+
+ device implementation rtl8029.i
+ properties
+ Implemented_As => classifier (rtl8029::driver_container.i);
+ end rtl8029.i;
+
+end rtl8029;
Added: trunk/examples/case-study-osadl11/runtime.aadl
===================================================================
--- trunk/examples/case-study-osadl11/runtime.aadl (rev 0)
+++ trunk/examples/case-study-osadl11/runtime.aadl 2011-09-21 19:46:19 UTC (rev 20)
@@ -0,0 +1,31 @@
+--
+-- POK header
+--
+-- The following file is a part of the POK project. Any modification should
+-- be made according to the POK licence. You CANNOT use this file or a part
+-- of a file for your own project.
+--
+-- For more information on the POK licence, please see our LICENCE FILE
+--
+-- Please follow the coding guidelines described in doc/CODING_GUIDELINES
+--
+-- Copyright (c) 2007-2009 POK team
+--
+-- Created by julien on Tue Sep 22 13:45:12 2009
+--
+-- This file contains general purpose runtime components.
+
+package runtime
+
+public
+
+with POK;
+
+bus ethernet
+end ethernet;
+
+bus implementation ethernet.unsecure
+end ethernet.unsecure;
+
+
+end runtime;
Added: trunk/examples/case-study-osadl11/software.aadl
===================================================================
--- trunk/examples/case-study-osadl11/software.aadl (rev 0)
+++ trunk/examples/case-study-osadl11/software.aadl 2011-09-21 19:46:19 UTC (rev 20)
@@ -0,0 +1,98 @@
+package case_study_osal_software
+
+public
+
+with Data_Model;
+with POK;
+
+
+data integer
+properties
+ Data_Model::Data_Representation => integer;
+end integer;
+
+subprogram snd_spg
+features
+ output : out parameter integer;
+properties
+ source_name => "user_send";
+ source_language => C;
+ POK::Source_Location => "../../../send.o";
+end snd_spg;
+
+subprogram recv_spg
+features
+ input : in parameter integer;
+properties
+ POK::Source_Location => "../../../receive.o";
+ source_language => C;
+ source_name => "user_receive";
+end recv_spg;
+
+thread recv_thr
+features
+ datain : in event data port integer;
+properties
+ Dispatch_Protocol => Periodic;
+ Recover_Execution_Time => 10 ms .. 20 ms;
+ Period => 500 Ms;
+end recv_thr;
+
+thread send_thr
+features
+ dataout : out event data port integer {Compute_Deadline => 40 ms;};
+properties
+ Dispatch_Protocol => Periodic;
+ Period => 1000 Ms;
+ Recover_Execution_Time => 10 ms .. 20 ms;
+end send_thr;
+
+thread implementation send_thr.i
+calls
+ call1 : { pspg : subprogram snd_spg;};
+connections
+ parameter pspg.output -> dataout;
+properties
+ POK::Recovery_Errors => (Deadline_Missed, Application_Error, Numeric_Error);
+ POK::Recovery_Actions => (Thread_Restart, Thread_Restart, Partition_Restart);
+end send_thr.i;
+
+thread implementation recv_thr.i
+calls
+ call1 : { pspg : subprogram recv_spg;};
+connections
+ parameter datain -> pspg.input;
+properties
+ POK::Recovery_Errors => (Deadline_Missed, Application_Error, Numeric_Error);
+ POK::Recovery_Actions => (Thread_Restart, Thread_Restart, Partition_Restart);
+end recv_thr.i;
+
+process recv_prs
+features
+ pdatain : in event data port integer;
+properties
+ POK::Needed_Memory_Size => 120 Kbyte;
+end recv_prs;
+
+process snd_prs
+features
+ pdataout : out event data port integer;
+properties
+ POK::Needed_Memory_Size => 120 Kbyte;
+end snd_prs;
+
+process implementation recv_prs.i
+subcomponents
+ thr : thread recv_thr.i;
+connections
+ port pdatain -> thr.datain;
+end recv_prs.i;
+
+process implementation snd_prs.i
+subcomponents
+ thr : thread send_thr.i;
+connections
+ port thr.dataout -> pdataout;
+end snd_prs.i;
+
+end case_study_osal_software;