Commit 3c01bdab by Maxime Perrotin

Merge branch 'master' into crazyflie

parents 83d9667d f1dd15d1
......@@ -49,3 +49,6 @@
[submodule "components_library"]
path = components_library
url = https://gitrepos.estec.esa.int/taste/components_library
[submodule "upython-taste"]
path = upython-taste
url = https://gitrepos.estec.esa.int/taste/uPython-mirror.git
#!/bin/bash
if ! command -v docker ; then
echo "[x] You don't have Docker installed. Aborting..."
exit 1
fi
docker images | grep ^taste > /dev/null || {
echo "[x] You haven't built the TASTE Docker container."
echo '[x] You need to execute this to create it:'
echo '[x]'
echo '[x] docker build -t taste .'
echo '[x]'
exit 1
}
echo '[-] ==========================================='
echo '[-] Both Docker and the TASTE image were found.'
echo '[-] You will be able to run all TASTE applications, including X11 ones,'
echo -e "[-] and \e[1m\e[31m your \$HOME folder is mapped under /root/work (save files ONLY\e[0m"
echo -e "[-]\e[1m\e[31m there, everything else will be deleted when the container dies).\e[0m"
echo -e '[-] Also, \e[1m\e[32m the TASTE repositories are under /root/tool-src.\e[0m'
echo '[-]'
echo '[-] Launching the TASTE Docker container...'
echo '[-]'
HOMEB=/root
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch ${XAUTH}
xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f ${XAUTH} nmerge -
export TASTE_IN_DOCKER=1
docker run \
--privileged \
-e DISPLAY \
-e TASTE_IN_DOCKER \
-e XAUTHORITY=${XAUTH} \
-v ${XSOCK}:${XSOCK} \
-v ${XAUTH}:${XAUTH} \
-v "$HOME":"$HOMEB"/work \
-it taste /bin/bash -i
#
# Process this Dockerfile with:
#
# docker build -t taste .
#
# And then run a fresh TASTE container with proper X11 redirection, with...
#
# ./Docker-run.sh
#
FROM debian:stretch
RUN apt-get update
RUN apt-get -y install netcat net-tools wget
# There is immense waste of re-downloading the .deb files
# in every attempt to setup the Docker image.
# The following uses a locally-provided proxy
# that will make sure the .deb files are only downloaded once,
# and are re-used in all subsequent attempts to build the image.
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
&& (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
&& (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
|| echo "No squid-deb-proxy detected on docker host"
RUN bash -c 'export DEBIAN_FRONTEND=noninteractive ; apt-get -y install git sudo'
RUN bash -c 'cd /root ; git clone https://gitrepos.estec.esa.int/taste/taste-setup.git tool-src'
# The following pieces correspond to the execution of Update-TASTE.sh ;
# but the execution has to be broken down into steps, so that Docker
# can resume the build from whichever step failed in the last attempt.
RUN bash -c 'cd /root/tool-src ; git submodule init ; git submodule update'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/01_sudo.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/03_debian.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/04_pythonlibs.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/05_antlr.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/06_stlink.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/10_dmt.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/15_asn1scc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/20_msc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/30_qemu.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/39_tasteconfig.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/40_ocarina.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/45_pohi.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/50_opengeode.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/53_pymsc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/54_speedometer.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/55_asn1valueEditor.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/56_msc-editor.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/60_buildsupport.sh'
# Those that need postgres can set it up themselves (avoid creating huge Docker image)
# RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/65_postgres.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/70_taste-model-checker.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/80_build-scripts.sh'
# Those that need RTEMS can set it up themselves (avoid creating huge Docker image)
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/85_rtems.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/90_misc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/91_env.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/95_components_library.sh'
RUN bash -c 'cd /bin ; sudo rm sh ; sudo ln -s bash sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/96_ZestSC1.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/97_upython.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/98_bash.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/99_paths.sh'
RUN bash -c 'echo ". ~/.bashrc.taste" >> /root/.bashrc'
# Deal with insane bugs in QT when redirecting X11 from a container
RUN bash -c 'echo "export QT_X11_NO_MITSHM=1" >> /root/.bashrc'
# And make sure the message queues of the container are large enough for TASTE GUIs
RUN bash -c 'echo "echo 100 > /proc/sys/fs/mqueue/msg_max" >> /root/.bashrc'
#
#
# At this point, you can start a fresh TASTE container with proper X11 redirection, with...
#
# ./Docker-run.sh
#
......@@ -4,7 +4,62 @@ TASTE
This is the meta package that is used to install all git modules required
to make a TASTE installation.
To install:
Installation
============
$ git clone --recursive https://gitrepos.estec.esa.int/taste/taste-setup.git
TASTE Virtual Machine
---------------------
If possible, please use the TASTE VM - it is available at [http://taste.tools](http://taste.tools)
(follow the 'Downloads' link and download the .ova file - that's a VirtualBox
machine that you can import via VirtualBox's *"File/Import Appliance"*).
Docker container
----------------
The repository includes a Dockerfile, that creates a fully functional "taste" Docker image,
built from the sources necessary in all the submodules.
Simply Process this Dockerfile with:
docker build -t taste .
And we then recommend to launch a fresh TASTE container with proper X11 redirection setup, with...
./Docker-run.sh
This script does all the necessary setup to map your local X11 socket inside the container,
allowing you to use X11 applications. In addition, your `$HOME` folder is mapped inside the
container under the `/root/work` folder, so any work you do in there will survive the
container's eventual closing. As with all Docker containers, you can also commit the
changes you perform in your container (via `docker commit...`) and create your own
customized images.
For users where the TASTE VM is a concern for reasons of security *(e.g. uncertainty of what
exactly is included inside it)* the Docker container is a complete and clear answer:
it is built from source, so there is full visibility on what is inside it.
In Debian-based distributions
-----------------------------
In theory, under a modern Debian-based distribution a native install is also possible:
you would start by creating a new 'taste' user, and...
$ git clone https://gitrepos.estec.esa.int/taste/taste-setup.git tool-src
$ cd tool-src
$ ./Update-TASTE.sh
You'd then have to follow the prompts to fix whatever issues are detected in your configuration.
In any native distribution offering `debootstrap`
-------------------------------------------------
Since the installation scripts depend on Debian tools, the setup process only works as-is inside environments that are Debian-based. Note however that almost all distributions offer `debootstrap` - a tool that allows the setup of a complete Debian chroot:
# mkdir /opt/jessie-chroot
# debootstrap jessie /opt/jessie-chroot
# mount -t proc none /opt/jessie-chroot/proc/
# mount -t sysfs none /opt/jessie-chroot/sys/
# mount -o bind /dev /opt/jessie-chroot/dev/
# mount -o bind /dev/pts /opt/jessie-chroot/dev/pts/
# chroot /opt/jessie-chroot
At this point, you can continue with the normal process described above for Debian-based distributions - for (almost) all intents and purposes, this chroot will behave just like a native Debian install; and thus allows you to have a "sandboxed" TASTE install that will not interfere with your main distribution.
In fact, this is reason enough to employ this process even if you do have a Debian-based distribution; the chroot will contain all TASTE-related work, and will therefore leave your main distribution undisturbed.
......@@ -5,6 +5,12 @@ git submodule update || exit 1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export DISABLE_TASTE_BANNER=1
for INSTALL_SCRIPT in install/[0-9]*sh ; do
if [ ! -z "${TASTE_IN_DOCKER}" ] ; then
if [ "${INSTALL_SCRIPT}" == "install/65_postgres.sh" ] ; then
echo Skipping over postgres installation in Docker container.
continue
fi
fi
${INSTALL_SCRIPT} || { echo Failed in execution of "${INSTALL_SCRIPT}" ; exit 1 ; }
done
echo "Please close this terminal and open a new one (to"
......
function InstallBSP() {
DESCRIPTION="$1"
URL="$2"
BASE="$3"
FOLDER="${BASE}/$4"
echo '[-] This will install '"${DESCRIPTION}"','
echo '[-] under:'
echo '[-] '
echo '[-] '"${FOLDER}"
echo '[-] '
[ -e "${FOLDER}" ] && { \
echo '[-] It will remove anything that is currently there.'
echo '[-] '
}
echo -n '[-] Are you sure you want this? (y/n) '
read -r ANS
if [ "$ANS" != "y" ] ; then
echo '[-] Response was not "y", aborting...'
exit 1
fi
sudo rm -rf "${FOLDER}" 2>/dev/null
wget -q -O - "${URL}" | \
( cd "${BASE}" || exit 1 ; sudo tar jxvf - )
}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. "${DIR}/common.sh"
echo "[-] Checking if Gaisler's RTEMS 4.10 is already under /opt/rtems-4.10..."
if [ -e /opt/rtems-4.10 ] ; then
echo '[-] /opt/rtems-4.10 is there already. Aborting...'
exit 1
fi
echo "[-] Downloading and uncompressing Gaisler's RTEMS 4.10..."
echo "[-]"
cd /opt || exit 1
wget -q -O - http://www.gaisler.com/j25/anonftp/rcc/bin/linux/sparc-rtems-4.10-gcc-4.4.6-1.2.21-linux.tar.bz2 | sudo tar jxvf -
if [ $? -ne 0 ] ; then
echo "Downloading Gaisler's RTEMS 4.10 toolchain has failed."
echo Aborting...
exit 1
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. "${DIR}/common.sh"
InstallBSP \
"a generic non-SMP Leon2 BSP, without support for native FPU" \
"https://download.tuxfamily.org/taste/RTEMS/leon2-nfpu-nsmp.tar.bz2" \
"/opt/rtems-4.12-2017.07.17/sparc-rtems4.12" \
"leon2"
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. "${DIR}/common.sh"
InstallBSP \
"a generic non-SMP Leon3 BSP, with support for FPU" \
"https://download.tuxfamily.org/taste/RTEMS/leon3-fpu-nsmp.tar.bz2" \
"/opt/rtems-4.12-2017.07.17/sparc-rtems4.12" \
"leon3"
Subproject commit 0e47ad76475dab305ee14ebe6c3eb905fdfaee81
Subproject commit 222c849f0e1cd70e15047f35879d0620ca7f55e2
Subproject commit 1ee8e6ce651d57e4f20cb78f721709852fa88fdd
Subproject commit b8325b933e8bcae2a6bbc63ffcca8887bc78c164
machine:
services:
- docker
dependencies:
cache_directories:
- "~/docker"
override:
- docker info
- if [[ -e ~/docker/image.tar ]]; then docker load --input ~/docker/image.tar; else docker build -t taste . && { mkdir -p ~/docker; docker save taste > ~/docker/image.tar ; } ; fi:
timeout: 3600
test:
override:
- HOMEB=/root ; XSOCK=/tmp/.X11-unix ; XAUTH=/tmp/.docker.xauth ; touch ${XAUTH} ; xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f ${XAUTH} nmerge - ; HOME=/root ; export TASTE_IN_DOCKER=1 ; docker run --privileged -e DISPLAY -e HOME -e TASTE_IN_DOCKER -e XAUTHORITY=${XAUTH} -v ${XSOCK}:${XSOCK} -v ${XAUTH}:${XAUTH} -v "$HOME":"$HOMEB"/work -it taste /bin/bash -c 'cd /root/ ; . .bashrc.taste ; cd tool-src ; ./Update-TASTE.sh || exit 1 ; cd testSuites ; ./regression.py || exit 1':
timeout: 3600
Subproject commit 71f95c255643069dc6dfc40be7bbd009c34e9d95
Subproject commit b3d442be61069e09a73d660c2e7b8088bd6583a8
Subproject commit 7fee05cb097f965036d990f4763c4db08f4a2d59
Subproject commit f53ffdb37c7f33f331324a0b49b73c8a958e3174
1) edit ocarina_components.aadl and look for this pattern:
--------------------------------------------------
-- USB BRICK (STAR DUNDEE) DEVICE FOR SPACEWIRE --
--------------------------------------------------
2) below this section, add the following to declare the 2 new drivers for two SPW ports:
---------------------------------------------------
-- CUSTOM DRIVER TO SIMULATE SPW PORT A OF GR740 --
---------------------------------------------------
device gr740_spw_a
features
link : requires bus access ocarina_buses::spacewire.generic;
end gr740_spw_a;
device implementation gr740_spw_a.pohic
properties
Deployment::Driver_Name => "gr740_spw_a";
Device_Driver => classifier (ocarina_drivers_gr740_spw_a::driver.gr740_spw_a);
Initialize_Entrypoint => classifier (ocarina_drivers_gr740_spw_a::spw_a_init);
Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c));
end gr740_spw_a.pohic;
---------------------------------------------------
-- CUSTOM DRIVER TO SIMULATE SPW PORT B OF GR740 --
---------------------------------------------------
device gr740_spw_b
features
link : requires bus access ocarina_buses::spacewire.generic;
end gr740_spw_b;
device implementation gr740_spw_b.pohic
properties
Deployment::Driver_Name => "gr740_spw_b";
Device_Driver => classifier (ocarina_drivers_gr740_spw_b::driver.gr740_spw_b);
Initialize_Entrypoint => classifier (ocarina_drivers_gr740_spw_b::spw_b_init);
Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c));
end gr740_spw_b.pohic;
!!pay attention to the Driver_Name!!
we have to define the devices in packages named "ocarina_drivers_gr740_spw_a / b"
3) look for that pattern in the file:
with ocarina_drivers_star_dundee_spacewire_brick;
4) just below, add:
with ocarina_drivers_gr740_spw_a;
with ocarina_drivers_gr740_spw_b;
5) look for that pattern:
package ocarina_drivers_star_dundee_spacewire_brick
6) below that patten section, add:
package ocarina_drivers_gr740_spw_a
public
with ocarina_buses;
with Deployment;
subprogram spw_a_poller
properties
Source_Language => (C);
Source_Name => "__po_hi_c_driver_gr740_spw_a_poller";
end spw_a_poller;
subprogram spw_a_sender
properties
Source_Language => (C);
Source_Name => "__po_hi_c_driver_gr740_spw_a_sender";
end spw_a_sender;
subprogram spw_a_init
properties
Source_Language => (C);
Source_Name => "__po_hi_c_driver_gr740_spw_a_init";
end spw_a_init;
thread thr_poller
end thr_poller;
thread implementation thr_poller.i
calls
mycall : {
pspg : subprogram spw_a_poller;
};
properties
Period => 1000ms;
Dispatch_Protocol => Periodic;
end thr_poller.i;
abstract driver
properties
Deployment::Version => "0.1beta";
Deployment::Help => "Write your ASN.1 configuration here";
Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_spacewire);
end driver;
abstract implementation driver.gr740_spw_a
subcomponents
receiver_rasta_spacewire : thread thr_poller.i;
sender : subprogram spw_a_sender;
end driver.gr740_spw_a;
end ocarina_drivers_gr740_spw_a;
package ocarina_drivers_gr740_spw_b
public
with ocarina_buses;
with Deployment;
subprogram spw_b_poller
properties
Source_Language => (C);
Source_Name => "__po_hi_c_driver_gr740_spw_b_poller";
end spw_b_poller;
subprogram spw_b_sender
properties
Source_Language => (C);
Source_Name => "__po_hi_c_driver_gr740_spw_b_sender";
end spw_b_sender;
subprogram spw_b_init
properties
Source_Language => (C);
Source_Name => "__po_hi_c_driver_gr740_spw_b_init";
end spw_b_init;
thread thr_poller
end thr_poller;
thread implementation thr_poller.i
calls
mycall : {
pspg : subprogram spw_b_poller;
};
properties
Period => 1000ms;
Dispatch_Protocol => Periodic;
end thr_poller.i;
abstract driver
properties
Deployment::Version => "0.1beta";
Deployment::Help => "Write your ASN.1 configuration here";
Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_spacewire);
end driver;
abstract implementation driver.gr740_spw_b
subcomponents
receiver_rasta_spacewire : thread thr_poller.i;
sender : subprogram spw_b_sender;
end driver.gr740_spw_b;
end ocarina_drivers_gr740_spw_b;
6) for the moment note this line:
Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_spacewire);
It is defined in the file like this:
data configuration_type_spacewire
properties
Type_Source_Name => "Spacewire-Conf-T";
Deployment::ASN1_Module_Name => "POHICDRIVER-SPACEWIRE";
Source_Language => (ASN1);
Source_Text => ("/home/taste/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/spacewire.asn", "drivers/configuration/spacewire.h");
end configuration_type_spacewire;
This can be modified to add a custom type for the configuration of our device ...
7) go to ~/tool-src/polyorb-hi-c/src/drivers
Create (or copy from another driver) the C code of the driver
name of the file: po_hi_driver_gr740_spw_a.c
// The following pattern is __PO_HI_NEED_DRIVER_<Driver_Name>
// the Driver_Name is in the AADL file (Deployment::Driver_Name)
// Then the definition will be done in deployment.h automatically
#ifdef __PO_HI_NEED_DRIVER_GR740_SPW_A
8) go to ~/tool-src/polyorb-hi-c/include/drivers
Create (or copy from another driver) the include file of the driver
name of the file: po_hi_driver_gr740_spw_a.h
9) The drivers must be copied to:
/home/taste/tool-inst/include/ocarina/runtime/polyorb-hi-c/include/drivers/ (.h files)
and
/home/taste/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers (.c files)
This is normally done by the Makefile in pohic/src/drivers
the following two files must be completed with the new driver names (.c and .o):
Makefile.common.in in tool-src/polyorb-hi-c/share/make (add the .o)
Makefile.am in tool-srtc/polyorb-hi-c/src/drivers (add the .c)
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2017 ESA
*/
#include <deployment.h>
/* Generated code header */
// The following pattern is __PO_HI_NEED_DRIVER_<Driver_Name>
// the Driver_Name is in the AADL file (Deployment::Driver_Name)
// Then the definition will be done in deployment.h automatically
#ifdef __PO_HI_NEED_DRIVER_GR740_SPW_A
#include <activity.h>
#include <marshallers.h>
#include <deployment.h>
#include <po_hi_debug.h>
#include <po_hi_transport.h>
#include <po_hi_gqueue.h>
#include <po_hi_messages.h>
#include <po_hi_returns.h>
#include <drivers/po_hi_driver_gr740_spw_a.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
/* POSIX-style files */
//__po_hi_request_t __po_hi_c_driver_gr740_spw_a_request;
//__po_hi_msg_t __po_hi_c_driver_gr740_spw_a_poller_msg;
void __po_hi_c_driver_gr740_spw_a_poller (const __po_hi_device_id dev_id)
{
printf("[SPW_A_Port] Polling (in fact doing nothing)\n");
// __po_hi_c_driver_gr740_spw_a_poller_msg.length = n;
// __po_hi_unmarshall_request (&__po_hi_c_driver_gr740_spw_a_request, &__po_hi_c_driver_gr740_spw_a_poller_msg);
// __po_hi_main_deliver (&__po_hi_c_driver_gr740_spw_a_request);
}
void __po_hi_c_driver_gr740_spw_a_init (__po_hi_device_id id)
{
int i;
__po_hi_c_spacewire_conf_t* drv_conf; // instance of ASN.1 type with the configuration
printf("[SPW_A_Port] Initializing\n");
drv_conf = (__po_hi_c_spacewire_conf_t*) __po_hi_get_device_configuration (id);
__po_hi_transport_set_sending_func (id, __po_hi_c_driver_gr740_spw_a_sender);
printf("[SPW_A_Port] Device Name = %s\n", drv_conf->devname);
}
// I hope there can't be simultaneous callers....
__po_hi_msg_t __po_hi_c_driver_gr740_spw_a_sender_msg;
int __po_hi_c_driver_gr740_spw_a_sender (const __po_hi_task_id task_id, const __po_hi_port_t port)
{
int n;
int ts;
uint8_t buf[__PO_HI_MESSAGES_MAX_SIZE+1];
unsigned long* swap_pointer;
unsigned long swap_value;
__po_hi_local_port_t local_port;
__po_hi_request_t* request;
__po_hi_port_t destination_port;
__po_hi_device_id dev_id;
__po_hi_device_id remote_device;
__po_hi_c_spacewire_conf_t* remote_drv_conf; // instance of ASN.1 type with the configuration
dev_id = __po_hi_get_device_from_port (port);
if (dev_id == invalid_device_id)
{
__PO_HI_DEBUG_DEBUG ("[GR740_SPW_A] Invalid device id for sending\n");
return __PO_HI_UNAVAILABLE;
}
local_port = __po_hi_get_local_port_from_global_port (port);
request = __po_hi_gqueue_get_most_recent_value (task_id, local_port);
if (request->port == -1)
{
__PO_HI_DEBUG_DEBUG ("[GR740_SPW_A] Send output task %d, port %d (local_port=%d): no value to send\n", task_id, port, local_port);
return __PO_HI_SUCCESS;
}
destination_port = __po_hi_gqueue_get_destination (task_id, local_port, 0);
// Identify remote device, to get its configuration
remote_device = __po_hi_get_device_from_port (destination_port);
remote_drv_conf = (__po_hi_c_spacewire_conf_t*) __po_hi_get_device_configuration (remote_device);
printf("[GR740_SPW_A_Sender] Sending to device name %s\n", remote_drv_conf->devname);
__po_hi_msg_reallocate (&__po_hi_c_driver_gr740_spw_a_sender_msg);
request->port = destination_port;
printf ("[USB-SPW] Destination port= %d, send through device %d \n", destination_port, dev_id);
__po_hi_marshall_request (request, &__po_hi_c_driver_gr740_spw_a_sender_msg);
swap_pointer = (unsigned long*) &__po_hi_c_driver_gr740_spw_a_sender_msg.content[0];
swap_value = *swap_pointer;
*swap_pointer = __po_hi_swap_byte (swap_value);
memcpy (&buf[1], __po_hi_c_driver_gr740_spw_a_sender_msg.content, __PO_HI_MESSAGES_MAX_SIZE);
for (ts = 0 ; ts < __PO_HI_MESSAGES_MAX_SIZE ; ts++)
{
__PO_HI_DEBUG_DEBUG ("%x", __po_hi_c_driver_gr740_spw_a_sender_msg.content[ts]);
}
__PO_HI_DEBUG_DEBUG ("|\n");
request->port = __PO_HI_GQUEUE_INVALID_PORT;
return 1;
}
#endif
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2011-2014 ESA & ISAE.
*/
#include <deployment.h>
#include <drivers/configuration/spacewire.h>
#ifndef __PO_HI_DRIVER_GR740_SPW_A_H__
#define __PO_HI_DRIVER_GR740_SPW_A_H__
#ifdef __PO_HI_NEED_DRIVER_GR740_SPW_A
void __po_hi_c_driver_gr740_spw_a_poller (const __po_hi_device_id dev_id);
void __po_hi_c_driver_gr740_spw_a_init (__po_hi_device_id id);
int __po_hi_c_driver_gr740_spw_a_sender (const __po_hi_task_id task_id, const __po_hi_port_t port);
#endif
#endif
......@@ -7,7 +7,7 @@ cd /opt/
ln -s /home/assert/tool-inst ocarina-2.0w-suite-x86-linux-2016.svn
ln -s /opt/DMT-Tools DMT
apt-get update
apt-get install subversion libgtk2-gladexml-perl xpdf libgnome2-perl xterm libxml-parser-perl libxml-libxml-perl libgtk2-perl libfile-copy-recursive-perl nedit zip sudo libxml-libxml-simple-perl libbonoboui2-0 libgnome2-0 libgnomeui-0 libgnomevfs2-0 libgnome2-vfs-perl libgnomevfs2-common python-pexpect libxenomai-dev xenomai-runtime python-gtk2-dev gtkwave libdbd-sqlite3-perl libdbi-perl libsqlite3-dev sqlite3 xmldiff libxml2-dev qemu-system wmctrl python-ply tree python-llvm kate tk8.5 libtool python3-pip libxslt-dev libxml2-dev libarchive-dev libacl1-dev libattr1-dev libacl1 libattr1 python-lxml python-jinja2 libglib2.0-0 libmono-system-runtime4.0-cil libmono-corlib4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-web4.0-cil libmono-system-xml4.0-cil libmono-system4.0-cil mono-runtime libmono-system-numerics4.0-cil libmono-system-data-linq4.0-cil libmono-corlib2.0-cil libmono-system2.0-cil python-pygraphviz postgresql-9.4 postgresql-client-9.4 postgresql-client-common postgresql-common pgadmin3 python-psycopg2 lcov libzmq3-dev python-coverage curl autoconf automake gnat ccache binfmt-support vim strace dos2unix python-antlr python-pip python3-pip git python-pyside python-pip python-matplotlib gcc procps bash-completion
apt-get install subversion libgtk2-gladexml-perl xpdf libgnome2-perl xterm libxml-parser-perl libxml-libxml-perl libgtk2-perl libfile-copy-recursive-perl nedit zip sudo libxml-libxml-simple-perl libbonoboui2-0 libgnome2-0 libgnomeui-0 libgnomevfs2-0 libgnome2-vfs-perl libgnomevfs2-common python-pexpect libxenomai-dev xenomai-runtime python-gtk2-dev gtkwave libdbd-sqlite3-perl libdbi-perl libsqlite3-dev sqlite3 xmldiff libxml2-dev qemu-system wmctrl python-ply tree python-llvm kate tk8.5 libtool python3-pip libxslt-dev libxml2-dev libarchive-dev libacl1-dev libattr1-dev libacl1 libattr1 python-lxml python-jinja2 libglib2.0-0 libmono-system-runtime4.0-cil libmono-corlib4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-web4.0-cil libmono-system-xml4.0-cil libmono-system4.0-cil mono-runtime libmono-system-numerics4.0-cil libmono-system-data-linq4.0-cil libmono-corlib2.0-cil libmono-system2.0-cil python-pygraphviz postgresql-9.4 postgresql-client-9.4 postgresql-client-common postgresql-common pgadmin3 python-psycopg2 lcov libzmq3-dev python-coverage curl autoconf automake gnat ccache binfmt-support vim strace dos2unix python-antlr python-pip python3-pip git python-pyside python-pip python-matplotlib gcc procps bash-completion gnuplot
. /etc/bash_completion
echo ':CLR:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register
visudo
......
Subproject commit d34b6b261d7b526f5b0adb4273cf2337b897819b
Subproject commit 61b952c1ebdd3eb129acd48672081d9c386a41b0
......@@ -9,4 +9,4 @@ sudo apt-get update
if [ "${ARCH}" == "x86_64" ] ; then
sudo apt-get install -y --force-yes libc6:i386 libgcc1:i386 libxft2:i386 libxss1:i386 libcairo2:i386 libc6-dev-i386
fi
sudo apt-get install -y --force-yes autoconf automake curl exuberant-ctags gcc git gnat gtkwave kate lcov libacl1 libacl1-dev libarchive-dev libattr1 libattr1-dev libbonoboui2-0 libdbd-sqlite3-perl libdbi-perl libfile-copy-recursive-perl libglib2.0-0 libgnome2-0 libgnome2-perl libgnome2-vfs-perl libgnomeui-0 libgnomevfs2-0 libgnomevfs2-common libgtk2-gladexml-perl libgtk2-perl libgraphviz-dev libmono-system-data-linq4.0-cil libmono-system-numerics4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-runtime4.0-cil libmono-system-web4.0-cil libmono-system-xml4.0-cil libmono-system4.0-cil libsqlite3-dev libtool libxenomai-dev libxml-libxml-perl libxml-libxml-simple-perl libxml-parser-perl libxml2-dev libxslt1-dev libzmq3-dev mono-mcs mono-reference-assemblies-2.0 mono-runtime nedit net-tools pgadmin3 postgresql postgresql-client postgresql-client-common postgresql-common python-antlr python-coverage python-gtk2-dev python-jinja2 python-lxml python-matplotlib python-pexpect python-pip python-ply python-psycopg2 python-pygraphviz python-pyside python3-pip qemu-system sqlite3 sudo tk8.5 tree vim-gtk wmctrl xenomai-system-tools xmldiff xpdf xterm xterm zip openjdk-8-jre python3-lxml bash-completion strace libtemplates-parser11.10.1-dev libusb-1.0-0-dev cmake dfu-util
sudo apt-get install -y --force-yes autoconf automake curl exuberant-ctags gcc git gnat gtkwave kate lcov libacl1 libacl1-dev libarchive-dev libattr1 libattr1-dev libbonoboui2-0 libdbd-sqlite3-perl libdbi-perl libfile-copy-recursive-perl libglib2.0-0 libgnome2-0 libgnome2-perl libgnome2-vfs-perl libgnomeui-0 libgnomevfs2-0 libgnomevfs2-common libgtk2-gladexml-perl libgtk2-perl libgraphviz-dev libmono-system-data-linq4.0-cil libmono-system-numerics4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-runtime4.0-cil libmono-system-web4.0-cil libmono-system-xml4.0-cil libmono-system4.0-cil libsqlite3-dev libtool libxml-libxml-perl libxml-libxml-simple-perl libxml-parser-perl libxml2-dev libxslt1-dev libzmq3-dev mono-mcs mono-reference-assemblies-2.0 mono-runtime nedit net-tools pgadmin3 postgresql postgresql-client postgresql-client-common postgresql-common python-antlr python-coverage python-gtk2-dev python-jinja2 python-lxml python-matplotlib python-pexpect python-pip python-ply python-psycopg2 python-pygraphviz python-pyside python3-pip qemu-system sqlite3 sudo tk8.5 tree vim-gtk wmctrl xmldiff xpdf xterm xterm zip openjdk-8-jre python3-lxml bash-completion strace libtemplates-parser11.10.1-dev libusb-1.0-0-dev cmake dfu-util gnuplot libstdc++-6-dev