[pok-devel] [14] Add exceptions-handled-osadl11 to the exemples. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/pok-devel Archives
]
Revision: 14
Author: coredumper
Date: 2011-08-21 18:04:15 +0200 (Sun, 21 Aug 2011)
Log Message:
-----------
Add exceptions-handled-osadl11 to the exemples.
Modified Paths:
--------------
trunk/examples/Makefile
Added Paths:
-----------
trunk/examples/exceptions-handled-osadl11/
trunk/examples/exceptions-handled-osadl11/Makefile
trunk/examples/exceptions-handled-osadl11/model.aadl
trunk/examples/exceptions-handled-osadl11/receive.c
trunk/examples/exceptions-handled-osadl11/send.c
Modified: trunk/examples/Makefile
===================================================================
--- trunk/examples/Makefile 2011-08-13 06:53:45 UTC (rev 13)
+++ trunk/examples/Makefile 2011-08-21 16:04:15 UTC (rev 14)
@@ -19,6 +19,7 @@
esterel \
events \
exceptions-handled \
+ exceptions-handled-osadl11 \
heterogeneous-partitions \
libmath \
lustre-academic \
Added: trunk/examples/exceptions-handled-osadl11/Makefile
===================================================================
--- trunk/examples/exceptions-handled-osadl11/Makefile (rev 0)
+++ trunk/examples/exceptions-handled-osadl11/Makefile 2011-08-21 16:04:15 UTC (rev 14)
@@ -0,0 +1,4 @@
+BUILD = --models=model.aadl --no-run
+TESTS = compile-x86 compile-ppc compile-sparc
+
+include $(POK_PATH)/misc/mk/examples.mk
Added: trunk/examples/exceptions-handled-osadl11/model.aadl
===================================================================
--- trunk/examples/exceptions-handled-osadl11/model.aadl (rev 0)
+++ trunk/examples/exceptions-handled-osadl11/model.aadl 2011-08-21 16:04:15 UTC (rev 14)
@@ -0,0 +1,205 @@
+--
+-- 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 Thu Jan 15 23:34:13 2009
+--
+
+
+package pingpong
+
+public
+
+with Data_Model;
+with POK;
+
+
+data integer
+properties
+ Data_Model::Data_Representation => integer;
+end integer;
+
+virtual bus secure_bus
+properties
+ POK::security_level => 10;
+ Required_Connection_Quality_Of_Service => (SecureDelivery);
+end secure_bus;
+
+virtual bus medium_bus
+properties
+ POK::security_level => 8;
+ Required_Connection_Quality_Of_Service => (SecureDelivery);
+end medium_bus;
+
+
+virtual bus common_bus
+properties
+ POK::security_level => 1;
+ Required_Connection_Quality_Of_Service => (SecureDelivery);
+end common_bus;
+
+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.secure
+properties
+ Provided_Virtual_Bus_Class =>
+ (classifier (pingpong::secure_bus));
+ POK::Timeslice => 500 ms;
+ POK::Recovery_Errors => (Partition_Init, Partition_Scheduling);
+ POK::Recovery_Actions => (Partition_Stop, Partition_Stop);
+end partition.secure;
+
+subprogram hello_part1
+features
+ output : out parameter integer;
+properties
+ source_name => "user_send";
+ source_language => C;
+ POK::Source_Location => "../../../send.o";
+end hello_part1;
+
+subprogram hello_part2
+features
+ input : in parameter integer;
+properties
+ POK::Source_Location => "../../../receive.o";
+ source_language => C;
+ source_name => "user_receive";
+end hello_part2;
+
+virtual processor implementation partition.common
+properties
+ Provided_Virtual_Bus_Class =>
+ (classifier (pingpong::common_bus));
+ POK::Timeslice => 500 ms;
+ POK::Recovery_Errors => (Partition_Init, Partition_Scheduling);
+ POK::Recovery_Actions => (Partition_Stop, Partition_Stop);
+end partition.common;
+
+processor ppc
+properties
+ POK::Architecture => x86;
+ POK::BSP => x86_qemu;
+ POK::Recovery_Errors => (Hardware_Fault);
+ POK::Recovery_Actions => (Kernel_Restart);
+end ppc;
+
+processor implementation ppc.impl
+subcomponents
+ partition_secure : virtual processor partition.secure;
+ partition_common : virtual processor partition.common;
+properties
+ POK::Major_Frame => 1000ms;
+ POK::Scheduler => static;
+ POK::Slots => (500ms, 500ms);
+ POK::Slots_Allocation => ( reference (partition_secure), reference (partition_common));
+ POK::Recovery_Errors => (Kernel_Init, Kernel_Scheduling);
+ POK::Recovery_Actions => (Kernel_Stop, Kernel_Stop);
+end ppc.impl;
+
+thread receive_ping
+features
+ datain : in event data port integer;
+properties
+ Dispatch_Protocol => Periodic;
+ Recover_Execution_Time => 10 ms .. 20 ms;
+ Period => 500 Ms;
+end receive_ping;
+
+thread send_ping
+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_ping;
+
+thread implementation send_ping.impl
+calls
+ call1 : { pspg : subprogram hello_part1;};
+connections
+ parameter pspg.output -> dataout;
+properties
+ POK::Recovery_Errors => (Deadline_Missed, Application_Error);
+ POK::Recovery_Actions => (Thread_Restart, Thread_Restart);
+end send_ping.impl;
+
+thread implementation receive_ping.impl
+calls
+ call1 : { pspg : subprogram hello_part2;};
+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 receive_ping.impl;
+
+process receive_ping_process
+features
+ pdatain : in event data port integer {Allowed_Connection_Binding_Class => (classifier (pingpong::medium_bus)); Compute_Deadline => 30 ms;};
+properties
+ Time_Slot => ( 2 );
+ POK::Needed_Memory_Size => 120 Kbyte;
+end receive_ping_process;
+
+process send_ping_process
+features
+ pdataout : out event data port integer
+ {Overflow_Handling_Protocol => DropOldest;
+ Allowed_Connection_Binding_Class => (classifier (pingpong::secure_bus));
+ Queue_Size => 2;
+ };
+properties
+ Time_Slot => ( 2 );
+ POK::Needed_Memory_Size => 120 Kbyte;
+end send_ping_process;
+
+process implementation receive_ping_process.impl
+subcomponents
+ thr : thread receive_ping.impl;
+connections
+ port pdatain -> thr.datain;
+end receive_ping_process.impl;
+
+process implementation send_ping_process.impl
+subcomponents
+ thr : thread send_ping.impl;
+connections
+ port thr.dataout -> pdataout;
+end send_ping_process.impl;
+
+system node
+end node;
+
+system implementation node.impl
+subcomponents
+ cpu : processor ppc.impl;
+ pr1 : process send_ping_process.impl;
+ pr2 : process receive_ping_process.impl;
+connections
+ port pr1.pdataout -> pr2.pdatain
+ {Allowed_Connection_Binding_Class => (classifier (pingpong::secure_bus));};
+properties
+ actual_processor_binding =>
+ (reference (cpu.partition_secure)) applies to pr2;
+ actual_processor_binding =>
+ (reference (cpu.partition_common)) applies to pr1;
+end node.impl;
+
+end pingpong;
Added: trunk/examples/exceptions-handled-osadl11/receive.c
===================================================================
--- trunk/examples/exceptions-handled-osadl11/receive.c (rev 0)
+++ trunk/examples/exceptions-handled-osadl11/receive.c 2011-08-21 16:04:15 UTC (rev 14)
@@ -0,0 +1,24 @@
+/*
+ * POK header
+ *
+ * The following file is a part of the POK project. Any modification should
+ * made according to the POK licence. You CANNOT use this file or a part of
+ * this file is this 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) 2011 POK team
+ */
+
+
+#include <types.h>
+#include <libc/stdio.h>
+
+void user_receive (int t)
+{
+ int d = t >= 10 ? 0 : 1;
+ printf ("Received value %d\n", t);
+ printf("Computed value %d\n", t / d);
+}
Added: trunk/examples/exceptions-handled-osadl11/send.c
===================================================================
--- trunk/examples/exceptions-handled-osadl11/send.c (rev 0)
+++ trunk/examples/exceptions-handled-osadl11/send.c 2011-08-21 16:04:15 UTC (rev 14)
@@ -0,0 +1,26 @@
+/*
+ * POK header
+ *
+ * The following file is a part of the POK project. Any modification should
+ * made according to the POK licence. You CANNOT use this file or a part of
+ * this file is this 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) 2011 POK team
+ */
+
+
+#include <types.h>
+#include <libc/stdio.h>
+
+int n = 1;
+
+void user_send (int* t)
+{
+ *t = n;
+ printf ("Sent value %d\n", n);
+ n++;
+}