Commit c0141407 authored by Maxime Perrotin's avatar Maxime Perrotin
parents 3258af17 f1faf7ed
C_FILES = $(srcdir)/hello.c
AADL_FILES = $(srcdir)/rma.aadl \
$(srcdir)/rma-xenomai-posix.aadl \
$(srcdir)/rma-compcert.aadl \
$(srcdir)/rma-bench.aadl \
$(srcdir)/rma-xenomai-native.aadl
$(srcdir)/rma-xenomai-posix.aadl \
$(srcdir)/rma-bench.aadl \
$(srcdir)/rma-xenomai-native.aadl
SCENARIO_FILES = $(srcdir)/scenario.aadl \
$(srcdir)/scenario-compcert.aadl \
$(srcdir)/scenario-xenomai-native.aadl \
$(srcdir)/scenario-xenomai-posix.aadl \
$(srcdir)/scenario-rtems.aadl
$(srcdir)/scenario-compcert.aadl \
$(srcdir)/scenario-xenomai-native.aadl \
$(srcdir)/scenario-xenomai-posix.aadl \
$(srcdir)/scenario-rtems.aadl
# remove target, linux specific
# $(srcdir)/scenario-bench.aadl
......@@ -20,4 +18,3 @@ include $(srcdir)/../../Makefile.common
EXTRA_DIST = $(AADL_FILES) $(SCENARIO_FILES) $(C_FILES)
CLEANDIRS = rma_impl rma_rtems
-- This AADL model illustrates how to conduct schedulability analysis
-- using Cheddar, and then code generation of periodic tasks.
--
-- Two periodic tasks run in parrallel, without interaction. Tasks
-- parameters allows RMA analysis
--
-- $Id: rma.aadl 370 2007-04-23 14:54:41Z hugues $
package RMAAadl
public
with Deployment;
-----------------
-- Subprograms --
-----------------
subprogram Hello_Spg_1
properties
source_language => C;
source_name => "user_Hello_Spg_1";
source_text => ("hello.c");
end Hello_Spg_1;
subprogram Hello_Spg_2
properties
source_language => C;
source_name => "user_Hello_Spg_2";
source_text => ("hello.c");
end Hello_Spg_2;
-------------
-- Threads --
-------------
thread Task
end Task;
thread implementation Task.impl_1
calls
Mycalls: {
P_Spg : subprogram Hello_Spg_1;
};
properties
Dispatch_Protocol => periodic;
Period => 1000ms;
Compute_Execution_time => 0 ms .. 3 ms;
Deadline => 1000 ms;
Priority => 1;
end Task.impl_1;
thread implementation Task.impl_2
calls
Mycalls: {
P_Spg : subprogram Hello_Spg_2;
};
properties
Dispatch_Protocol => periodic;
Period => 500ms;
Compute_Execution_time => 0 ms .. 3 ms;
Deadline => 500 ms;
Priority => 2;
end Task.impl_2;
---------------
-- Processor --
---------------
processor cpurm
properties
Deployment::Execution_Platform => native_compcert;
end cpurm;
processor implementation cpurm.impl
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
end cpurm.impl;
---------------
-- Processes --
---------------
process node_a
end node_a;
process implementation node_a.impl
subcomponents
Task1 : thread Task.impl_1;
Task2 : thread Task.impl_2;
end node_a.impl;
------------
-- System --
------------
system rma
end rma;
system implementation rma.impl
subcomponents
node_a : process node_a.impl;
cpu_rm : processor cpurm.impl;
properties
Actual_Processor_Binding => (reference (cpu_rm)) applies to node_a;
end rma.impl;
end RMAAadl;
......@@ -100,6 +100,12 @@ public
Actual_Processor_Binding => (reference (cpu_rm)) applies to rma;
end rma.impl;
system implementation rma.compcert
extends rma.impl
properties
Deployment::Execution_Platform => native_compcert applies to cpu_rm;
end rma.compcert;
system implementation rma.Xenomai
extends rma.impl
properties
......
......@@ -8,7 +8,8 @@ public
Ocarina_Config::Referencial_Files =>
("node_a", "node_a.ref");
Ocarina_Config::AADL_Files =>
("rma-compcert.aadl");
("rma.aadl");
Ocarina_Config::Root_System_Name => "rma.compcert";
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets =>
(Ocarina_Config::Data_Model,
......
......@@ -8,7 +8,6 @@
#include <po_hi_transport.h>
#include <po_hi_gqueue.h>
/******************************************************************************/
/* In the case of the client-side of the RPC: the corresponding AADL
* subprogram is *NOT* connected to AADL thread ports. We interact
......@@ -34,18 +33,17 @@ void rpc_client (__po_hi_task_id self) {
&req);
__po_hi_send_output (self,REQUEST_PORT(client_t, out_parameter));
printf ("Client thread: sending parameter %d\n", i);
printf ("Client thread: sending parameter %d\n", i);
__po_hi_gqueue_wait_for_incoming_event(self, &return_value_port);
__po_hi_gqueue_get_value(self,return_value_port,&req);
__po_hi_gqueue_next_value(self,return_value_port);
printf ("Client received: %d\n",
req.PORT_VARIABLE(client_t,return_value));
i++;
printf ("[END of RPC]\n\n");
printf ("Client received: %d\n",
req.PORT_VARIABLE(client_t,return_value));
i++;
printf ("[END of RPC]\n\n");
}
/******************************************************************************/
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2014 ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2019 ESA & ISAE.
*/
#ifndef __PO_HI_TIME_H__
......@@ -14,11 +14,6 @@
#include <po_hi_types.h>
#ifndef HAVE_CLOCK_GETTIME
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
#else
#include <xlocale.h>
#endif
#include <time.h>
#endif
......
......@@ -10,7 +10,7 @@ EXTRA_DIST=$(builddir)/Makefile.common $(srcdir)/Makefile.leon3-xm3 \
$(srcdir)/Makefile.linux64 $(srcdir)/Makefile.win32 \
$(srcdir)/Makefile.x86.linuxtaste \
$(srcdir)/Makefile.template $(srcdir)/Makefile.freertos \
$(srcdir)/Makefile.air
$(srcdir)/Makefile.air $(srcdir)/polyorb_hi_c.gpr
CLEANFILES = *~
......
------------------------------------------------------------------------------
-- --
-- PolyORB HI COMPONENTS --
-- --
-- P O L Y O R B _ H I --
-- --
-- P r o j e c t --
-- --
-- Copyright (C) 2019 OpenAADL --
-- --
-- PolyORB-HI is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. PolyORB-HI is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- PolyORB-HI/C is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
-- Root project file for PolyORB-HI/C, to be used with GPRBuild
project PolyORB_HI_C is
-- Run with
-- gprbuild -p -P../polyorb-hi-c/make/polyorb_hi_c.gpr
-- -XTARGET=`uname` -XBUILD="Debug" -XBUILD_DIR=$PWD
-- -XUSER_INCLUDE_PATH=$PWD/../.. -XUSER_SRC=...
-- Configuration of the build is done through the following variables:
-- * TARGET
-- * BUILD
-- * BUILD_DIR
-- * USER_INCLUDE_PATH
-- * USER_SRC
-- TARGET: configuration of the target. Some compiler flags are
-- target-specific. Target must be passed on the command line
-- using either the uname command (for native builds), or the name
-- of the target (for cross builds). See below for valid values.
type Target_Type is ("Linux", "Darwin");
Target : Target_Type := external ("TARGET", "Linux");
-- BUILD: configuration of the build. Either "Debug" or "Release"
type Build_Type is ("Debug", "Release");
Build : Build_Type := external ("CFG", "Debug");
-- BUILD_DIR: build directory of the PolyORB-HI/C partition,
Build_Dir := external ("BUILD_DIR");
-- USER_INCLUDE_PATH is used to pass external directories to search
-- for source code, e.g. user-defined code
User_Include_Path := external_as_list("USER_INCLUDE_PATH", ":");
-- USER_SRC is the list of user-provided source files,
-- e.g. functional code for threads, driver code, etc.
User_Files := external_as_list("USER_SRC", ":");
----------------------------------------------------------------------------
-- The part below this line is generic for all projects
for Source_Dirs use
(Build_Dir,
Build_Dir & "/../polyorb-hi-c/src",
Build_Dir & "/../polyorb-hi-c/include")
& User_Include_Path;
for Object_Dir use Build_Dir & "/obj";
for Exec_Dir use Build_Dir;
for Languages use ("C");
for Main use ("main.c");
-- Common_Files is the set of PolyORB-HI/C source code, plus
-- generated code. These files should be the common set of
-- required files.
--
-- Other files should be brought as user-code through AADL
-- patterns for threads or device drivers.
Common_Files := ("po_hi_task.c", "po_hi_time.c", "po_hi_utils.c",
"po_hi_protected.c", "po_hi_monitor.c",
"po_hi_gqueue.c", "po_hi_semaphore.c",
"po_hi_storage.c", "po_hi_messages.c",
"po_hi_marshallers.c", "po_hi_utils.c",
"po_hi_transport.c", "po_hi_types.c",
"po_hi_monitor.c", "po_hi_main.c", "activity.c",
"subprograms.c", "deployment.c", "types.c",
"naming.c", "main.c");
for Source_Files use Common_Files & User_Files;
--------------------------
-- Target Configuration --
--------------------------
Target_CFLAGS := ();
Target_LDFLAGS := ();
-- POSIX-based targets, namely Linux and Darwin have various support
-- of POSIX, we have to adjust these by setting additional macros
case Target is
when "Linux" =>
Target_CFLAGS := ("-DTARGET=native", "-DPOSIX", "-D_POSIX_SOURCE",
"-D_GNU_SOURCE");
Target_LDFLAGS := ("-lpthread", "-lrt", "-lm");
when "Darwin" =>
Target_CFLAGS := ("-DTARGET=native", "-DPOSIX", "-D_XOPEN_SOURCE");
Target_LDFLAGS := ("-lpthread", "-lm");
end case;
--------------
-- Compiler --
--------------
-- Common compiler options
-- GCC warnings defaults, for more details see
-- https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Common_Options := ("-Wall",
"-Wextra",
"-fdiagnostics-show-option",
"-Wcast-align",
"-Wswitch");
Debug_Options := ("-g");
package Compiler is
case Build is
when "Release" =>
for Default_Switches ("C") use
Common_Options & Target_CFLAGS;
when "Debug" =>
for Default_Switches ("C") use
Common_Options & Debug_Options & Target_CFLAGS;
end case;
end Compiler;
------------
-- Linker --
------------
package Linker is
for Default_Switches ("C") use
("-g") & Target_LDFLAGS;
end Linker;
end PolyORB_HI_C;
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2019 ESA & ISAE.
*/
#include <po_hi_config.h>
......@@ -14,10 +14,6 @@
/* Headers from PolyORB-HI-C */
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API) || defined (FREERTOS)
#else
#include <xlocale.h>
#endif
#include <string.h>
/* Headers from the executive */
......@@ -35,8 +31,8 @@ void __po_hi_msg_reallocate (__po_hi_msg_t* message)
}
void __po_hi_msg_write (__po_hi_msg_t* msg,
void* data,
__po_hi_uint32_t len)
void* data,
__po_hi_uint32_t len)
{
memcpy (msg->content, data, len);
msg->length = len;
......@@ -48,11 +44,11 @@ int __po_hi_msg_length (__po_hi_msg_t* msg)
void __po_hi_msg_copy (__po_hi_msg_t* dest,
__po_hi_msg_t* src)
__po_hi_msg_t* src)
{
memcpy (dest->content,
src->content,
__PO_HI_MESSAGES_MAX_SIZE);
src->content,
__PO_HI_MESSAGES_MAX_SIZE);
dest->length = src->length;
}
......@@ -157,22 +153,22 @@ void __po_hi_messages_debug (__po_hi_msg_t* msg)
if (Index_Hexa >= 45)
{
Hexa[Index_Hexa] = '\0';
ASCII[Index_ASCII] = '\0';
printf ("%s || %s\n", Hexa, ASCII);
Index_Hexa = 0;
Index_ASCII = 0;
for (i = 0 ; i < 50 ; i++)
Hexa[i] = ' ';
for (i = 0 ; i < 17 ; i++)
ASCII[i] = ' ';
Hexa[Index_Hexa] = '\0';
ASCII[Index_ASCII] = '\0';
printf ("%s || %s\n", Hexa, ASCII);
Index_Hexa = 0;
Index_ASCII = 0;
for (i = 0 ; i < 50 ; i++)
Hexa[i] = ' ';
for (i = 0 ; i < 17 ; i++)
ASCII[i] = ' ';
}
}
if (Index_Hexa > 0)
{
for (i = Index_Hexa ; i<44 ; i++)
Hexa[i] = ' ';
Hexa[i] = ' ';
Index_Hexa = 45;
Hexa[Index_Hexa] = '\0';
......
......@@ -5,13 +5,9 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2011-2017 ESA & ISAE.
* Copyright (C) 2011-2019 ESA & ISAE.
*/
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API) || defined (FREERTOS)
#else
#include <xlocale.h>
#endif
#include <string.h>
#include <po_hi_config.h>
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2019 ESA & ISAE.
*/
#if defined (__linux__) || defined (RTEMS412)
......@@ -35,7 +35,6 @@
#if defined (RTEMS_POSIX) || defined (POSIX) || defined (XENO_POSIX)
#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API)
#else
#include <xlocale.h>
#include <unistd.h>
#endif
......
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