Commit 342acd22 authored by Maxime Perrotin's avatar Maxime Perrotin

Add C code for test case

parent 68ccc86a
......@@ -6,4 +6,4 @@
@@-- POHIC
@@-- Debug
@@-- No_Stdlib
TRUE
FALSE
......@@ -33,7 +33,7 @@ public
@@END_TABLE@@
@@-- POHIC-only: declare protected objects to have runtime mutex
@@IF@@ @_Use_POHIC_@
@@-- @@IF@@ @_Use_POHIC_@
data Taste_Protected
properties
Concurrency_Control_Protocol => Protected_Access;
......@@ -43,7 +43,7 @@ data implementation Taste_Protected.Object
properties
Concurrency_Control_Protocol => Protected_Access;
end Taste_Protected.Object;
@@END_IF@@
@@-- @@END_IF@@
@_Nodes_@
......
KAZOO=../../kazoo
all: test-parse
make -C output.ada
cp obsw.pr output.ada/obsw/SDL/src
make -C output.ada && \
cp input_data/obsw.pr output.ada/obsw/SDL/src && \
cp input_data/gnc.c output.ada/gnc/C/src && \
cd output.ada/concurrency_view && \
ocarina -x main.aadl && \
make -f Makefile.taste
c: test-parse-c # Polyorb_HI_C output
make -C output.pohic && \
cp obsw.pr output.pohic/obsw/SDL/src && \
cp input_data/obsw.pr output.pohic/obsw/SDL/src && \
cp input_data/gnc.c output.pohic/gnc/C/src && \
cd output.pohic/concurrency_view && \
ocarina -x main.aadl && \
make -f Makefile.taste
......
/* Body file for function GNC
* Generated by TASTE on 2019-07-14 08:11:44
* You can edit this file, it will not be overwritten
* Provided interfaces : guidance
* Required interfaces :
* User-defined properties for this function:
* |_ Taste::Active_Interfaces = any
* |_ Taste::coordinates = 142673 57006 169917 79368
* Timers :
*/
#include "gnc.h"
#include <stdio.h>
void gnc_startup()
{
// Write your initialisation code, but DO NOT CALL REQUIRED INTERFACES
puts ("[GNC] Startup");
}
void gnc_PI_guidance
(const asn1SccT_UInt32 *IN_a,
asn1SccT_Boolean *OUT_result)
{
puts("[GNC] Guidance function called");
*OUT_result = (42 == *IN_a);
}
/* CIF PROCESS (250, 150), (150, 75) */
process Obsw;
/* CIF TEXT (504, 123), (275, 153) */
/* CIF TEXT (504, 123), (282, 153) */
-- Text area for declarations and comments
dcl p t_boolean;
dcl inp t_uint32 := 42;
/* CIF ENDTEXT */
/* CIF START (320, 10), (70, 35) */
START;
......@@ -13,17 +15,21 @@ process Obsw;
NEXTSTATE Wait;
/* CIF state (320, 115), (70, 35) */
state Wait;
/* CIF input (235, 170), (78, 35) */
/* CIF input (199, 170), (78, 35) */
input Run(p);
/* CIF output (231, 225), (86, 35) */
/* CIF output (195, 225), (86, 35) */
output Result(42);
/* CIF NEXTSTATE (239, 275), (70, 35) */
/* CIF NEXTSTATE (203, 275), (70, 35) */
NEXTSTATE wait;
/* CIF input (369, 170), (70, 35) */
input Pulse;
/* CIF PROCEDURECALL (327, 225), (152, 35) */
call writeln('[SDL] Pulse');
/* CIF NEXTSTATE (369, 280), (70, 35) */
/* CIF PROCEDURECALL (341, 225), (125, 35) */
call guidance (inp, p);
/* CIF PROCEDURECALL (313, 275), (181, 35) */
call writeln('[SDL] Result: ', p);
/* CIF task (291, 330), (224, 35) */
task inp := if inp = 42 then 0 else 42 fi;
/* CIF NEXTSTATE (369, 380), (70, 35) */
NEXTSTATE wait;
endstate;
/* CIF state (450, 10), (70, 35) */
......
......@@ -4,9 +4,7 @@ all: test-parse
cd output && make
test-parse: clean
$(KAZOO) --gw \
--debug \
-o output
$(KAZOO) --gw --debug -o output
clean:
rm -rf output
......
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