Commit 1a51af32 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add Demo_C to Kazoo regression suite

parent 59b6e576
DataView DEFINITIONS ::=
BEGIN
MyInteger ::= INTEGER (0..65535)
END
---------------------------------------------------
-- AADL2.0
-- TASTE
--
--
---------------------------------------------------
PACKAGE deploymentview::DV::obj75
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS demo_c
END demo_c;
PROCESS IMPLEMENTATION demo_c.others
END demo_c.others;
END deploymentview::DV::obj75;
PACKAGE deploymentview::DV
PUBLIC
WITH ocarina_processors_x86;
WITH deploymentview::DV::obj75;
WITH Taste;
WITH Deployment;
WITH interfaceview::IV;
WITH TASTE_DV_Properties;
SYSTEM obj75
END obj75;
SYSTEM IMPLEMENTATION obj75.others
SUBCOMPONENTS
IV_Simple_C_Function : SYSTEM interfaceview::IV::Simple_C_Function.others {
Taste::coordinates => "1161 619 1727 810";
Taste::FunctionName => "Simple_C_Function";
};
demo_c : PROCESS deploymentview::DV::obj75::demo_c.others {
Taste::coordinates => "1019 511 1928 873";
Deployment::Port_Number => 0;
};
p : PROCESSOR ocarina_processors_x86::x86.linux {
Taste::coordinates => "890 391 2002 919";
};
PROPERTIES
Taste::APLC_Binding => (reference (demo_c)) APPLIES TO IV_Simple_C_Function;
Actual_Processor_Binding => (reference (p)) APPLIES TO demo_c;
END obj75.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
obj75 : SYSTEM obj75.others {
Taste::coordinates => "545 244 2768 1299";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.18";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("~/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
---------------------------------------------------
-- AADL2.0
-- TASTE
--
--
---------------------------------------------------
PACKAGE interfaceview::FV::Simple_C_Function
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_cyclic_operation
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_cyclic_operation;
SUBPROGRAM IMPLEMENTATION PI_cyclic_operation.others
END PI_cyclic_operation.others;
END interfaceview::FV::Simple_C_Function;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::FV::Simple_C_Function;
WITH interfaceview::FV;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM Simple_C_Function
FEATURES
PI_cyclic_operation : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Simple_C_Function::PI_cyclic_operation.others {
Taste::coordinates => "1042 584";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 2000 ms;
Taste::Deadline => 2000 ms;
Taste::InterfaceName => "cyclic_operation";
};
PROPERTIES
Source_Language => (C);
END Simple_C_Function;
SYSTEM IMPLEMENTATION Simple_C_Function.others
SUBCOMPONENTS
cyclic_operation_impl : SUBPROGRAM interfaceview::FV::Simple_C_Function::PI_cyclic_operation.others {
Compute_Execution_Time => 0 ms .. 2000 ms;
};
CONNECTIONS
OpToPICnx_cyclic_operation_impl : SUBPROGRAM ACCESS cyclic_operation_impl -> PI_cyclic_operation;
END Simple_C_Function.others;
SYSTEM interfaceview
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
Simple_C_Function : SYSTEM interfaceview::IV::Simple_C_Function.others {
Taste::coordinates => "1042 432 1706 1121";
};
END interfaceview.others;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 2970 2100";
Taste::version => "1.3.18";
END interfaceview::IV;
PACKAGE interfaceview::FV
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
END interfaceview::FV;
KAZOO=../../kazoo
all: c
ada: kazoo-ada
cp simple_c_function/*.c output.ada/simple_c_function/C/src
$(MAKE) -C output.ada
c: kazoo-c # Polyorb_HI_C output
cp simple_c_function/*.c output.c/simple_c_function/C/src
$(MAKE) -C output.c
$(MAKE) -C output.c build-rtems-ada
kazoo-ada: clean-ada
$(KAZOO) --gw \
-o output.ada \
--glue \
--debug
kazoo-c: clean-c
$(KAZOO) -p --gw --glue -o output.c
gdb-ada: clean
gdb --args $(KAZOO) --gw --glue --debug -o output.gdb
gdb-c: clean
gdb --args $(KAZOO) -p --gw --glue --debug -o output.gdb
clean-ada:
rm -rf output.ada
clean-c:
rm -rf output.c
skeletons-c:
$(KAZOO) --gw -o output.c
$(MAKE) -C output.c dataview
clean-skeletons: clean-c
clean: clean-ada clean-c
.PHONY: clean clean-ada clean-c kazoo-ada kazoo-c gdb-ada gdb-c c ada skeletons-c clean-skeletons
Demo C
------
This is the simplest possible system you can do in TASTE:
a single periodic C function.
If this one does not build, the machine is definitely not configured
properly.
The expected output of the built binary is to display "Hello, world..."
every two seconds.
#!/usr/bin/env python2
import sys
timeout = 5
binaries = [
"output.c/binaries/demo_c"
]
expected = [
'\[Startup\] Expected output: "Hello, world..." every 2 seconds',
'Hello, world...',
'Hello, world...',
'Hello, world...',
'Hello, world...'
]
sys.path.append("..")
import commonRegression
result = commonRegression.test(binaries, expected, timeout)
sys.exit(result)
/* Functions to be filled by the user (never overwritten by buildsupport tool) */
#include "simple_c_function.h"
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
void myhandler ();
void simple_c_function_startup()
{
/* Write your initialization code here,
but do not make any call to a required interface!! */
printf ("[Startup] Expected output: \"Hello, world...\" every 2 seconds\n");
(void) signal (SIGINT, myhandler);
}
void myhandler ()
{
printf ("Ctrl-C hit!\n");
exit (0);
}
void simple_c_function_PI_cyclic_operation()
{
printf ("Hello, world...\n");
}
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
-- Set of TASTE predefined basic types
T-Int32 ::= INTEGER (-2147483648 .. 2147483647)
T-UInt32 ::= INTEGER (0 .. 4294967295)
T-Int8 ::= INTEGER (-128 .. 127)
T-UInt8 ::= INTEGER (0 .. 255)
T-Boolean ::= BOOLEAN
END
import pexpect, sys
g_child = None
def test(binaries, expected, timeout):
try:
for binary in binaries:
print "Verifying", binary, " "*7,
global g_child
g_child = pexpect.spawn(binary, timeout=timeout)
total = len(expected)
for cnt,elem in enumerate(expected):
realList = [pexpect.TIMEOUT, pexpect.EOF]
if isinstance(elem, list):
realList.extend(elem)
else:
realList.append(elem)
idx = g_child.expect(realList)
if 0 == idx:
print "\nTimed out waiting for:", realList
print g_child
return 1
elif 1 == idx:
print "\nUnexpected EOF waiting for:", realList
print g_child
return 1
else:
sys.stdout.write("\b\b\b\b\b\b\b%3d/%3d" % (cnt+1,total))
sys.stdout.flush()
print "\nVerified ", binary, ": OK"
except:
print("Test failed...")
return 1
return 0
--------------------------------------------------------
--! File generated by asn2aadl v2.1.35: DO NOT EDIT !
--------------------------------------------------------
--! InputASN1FileChecksum:6bf664b31ce9ca6fd89af52cea7ea0f2:/home/taste/tool-src/kazoo/test/test-cv/DataView.asn:
--! InputASN1FileChecksum:ee8a7e01f29874c0d50f437d5abb9599:/home/taste/tool-inst/share/taste-types/taste-types.asn:
--! InputASN1FileChecksum:6bf664b31ce9ca6fd89af52cea7ea0f2:DataView.asn:
--! InputASN1FileChecksum:ee8a7e01f29874c0d50f437d5abb9599:~/tool-inst/share/taste-types/taste-types.asn:
--------------------------------------------------------
package DataView
......
This diff is collapsed.
......@@ -259,6 +259,6 @@ PROPERTIES
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.0";
Taste::interfaceView => "interfaceview.aadl";
Taste::HWLibraries => ("libhw.aadl");
Taste::HWLibraries => ("/home/taste/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
......@@ -13,10 +13,10 @@ test-parse: clean
gdb: clean
gdb --args $(KAZOO) --gw \
gdb --args $(KAZOO) --gw -p \
-o output \
--glue \
--debug
--glue --no-stdlib \
--debug ../common/libhw.aadl
clean:
rm -rf output
......
Supports Markdown
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