Commit 6b8cffce authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Maxime says these are not necessary

parent d79ea435
-- This file was generated automatically: DO NOT MODIFY IT !
with System.IO;
use System.IO;
with Ada.Unchecked_Conversion;
with Ada.Numerics.Generic_Elementary_Functions;
with TASTE_Dataview;
use TASTE_Dataview;
with TASTE_BasicTypes;
use TASTE_BasicTypes;
with adaasn1rtl;
use adaasn1rtl;
with Interfaces;
use Interfaces;
package body memoryscrub is
type States is (disabled, enabled);
type ctxt_Ty is
record
state : States;
initDone : Boolean := False;
par : aliased asn1SccEnableDisable;
end record;
ctxt: ctxt_Ty;
CS_Only : constant Integer := 3;
procedure runTransition(Id: Integer);
procedure EnableOrDisable(action: access asn1SccEnableDisable) is
begin
case ctxt.state is
when disabled =>
ctxt.par := action.all;
runTransition(2);
when enabled =>
ctxt.par := action.all;
runTransition(2);
when others =>
runTransition(CS_Only);
end case;
end EnableOrDisable;
procedure runTransition(Id: Integer) is
trId : Integer := Id;
msgPending : aliased Asn1Boolean := True;
begin
while (trId /= -1) loop
case trId is
when 0 =>
-- NEXT_STATE Disabled (11,18) at 351, 64
trId := -1;
ctxt.state := Disabled;
goto next_transition;
when 1 =>
-- writeln('scrubbing') (17,17)
Put("scrubbing");
New_Line;
-- NEXT_STATE - (19,22) at 354, 322
trId := -1;
goto next_transition;
when 2 =>
-- DECISION par (-1,-1)
-- ANSWER scrubon (29,21)
if (ctxt.par) = asn1Sccscrubon then
-- NEXT_STATE Enabled (31,34) at 457, 234
trId := -1;
ctxt.state := Enabled;
goto next_transition;
-- ANSWER scruboff (33,21)
elsif (ctxt.par) = asn1Sccscruboff then
-- NEXT_STATE Disabled (35,34) at 563, 234
trId := -1;
ctxt.state := Disabled;
goto next_transition;
end if;
when CS_Only =>
trId := -1;
goto next_transition;
when others =>
null;
end case;
<<next_transition>>
-- Process continuous signals
if ctxt.initDone then
Check_Queue(msgPending'access);
end if;
if not msgPending and trId = -1 and ctxt.state = enabled then
-- Priority 1
-- DECISION true (-1,-1)
-- ANSWER true (None,None)
if (true) = true then
trId := 1;
end if;
end if;
end loop;
end runTransition;
begin
runTransition(0);
ctxt.initDone := True;
end memoryscrub;
\ No newline at end of file
-- This file was generated automatically: DO NOT MODIFY IT !
with TASTE_Dataview;
use TASTE_Dataview;
with TASTE_BasicTypes;
use TASTE_BasicTypes;
with adaasn1rtl;
use adaasn1rtl;
package memoryscrub is
-- Provided interface "EnableOrDisable"
procedure EnableOrDisable(action: access asn1SccEnableDisable);
pragma Export(C, EnableOrDisable, "memoryscrub_EnableOrDisable");
procedure Check_Queue(res: access Asn1Boolean);
pragma import(C, Check_Queue, "memoryscrub_check_queue");
end memoryscrub;
\ No newline at end of file
-- This file was generated automatically: DO NOT MODIFY IT !
with System.IO;
use System.IO;
with Ada.Unchecked_Conversion;
with Ada.Numerics.Generic_Elementary_Functions;
with TASTE_Dataview;
use TASTE_Dataview;
with TASTE_BasicTypes;
use TASTE_BasicTypes;
with adaasn1rtl;
use adaasn1rtl;
with Interfaces;
use Interfaces;
package body orchestrator is
type States is (running, stopped);
type ctxt_Ty is
record
state : States;
initDone : Boolean := False;
a : aliased asn1SccMyInteger := 4;
c : aliased asn1SccMySeq;
b : aliased asn1SccMySeqOf;
e : aliased asn1SccMyChoice;
g : aliased asn1SccMyChoice;
f : aliased asn1SccMyEnum;
i : aliased asn1SccMyPossiblyEmptySeqOf;
h : aliased asn1SccMyReal;
k : aliased asn1SccMyComplexSeqOf;
j : aliased asn1SccMyComplexType;
toto : aliased asn1SccMySeqOf;
l : aliased asn1SccMyComplexChoice;
m : aliased asn1SccMyChoice2;
mycmd : aliased asn1SccMyInteger;
end record;
ctxt: ctxt_Ty;
CS_Only : constant Integer := 5;
procedure runTransition(Id: Integer);
procedure pmyproc(toto: in asn1SccMyInteger;tutu: in out asn1SccMyInteger);
procedure pmyproc(toto: in asn1SccMyInteger;tutu: in out asn1SccMyInteger) is
foo : aliased asn1SccMyInteger;
begin
-- a := 42 (73,17)
ctxt.a := Asn1Int(42);
-- DECISION toto (-1,-1)
-- ANSWER <10 (77,21)
if (toto) < 10 then
-- tutu := 128 (79,29)
tutu := Asn1Int(128);
-- ANSWER ELSE (None,None)
else
-- tutu := 254 (83,29)
tutu := Asn1Int(254);
end if;
-- foo := a (86,17)
foo := Asn1Int(ctxt.a);
-- RETURN (None,None) at 642, 419
return;
end pmyproc;
procedure pulse is
begin
case ctxt.state is
when running =>
runTransition(4);
when stopped =>
runTransition(3);
when others =>
runTransition(CS_Only);
end case;
end pulse;
procedure run(cmd: access asn1SccMyInteger) is
begin
case ctxt.state is
when running =>
ctxt.mycmd := cmd.all;
runTransition(1);
when stopped =>
ctxt.a := cmd.all;
runTransition(2);
when others =>
runTransition(CS_Only);
end case;
end run;
procedure runTransition(Id: Integer) is
trId : Integer := Id;
tmp80 : asn1SccMyInteger;
tmp52 : asn1SccMyInteger;
tmp61 : Asn1Int;
tmp138 : aliased asn1SccMyInteger;
tmp124 : aliased asn1SccMyChoice;
tmp162 : aliased asn1SccMyInteger;
tmp136 : aliased asn1SccMyInteger;
tmp48 : asn1SccMyInteger;
begin
while (trId /= -1) loop
case trId is
when 0 =>
-- COMMENT This is a comment
-- A multiline one, I mean (118,8)
-- a := 42 + 5 * 3 - 1 (93,13)
ctxt.a := Asn1Int(((42 + (5 * 3)) - 1));
-- b := { hello, world } (94,0)
ctxt.b := (Data => (1 => asn1Scchello, 2 => asn1Sccworld, others => asn1Scchello));
-- a := length(b) (95,0)
ctxt.a := Asn1Int(2);
-- c := {a 5, b taste} (96,0)
ctxt.c := asn1SccMySeq'( a => 5, b => asn1Scctaste);
-- f := hello (97,0)
ctxt.f := asn1Scchello;
-- g := b:{a 33, b you} (98,0)
ctxt.g := asn1SccMyChoice_b_set(asn1SccMySeq'( a => 33, b => asn1Sccyou));
-- e:=g (99,0)
ctxt.e := ctxt.g;
-- e := a:TRUE (100,0)
ctxt.e := asn1SccMyChoice_a_set(true);
-- b(1) := hello (101,0)
ctxt.b.Data(2) := asn1Scchello;
-- h := -42.5 (103,0)
ctxt.h := (-42.5);
-- i := {} (104,0)
ctxt.i := asn1SccMyPossiblyEmptySeqOf_Init;
-- i := { 1 } (105,0)
ctxt.i := (Data => (1 => 1, others => 1), Length => 1);
-- a := length(i) (106,0)
ctxt.a := Asn1Int(Integer(ctxt.i.Length));
-- a := if e!a then 8 else if b(0) = hello then a else 9 fi fi (107,0)
if (ctxt.b.Data(1) = asn1Scchello) then
tmp52 := ctxt.a;
else
tmp52 := 9;
end if;
if asn1SccMyChoice_a_get(ctxt.e) then
tmp48 := 8;
else
tmp48 := tmp52;
end if;
ctxt.a := Asn1Int(tmp48);
-- j := { a { x if e!a then 5 else a fi, y 6 } } (108,0)
if asn1SccMyChoice_a_get(ctxt.e) then
tmp61 := 5;
else
tmp61 := ctxt.a;
end if;
ctxt.j := asn1SccMyComplexType'( a => asn1SccMyComplexType_a'( y => 6, x => tmp61));
-- k := { {x 4}, {x 5} } (109,0)
ctxt.k := (Data => (1 => asn1SccMyComplexSeqOf_elm'( x => 4), 2 => asn1SccMyComplexSeqOf_elm'( x => 5), others => asn1SccMyComplexSeqOf_elm'( x => 4)));
-- l := a:{ x 5 } (110,0)
ctxt.l := asn1SccMyComplexChoice_a_set(asn1SccMyComplexChoice_a'( x => 5));
-- a := if present(e)=b then 42 else 43 fi (111,0)
if (asn1SccMyChoice_Kind(ctxt.e) = b_PRESENT) then
tmp80 := 42;
else
tmp80 := 43;
end if;
ctxt.a := Asn1Int(tmp80);
-- a := abs(-5) (112,0)
ctxt.a := Asn1Int(abs((-5)));
-- h := abs(-42.5) (113,0)
ctxt.h := abs((-42.5));
-- h := abs(h) (114,0)
ctxt.h := abs(ctxt.h);
-- i := {1, 2} (115,0)
ctxt.i := (Data => (1 => 1, 2 => 2, others => 1), Length => 2);
-- m := B:C:TRUE (116,0)
ctxt.m := asn1SccMyChoice2_B_set(asn1SccMyChoice2_b_C_set(true));
-- TASK for x in i:
-- call writeln(x);
-- endfor (121,13)
declare
x : asn1SccMyPossiblyEmptySeqOf_elm;
begin
for x_idx in 1 .. ctxt.i.Length loop
x := ctxt.i.Data(1..ctxt.i.Length)(x_idx);
-- writeln(x) (122,5)
Put(Asn1Int'Image(x));
New_Line;
end loop;
end;
-- writeln('Should show "5 42.5": ', a, h) (125,13)
Put("Should show '5 42.5': ");
Put(Asn1Int'Image(ctxt.a));
Put(Long_Float'Image(ctxt.h));
New_Line;
-- DECISION present(e) (-1,-1)
-- ANSWER a (129,17)
if (asn1SccMyChoice_Kind(ctxt.e)) = a_PRESENT then
-- a := 37 (131,25)
ctxt.a := Asn1Int(37);
-- ANSWER b (133,17)
elsif (asn1SccMyChoice_Kind(ctxt.e)) = b_PRESENT then
-- a := 38 (135,25)
ctxt.a := Asn1Int(38);
-- ANSWER ELSE (None,None)
else
null;
end if;
-- DECISION e (-1,-1)
tmp124 := ctxt.e;
-- ANSWER a:TRUE (142,17)
if asn1SccMyChoice_Equal(tmp124, asn1SccMyChoice_a_set(true)) then
-- a := 41 (144,25)
ctxt.a := Asn1Int(41);
-- ANSWER g (146,17)
elsif asn1SccMyChoice_Equal(tmp124, ctxt.g) then
-- a := 40 (148,25)
ctxt.a := Asn1Int(40);
-- ANSWER ELSE (None,None)
else
-- a := 42 (152,25)
ctxt.a := Asn1Int(42);
end if;
-- NEXT_STATE Stopped (155,18) at 956, 1004
trId := -1;
ctxt.state := Stopped;
goto next_transition;
when 1 =>
-- housekeeping(42) (169,19)
tmp138 := 42;
RIhousekeeping(tmp138'access);
-- JOIN Transition_to_Stop (171,17) at 2421, 817
goto Transition_to_Stop;
when 2 =>
-- JOIN Here (None,None) at None, None
goto Here;
when 3 =>
-- housekeeping (1) (203,19)
tmp162 := 1;
RIhousekeeping(tmp162'access);
-- NEXT_STATE - (205,22) at 1750, 220
-- COMMENT Stay in the same state (207,12)
trId := -1;
goto next_transition;
when 4 =>
-- a := (a+1) mod 10 (214,17)
ctxt.a := Asn1Int(((ctxt.a + 1) mod 10));
-- writeln
-- ('Calling GNC with value ', a) (216,17)
Put("Calling GNC with value ");
Put(Asn1Int'Image(ctxt.a));
New_Line;
-- computeGNC(a, a) (219,17)
RIcomputeGNC(ctxt.a'access, ctxt.a'access);
-- housekeeping(a) (221,19)
RIhousekeeping(ctxt.a'access);
-- NEXT_STATE Running (223,22) at 1503, 424
trId := -1;
ctxt.state := Running;
goto next_transition;
when CS_Only =>
trId := -1;
goto next_transition;
when others =>
null;
end case;
goto next_transition;
-- CONNECTION Transition_to_Stop (157,15)
<<Transition_to_Stop>>
-- housekeeping(31) (159,15)
tmp136 := 31;
RIhousekeeping(tmp136'access);
-- NEXT_STATE Stopped (161,18) at 478, 621
trId := -1;
ctxt.state := Stopped;
goto next_transition;
-- CONNECTION Here (181,12)
<<Here>>
-- DECISION a>10 (183,22)
-- ANSWER TRUE (185,21)
if ((ctxt.a > 10)) = true then
-- writeln
-- ('a is too big! - decrementing :', a, a - 1) (187,29)
Put("a is too big! - decrementing :");
Put(Asn1Int'Image(ctxt.a));
Put(Asn1Int'Image((ctxt.a - 1)));
New_Line;
-- a := a - 1 (190,29)
ctxt.a := Asn1Int((ctxt.a - 1));
-- myproc(5,a) (192,29)
pmyproc(5, ctxt.a);
-- JOIN Here (194,29) at 2329, 552
goto Here;
-- ANSWER FALSE (196,21)
elsif ((ctxt.a > 10)) = false then
null;
end if;
-- NEXT_STATE Running (199,22) at 2396, 617
trId := -1;
ctxt.state := Running;
goto next_transition;
<<next_transition>>
null;
end loop;
ctxt.initDone := True;
end runTransition;
begin
runTransition(0);
end orchestrator;
\ No newline at end of file
-- This file was generated automatically: DO NOT MODIFY IT !
with TASTE_Dataview;
use TASTE_Dataview;
with TASTE_BasicTypes;
use TASTE_BasicTypes;
with adaasn1rtl;
use adaasn1rtl;
package orchestrator is
-- Provided interface "pulse"
procedure pulse;
pragma Export(C, pulse, "orchestrator_pulse");
-- Provided interface "run"
procedure run(cmd: access asn1SccMyInteger);
pragma Export(C, run, "orchestrator_run");
-- Required interface "housekeeping"
procedure RIhousekeeping(hk: access asn1SccMyInteger);
pragma import(C, RIhousekeeping, "orchestrator_RI_housekeeping");
-- Sync required interface "computeGNC"
procedure RIcomputeGNC(inP: access asn1SccMyInteger; outP: access asn1SccMyInteger);
pragma import(C, RIcomputeGNC, "orchestrator_RI_computeGNC");
end orchestrator;
\ No newline at end of file
$date
Tue Sep 6 15:09:13 2016
$end
$version
VCD generator tool version info text.
$end
$comment
This file has been create by polyorb-hi-c runtime of ocarina.
$end
$timescale 1us $end
$scope module tasks $end
$var wire 1 t0 task_0 $end
$var wire 1 t1 task_1 $end
$var wire 1 t2 task_2 $end
$var wire 1 t3 task_3 $end
$var wire 1 t4 task_4 $end
$var wire 1 t5 task_5 $end
$var wire 1 t6 task_6 $end
$upscope $end
$scope module mutexes $end
$var wire 1 w0 awaited_0 $end
$var wire 1 w1 awaited_1 $end
$var wire 1 w2 awaited_2 $end
$var wire 1 l0 locked_0 $end
$var wire 1 l1 locked_1 $end
$var wire 1 l2 locked_2 $end
$upscope $end
$scope module ports $end
$var real 1 p0.0 port_0_0 $end
$var real 1 p1.0 port_1_0 $end
$var real 1 p3.0 port_3_0 $end
$var real 1 p4.0 port_4_0 $end
$var real 1 p6.0 port_6_0 $end
$upscope $end
$enddefinitions $end
$dumpvars
0t0
0t1
0t2
0t3
0t4
0t5
0t6
0w0
0w1
0w2
0l0
0l1
0l2
r0 p0.0
r0 p1.0
r0 p3.0
r0 p4.0
r0 p6.0
$end
#379716
0t0
#393423
0t3
#411642
0t4
#426950
0t5
#445877
0t6
#460125
0t1
#480301
0t2
#495714
1t5
#506060
1w2
#520662
0w2
#533583
1l2
#547276
0l2
#560591
0t5
#572076
1t2
#591559
1w0
#602345
0w0
#614473
1l0
#626307
r1 p4.0
#638410
0l0
#650437
0t2
#663698
1t4
#674972
r0 p4.0
#685462
1w1
#699012
0w1
#712862
1l1
#727405
r1 p6.0
#738054
0l1
#752509
0t4
#763537
1t6
#775888
r0 p6.0
#787632
1w2
#799619
0w2
#809607
1l2
#822949
0l2
#838420
0t6
#854222
1t2
#870930
1w0
#883239
0w0
#894966
1l0
#909579