Commit d5783922 authored by Maxime Perrotin's avatar Maxime Perrotin

Add Demo_Distrib

parent 7c02f521
This diff is collapsed.
DataView DEFINITIONS AUTOMATIC TAGS ::= BEGIN
My-Integer ::= INTEGER (0 .. 65535)
END
---------------------------------------------------
-- AADL2.2
-- TASTE type deploymentview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE deploymentview::DV::pb1
PUBLIC
WITH ocarina_buses;
WITH ocarina_drivers;
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS pinger
END pinger;
PROCESS IMPLEMENTATION pinger.others
END pinger.others;
DEVICE ethernet1
EXTENDS ocarina_drivers::generic_sockets_ip
FEATURES
link : REFINED TO REQUIRES BUS ACCESS ocarina_buses::ip.i {
Taste::coordinates => "729 966";
};
PROPERTIES
Taste::Interface_Coordinates => "1145 1062" APPLIES TO link;
Deployment::Configuration => "{devname ""eth0"", address ""127.0.0.1"", version ipv4, port 5115 }";
Deployment::Config => "~/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/ip.asn";
Deployment::Version => "0.1beta";
END ethernet1;
DEVICE IMPLEMENTATION ethernet1.others
EXTENDS ocarina_drivers::generic_sockets_ip.pohic
END ethernet1.others;
END deploymentview::DV::pb1;
PACKAGE deploymentview::DV::pb2
PUBLIC
WITH ocarina_buses;
WITH ocarina_drivers;
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS pingee
END pingee;
PROCESS IMPLEMENTATION pingee.others
END pingee.others;
DEVICE ethernet2
EXTENDS ocarina_drivers::generic_sockets_ip
FEATURES
link : REFINED TO REQUIRES BUS ACCESS ocarina_buses::ip.i {
Taste::coordinates => "2276 780";
};
PROPERTIES
Taste::Interface_Coordinates => "1710 1062" APPLIES TO link;
Deployment::Configuration => "{devname ""eth0"", address ""127.0.0.1"", version ipv4, port 5116 }";
Deployment::Config => "~/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/ip.asn";
Deployment::Version => "0.1beta";
END ethernet2;
DEVICE IMPLEMENTATION ethernet2.others
EXTENDS ocarina_drivers::generic_sockets_ip.pohic
END ethernet2.others;
END deploymentview::DV::pb2;
PACKAGE deploymentview::DV
PUBLIC
WITH interfaceview::IV::A;
WITH ocarina_processors_x86;
WITH deploymentview::DV::pb1;
WITH interfaceview::IV::B;
WITH deploymentview::DV::pb2;
WITH ocarina_buses;
WITH Taste;
WITH Deployment;
WITH interfaceview::IV;
WITH TASTE_DV_Properties;
SYSTEM pb1
FEATURES
ethernet1_eth0 : REQUIRES BUS ACCESS ocarina_buses::ip.i;
END pb1;
SYSTEM IMPLEMENTATION pb1.others
SUBCOMPONENTS
IV_A : SYSTEM interfaceview::IV::A::A.others {
Taste::FunctionName => "A";
};
pinger : PROCESS deploymentview::DV::pb1::pinger.others {
Taste::coordinates => "420 296 680 747";
Deployment::Port_Number => 0;
};
p1 : PROCESSOR ocarina_processors_x86::x86.linux {
Taste::coordinates => "391 255 719 754";
};
ethernet1 : DEVICE deploymentview::DV::pb1::ethernet1.others {
Taste::coordinates => "457 793 850 966";
};
CONNECTIONS
ethernet1_eth0_link : BUS ACCESS ethernet1_eth0 -> ethernet1.link;
PROPERTIES
Taste::APLC_Binding => (reference (pinger)) APPLIES TO IV_A;
Actual_Processor_Binding => (reference (p1)) APPLIES TO pinger;
Actual_Processor_Binding => (reference (p1)) APPLIES TO ethernet1;
END pb1.others;
SYSTEM pb2
FEATURES
ethernet2_eth0 : REQUIRES BUS ACCESS ocarina_buses::ip.i;
END pb2;
SYSTEM IMPLEMENTATION pb2.others
SUBCOMPONENTS
IV_B : SYSTEM interfaceview::IV::B::B.others {
Taste::FunctionName => "B";
};
pingee : PROCESS deploymentview::DV::pb2::pingee.others {
Taste::coordinates => "2269 363 2584 708";
Deployment::Port_Number => 0;
};
p2 : PROCESSOR ocarina_processors_x86::x86.linux {
Taste::coordinates => "2249 307 2591 725";
};
ethernet2 : DEVICE deploymentview::DV::pb2::ethernet2.others {
Taste::coordinates => "2276 775 2726 963";
};
CONNECTIONS
ethernet2_eth0_link : BUS ACCESS ethernet2_eth0 -> ethernet2.link;
PROPERTIES
Taste::APLC_Binding => (reference (pingee)) APPLIES TO IV_B;
Actual_Processor_Binding => (reference (p2)) APPLIES TO pingee;
Actual_Processor_Binding => (reference (p2)) APPLIES TO ethernet2;
END pb2.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
pb1 : SYSTEM pb1.others {
Taste::coordinates => "333 173 913 995";
};
pb2 : SYSTEM pb2.others {
Taste::coordinates => "2181 223 2864 1058";
};
eth0 : BUS ocarina_buses::ip.i {
Taste::coordinates => "1073 1062 1788 1282";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
CONNECTIONS
obj1366 : BUS ACCESS eth0 -> pb1.ethernet1_eth0 {
Taste::coordinates => "729 966 729 1003 1145 1003 1145 1062";
};
obj1487 : BUS ACCESS eth0 -> pb2.ethernet2_eth0 {
Taste::coordinates => "2276 780 1710 780 1710 1062";
};
PROPERTIES
Actual_Connection_Binding => (reference (eth0)) APPLIES TO interfaceview.A_PI_ping_B_RI_pong;
Actual_Connection_Binding => (reference (eth0)) APPLIES TO interfaceview.B_PI_ping_A_RI_pong;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 2970 2100";
Taste::version => "2.2";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("/home/taste/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
---------------------------------------------------
-- AADL2.2
-- TASTE type interfaceview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE interfaceview::IV::A
PUBLIC
WITH interfaceview::IV::B;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_ping
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_ping;
SUBPROGRAM IMPLEMENTATION PI_ping.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 1000 ms;
END PI_ping.others;
SUBPROGRAM PI_cyclic_activation
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_cyclic_activation;
SUBPROGRAM IMPLEMENTATION PI_cyclic_activation.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 1000 ms;
END PI_cyclic_activation.others;
SUBPROGRAM RI_pong
FEATURES
p1 : IN PARAMETER DataView::My_Integer {
Taste::encoding => UPER;
};
END RI_pong;
SUBPROGRAM IMPLEMENTATION RI_pong.others
END RI_pong.others;
SYSTEM A
FEATURES
PI_ping : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::A::PI_ping.others {
Taste::coordinates => "1232 1132";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 1000 ms;
Taste::Deadline => 1000 ms;
Taste::InterfaceName => "ping";
};
PI_cyclic_activation : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::A::PI_cyclic_activation.others {
Taste::coordinates => "877 570";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 2000 ms;
Taste::Deadline => 1000 ms;
Taste::InterfaceName => "cyclic_activation";
};
RI_pong : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::B::PI_ping.others {
Taste::coordinates => "1232 672";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "pong";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (C);
Taste::Active_Interfaces => enabled;
END A;
SYSTEM IMPLEMENTATION A.others
END A.others;
END interfaceview::IV::A;
PACKAGE interfaceview::IV::B
PUBLIC
WITH interfaceview::IV::A;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_ping
FEATURES
p1 : IN PARAMETER DataView::My_Integer {
Taste::encoding => UPER;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_ping;
SUBPROGRAM IMPLEMENTATION PI_ping.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 1000 ms;
END PI_ping.others;
SUBPROGRAM RI_pong
END RI_pong;
SUBPROGRAM IMPLEMENTATION RI_pong.others
END RI_pong.others;
SYSTEM B
FEATURES
PI_ping : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::B::PI_ping.others {
Taste::coordinates => "1781 671";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 1000 ms;
Taste::Deadline => 1000 ms;
Taste::InterfaceName => "ping";
};
RI_pong : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::A::PI_ping.others {
Taste::coordinates => "1781 1131";
Taste::RCMoperationKind => sporadic;
Taste::InterfaceName => "pong";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (C);
Taste::Active_Interfaces => enabled;
END B;
SYSTEM IMPLEMENTATION B.others
END B.others;
END interfaceview::IV::B;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::IV::A;
WITH interfaceview::IV::B;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM interfaceview
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
A : SYSTEM interfaceview::IV::A::A.others {
Taste::coordinates => "565 570 1232 1245";
};
B : SYSTEM interfaceview::IV::B::B.others {
Taste::coordinates => "1781 569 2470 1214";
};
CONNECTIONS
A_PI_ping_B_RI_pong : SUBPROGRAM ACCESS A.PI_ping -> B.RI_pong {
Taste::coordinates => "1781 1131 1414 1131 1414 1132 1232 1132";
};
B_PI_ping_A_RI_pong : SUBPROGRAM ACCESS B.PI_ping -> A.RI_pong {
Taste::coordinates => "1232 672 1414 672 1414 671 1781 671";
};
END interfaceview.others;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 2970 2100";
Taste::version => "2.2";
END interfaceview::IV;
KAZOO=../../kazoo
all: c
ada: test-parse-ada
make -C output.ada
cp skels/a/a.c output.pohic/a/C/src
cp skels/b/b.c output.pohic/b/C/src
cd output.ada/build && \
ocarina -x main.aadl && \
make -f Makefile.taste
c: test-parse-c # Polyorb_HI_C output
cp skels/a/a.c output.pohic/a/C/src
cp skels/b/b.c output.pohic/b/C/src
make -C output.pohic
test-parse-ada: clean-ada
$(KAZOO) --gw \
-o output.ada \
--glue \
--debug
test-parse-c: clean-c
$(KAZOO) -p --gw \
-o output.pohic \
--glue -g
buildsupport_pohic:
buildsupport -o output.buildsupport.pohic -p --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl
buildsupport_pohiada:
buildsupport -o output.buildsupport.ada --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl
gdb: clean
gdb --args $(KAZOO) --gw \
-o output.pohic \
--glue \
--debug
clean-ada:
rm -rf output.ada
clean-c:
rm -rf output.pohic
skeletons:
$(KAZOO) -p --gw --glue -o code && make -C code dataview
clean-skeletons:
rm -rf code
clean: clean-ada clean-c clean-skeletons
.PHONY: clean clean-ada clean-c test-parse-ada gdb test-parse-c buildsupport_pohic buildsupport_pohiada c skeletons clean-skeletons
Demo_Distrib
Tests a distributed system over two linux nodes using TCP/IP connection
build-script.sh builds with the legacy system (buildsupport/orchestrator)
and make builds with kazoo
#!/bin/bash
mkdir -p .cache
export PROJECT_CACHE=$HOME/.taste_AST_cache
cd skels
rm -f a.zip
zip a a/*
rm -f b.zip
zip b b/*
cd ..
[ ! -z "$CLEANUP" ] && rm -rf binary.linux.pohic/
assert-builder-ocarina.py \
-f \
-p \
--aadlv2 \
--keep-case \
--interfaceView InterfaceView.aadl \
--deploymentView DeploymentView.aadl \
-o binary.linux.pohic \
--subC a:skels/a.zip \
--subC b:skels/b.zip
#!/usr/bin/env python
import sys, os, subprocess
sys.path.append(os.path.abspath(".."))
import commonRegression
timeout = 5
expected = [
"\[B\] Startup",
"\[B\] ping! \(0\)",
"\[B\] ping! \(1\)",
"\[B\] ping! \(2\)",
"\[B\] ping! \(3\)",
"\[B\] ping! \(4\)",
"\[B\] ping! \(5\)",
"\[B\] ping! \(6\)",
"\[B\] ping! \(7\)",
"\[B\] ping! \(8\)",
"\[B\] ping! \(9\)",
]
p = None
try:
p = subprocess.Popen("binary.linux.pohic/binaries/pinger", stdout=subprocess.PIPE)
if p == None:
sys.exit(1)
except:
sys.exit(1)
result=commonRegression.test(
["binary.linux.pohic/binaries/pingee"],
expected,
timeout)
if 0!=result:
p.kill()
sys.exit(1)
p.kill()
p.wait()
commonRegression.g_child.terminate(force=True)
sys.exit(result)
/* Functions to be filled by the user (never overwritten by buildsupport tool) */
#include "a.h"
#include <stdio.h>
void a_startup()
{
/* Write your initialization code here,
but do not make any call to a required interface!! */
printf ("[A] Startup\n");
}
void a_PI_ping()
{
printf ("[A] ping!\n");
}
void a_PI_cyclic_activation()
{
/* Write your code here! */
static asn1SccMy_Integer value = 0;
a_RI_pong (&value);
value ++;
}
/* This file was generated automatically: DO NOT MODIFY IT ! */
/* Declaration of the functions that have to be provided by the user */
#ifndef __USER_CODE_H_a__
#define __USER_CODE_H_a__
#include "C_ASN1_Types.h"
void a_startup();
extern void a_RI_pong(const asn1SccMy_Integer *);
void a_PI_ping();
void a_PI_cyclic_activation();
#endif
/* Functions to be filled by the user (never overwritten by buildsupport tool) */
#include "b.h"
#include <stdio.h>
void b_startup()
{
/* Write your initialization code here,
but do not make any call to a required interface!! */
printf ("[B] Startup\n");
}
void b_PI_ping(const asn1SccMy_Integer *IN_p1)
{
/* Write your code here! */
printf ("[B] ping! (%lld)\n", *IN_p1);
b_RI_pong();
}
/* This file was generated automatically: DO NOT MODIFY IT ! */
/* Declaration of the functions that have to be provided by the user */
#ifndef __USER_CODE_H_b__
#define __USER_CODE_H_b__
#include "C_ASN1_Types.h"
void b_startup();
void b_PI_ping(const asn1SccMy_Integer *);
extern void b_RI_pong();
#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