[pok-devel] [16] * Fix model syntax and application code

[ Thread Index | Date Index | More lists.tuxfamily.org/pok-devel Archives ]


Revision: 16
Author:   julien
Date:     2011-08-27 18:42:19 +0200 (Sat, 27 Aug 2011)
Log Message:
-----------
 * Fix model syntax and application code

Modified Paths:
--------------
    trunk/examples/case-study-osadl11/model.aadl
    trunk/examples/case-study-osadl11/receive.c

Modified: trunk/examples/case-study-osadl11/model.aadl
===================================================================
--- trunk/examples/case-study-osadl11/model.aadl	2011-08-21 16:08:25 UTC (rev 15)
+++ trunk/examples/case-study-osadl11/model.aadl	2011-08-27 16:42:19 UTC (rev 16)
@@ -9,13 +9,13 @@
 --
 --  Please follow the coding guidelines described in doc/CODING_GUIDELINES
 --
---                                      Copyright (c) 2007-2009 POK team 
+--                                      Copyright (c) 2007-2011 POK team 
 --
 --  Created by julien on Thu Jan 15 23:34:13 2009 
 --
 
 
-package pingpong
+package case_study_osal
 
 public
 
@@ -28,178 +28,142 @@
   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);
+   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
+subprogram snd_spg
 features
    output : out parameter integer;
 properties
    source_name => "user_send";
    source_language => C;
    POK::Source_Location => "../../../send.o";
-end hello_part1;
+end snd_spg;
 
-subprogram hello_part2
+subprogram recv_spg
 features
    input : in parameter integer;
 properties
    POK::Source_Location => "../../../receive.o";
    source_language => C;
    source_name => "user_receive";
-end hello_part2;
+end recv_spg;
 
 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);
+   POK::Timeslice          => 500 ms;
+   POK::Recovery_Errors    => (Partition_Init, Partition_Scheduling);
+   POK::Recovery_Actions   => (Partition_Stop, Partition_Stop);
 end partition.common;
 
-processor ppc
+processor pok_kernel
 properties
    POK::Architecture => x86;
    POK::BSP => x86_qemu;
    POK::Recovery_Errors => (Hardware_Fault);
    POK::Recovery_Actions => (Kernel_Restart);
-end ppc;
+end pok_kernel;
 
-processor implementation ppc.impl
+processor implementation pok_kernel.i
 subcomponents
-   partition_secure : virtual processor partition.secure;
-   partition_common : virtual processor partition.common;
+   partition_sender     : virtual processor partition.common;
+   partition_receiver   : 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::Slots_Allocation => ( reference (partition_sender), 
+                              reference (partition_receiver));
    POK::Recovery_Errors => (Kernel_Init, Kernel_Scheduling);
    POK::Recovery_Actions => (Kernel_Stop, Kernel_Stop);
-end ppc.impl;
+end pok_kernel.i;
 
-thread receive_ping
+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 receive_ping;
+   Dispatch_Protocol       => Periodic;
+   Recover_Execution_Time  => 10 ms .. 20 ms;
+   Period                  => 500 Ms;
+end recv_thr;
 
-thread send_ping
+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_ping;
+   Dispatch_Protocol       => Periodic;
+   Period                  => 1000 Ms;
+   Recover_Execution_Time  => 10 ms .. 20 ms;
+end send_thr;
 
-thread implementation send_ping.impl
+thread implementation send_thr.i
 calls 
-   call1 : { pspg : subprogram hello_part1;};
+   call1 : { pspg : subprogram snd_spg;};
 connections
    parameter pspg.output -> dataout;
 properties
-   POK::Recovery_Errors => (Deadline_Missed, Application_Error);
-   POK::Recovery_Actions => (Thread_Restart, Thread_Restart);
-end send_ping.impl;
+   POK::Recovery_Errors => (Deadline_Missed, Application_Error, Numeric_Error);
+   POK::Recovery_Actions => (Thread_Restart, Thread_Restart, Partition_Restart);
+end send_thr.i;
 
-thread implementation receive_ping.impl
+thread implementation recv_thr.i
 calls 
-   call1 : { pspg : subprogram hello_part2;};
+   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 receive_ping.impl;
+end recv_thr.i;
 
-process receive_ping_process
+process recv_prs
 features
-   pdatain : in event data port integer {Allowed_Connection_Binding_Class => (classifier (pingpong::medium_bus)); Compute_Deadline => 30 ms;};
+   pdatain : in event data port integer;
 properties
-   Time_Slot => ( 2 );
    POK::Needed_Memory_Size => 120 Kbyte;
-end receive_ping_process;
+end recv_prs;
 
-process send_ping_process
+process snd_prs
 features
-   pdataout : out event data port integer
-      {Overflow_Handling_Protocol => DropOldest; 
-		 Allowed_Connection_Binding_Class => (classifier (pingpong::secure_bus));
-       Queue_Size => 2; 
-       };
+   pdataout : out event data port integer;
 properties
-   Time_Slot => ( 2 );
    POK::Needed_Memory_Size => 120 Kbyte;
-end send_ping_process;
+end snd_prs;
 
-process implementation receive_ping_process.impl
+process implementation recv_prs.i
 subcomponents
-   thr : thread receive_ping.impl;
+   thr : thread recv_thr.i;
 connections
    port pdatain -> thr.datain; 
-end receive_ping_process.impl;
+end recv_prs.i;
 
-process implementation send_ping_process.impl
+process implementation snd_prs.i
 subcomponents
-   thr : thread send_ping.impl;
+   thr : thread send_thr.i;
 connections
    port thr.dataout -> pdataout;
-end send_ping_process.impl;
+end snd_prs.i;
 
-system node
-end node;
+system osal
+end osal;
 
-system implementation node.impl
+system implementation osal.i
 subcomponents
-   cpu : processor ppc.impl;
-   pr1 : process send_ping_process.impl;
-   pr2 : process receive_ping_process.impl;
+   cpu      : processor pok_kernel.i;
+   sender   : process snd_prs.i;
+   receiver : process recv_prs.i;
 connections
-   port pr1.pdataout -> pr2.pdatain
-      {Allowed_Connection_Binding_Class => (classifier (pingpong::secure_bus));};
+   port sender.pdataout -> receiver.pdatain;
 properties
    actual_processor_binding => 
-      (reference (cpu.partition_secure)) applies to pr2;
+      (reference (cpu.partition_receiver)) applies to receiver;
    actual_processor_binding => 
-      (reference (cpu.partition_common)) applies to pr1;
-end node.impl;
+      (reference (cpu.partition_sender)) applies to sender;
+end osal.i;
 
-end pingpong;
+end case_study_osal;

Modified: trunk/examples/case-study-osadl11/receive.c
===================================================================
--- trunk/examples/case-study-osadl11/receive.c	2011-08-21 16:08:25 UTC (rev 15)
+++ trunk/examples/case-study-osadl11/receive.c	2011-08-27 16:42:19 UTC (rev 16)
@@ -18,7 +18,12 @@
 
 void user_receive (int t)
 {
-   int d = t >= 10 ? 0 : 1;
+   int d;
+   d = 1;
+   if (t == 10)
+   {
+      d = 0;
+   }
    printf ("Received value %d\n", t);
    printf("Computed value %d\n", t / d);
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/