Commit 6d33cabb authored by Bechir Zalila's avatar Bechir Zalila

* Test cases for LNT backend

	(By Hana Mkaouar)
parent ffe5d888
package FlightControlSystem
public
data Alpha
end Alpha;
thread NL
-- Navigation Law
features
pos_c : in event data port Alpha;
pos_o : in event data port Alpha;
acc_c : out event data port Alpha;
properties
Dispatch_Protocol => Periodic;
Period => 120 ms;
Compute_Execution_Time => 0 ms .. 20 ms;
Deadline => 120 ms;
Priority => 2;
end NL;
thread NF
-- Navigation Filter
features
pos_i : in event data port Alpha;
pos_o : out event data port Alpha;
properties
Dispatch_Protocol => Periodic;
Period => 120 ms;
Compute_Execution_Time => 0 ms .. 10 ms;
Deadline => 120 ms;
Priority => 1;
end NF;
thread PL
-- Piloting Law
features
acc_c : in event data port Alpha;
acc_o : in event data port Alpha;
angle_c : out event data port Alpha;
properties
Dispatch_Protocol => Periodic;
Period => 40 ms;
Compute_Execution_Time => 0 ms .. 5 ms;
Deadline => 40 ms;
Priority => 4;
end PL;
thread PF
-- Piloting Filter
features
acc_i : in event data port Alpha;
acc_o : out event data port Alpha;
properties
Dispatch_Protocol => Periodic;
Period => 40 ms;
Compute_Execution_Time => 0 ms .. 5 ms;
Deadline => 40 ms;
Priority => 3;
end PF;
thread FL
-- Feddback Law
features
angle_c : in event data port Alpha;
angle_o : in event data port Alpha;
order : out event data port Alpha;
properties
Dispatch_Protocol => Periodic;
Period => 10 ms;
Compute_Execution_Time => 0 ms .. 2 ms;
Deadline => 10 ms;
Priority => 7;
end FL;
thread FF
-- Feedback Filter
features
angle_o : out event data port Alpha;
angle : in event data port Alpha;
properties
Dispatch_Protocol => Periodic;
Period => 10 ms;
Compute_Execution_Time => 0 ms .. 1 ms;
Deadline => 10 ms;
Priority => 6;
end FF;
thread AP
-- Acceleration Position Acquisition
features
position : in event data port Alpha;
acc : in event data port Alpha;
acc_i : out event data port Alpha;
pos_i : out event data port Alpha;
properties
Dispatch_Protocol => Periodic;
Period => 10 ms;
Compute_Execution_Time => 0 ms .. 1 ms;
Deadline => 10 ms;
Priority => 5;
end AP;
processor cpu
features
i2c : requires bus access i2c_bus;
end cpu;
process node_a
features
angle : in event data port Alpha;
position : in event data port Alpha;
acc : in event data port Alpha;
pos_c : in event data port Alpha;
order : out event data port Alpha;
end node_a;
process implementation node_a.impl
subcomponents
FF : thread FF;
NL : thread NL;
NF : thread NF;
PL : thread PL;
PF : thread PF;
FL : thread FL;
AP : thread AP;
connections
-- Inter-thread communication
V1:port NL.acc_c -> PL.acc_c;
V2:port PL.angle_c -> FL.angle_c;
V3:port NF.pos_o -> NL.pos_o;
V4:port PF.acc_o -> PL.acc_o;
V5:port FF.angle_o -> FL.angle_o;
V6:port AP.acc_i -> PF.acc_i;
V7:port AP.pos_i -> NF.pos_i;
-- Process/thread communication
V8:port pos_c -> NL.pos_c;
V9:port FL.order -> order;
V10:port angle -> FF.angle;
V11:port position -> AP.position;
V12:port acc -> AP.acc;
end node_a.impl;
device Operator
features
pos_c : out event data port Alpha;
i2c : requires bus access i2c_bus;
end Operator;
device GPS
features
position : out event data port Alpha;
i2c : requires bus access i2c_bus;
end GPS;
device IMU
features
angle : out event data port Alpha;
acc : out event data port Alpha;
i2c : requires bus access i2c_bus;
end IMU;
device Platform
features
order : in event data port Alpha;
i2c : requires bus access i2c_bus;
end Platform;
bus I2C_bus
-- I2C bus
end I2C_bus;
system fcs
end fcs;
system implementation fcs.impl
subcomponents
node_a : process node_a.impl;
cpu_rm : processor cpu;
operator : device Operator;
GPS : device GPS;
IMU : device IMU;
platform : device Platform;
i2c : bus i2c_bus;
connections
V13:port operator.pos_c -> node_a.pos_c
{ Actual_Connection_Binding => (reference (i2c));};
V14:port node_a.order -> platform.order
{ Actual_Connection_Binding => (reference (i2c));};
V15:port GPS.position -> node_a.position
{ Actual_Connection_Binding => (reference (i2c));};
V16:port IMU.angle -> node_a.angle
{ Actual_Connection_Binding => (reference (i2c));};
V17:port IMU.acc -> node_a.acc
{ Actual_Connection_Binding => (reference (i2c));};
V18:bus access i2c -> GPS.i2c;
V19:bus access i2c -> IMU.i2c;
V20:bus access i2c -> platform.i2c;
V21:bus access i2c -> cpu_rm.i2c;
properties
Actual_Processor_Binding => (reference (cpu_rm)) applies to node_a;
end fcs.impl;
end FlightControlSystem;
This diff is collapsed.
AADL_VERSION=-aadlv2
OCARINA_FLAGS= -o - -g lnt
AADL_VERSION=-aadlv2
OCARINA_FLAGS= -o - -g lnt
package Producer_Consumer
public
----------
-- Data --
----------
data Alpha_Type
end Alpha_Type;
-----------------
-- Subprograms --
-----------------
subprogram Produce_Spg
features
Data_Source : out parameter Alpha_Type;
end Produce_Spg;
subprogram Consume_Spg
features
Data_Sink : in parameter Alpha_Type;
end Consume_Spg;
-------------
-- Threads --
-------------
thread P
features
Data_Source : out event data port Alpha_Type;
-- XXX Data seems corrupted if Data_Source is an out event data port
properties
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 1 ms .. 8 ms;
Priority => 1;
Period => 10 ms;
end P;
thread implementation P.Impl
calls
Mycall : {
P_Spg : subprogram Produce_Spg;
};
connections
Z1:parameter P_Spg.Data_Source -> Data_Source;
end P.Impl;
thread Q
features
Data_Sink : in event data port Alpha_Type;
properties
Dispatch_Protocol => Sporadic;
Compute_Execution_Time => 1 ms .. 2 ms;
Priority => 2;
Period => 15 ms;
end Q;
thread implementation Q.Impl
calls
Mycall : {
Q_Spg : subprogram Consume_Spg;
};
connections
Z2:parameter Data_Sink -> Q_Spg.Data_Sink;
end Q.Impl;
---------
-- Bus --
---------
bus Ethernet_Bus
end Ethernet_Bus;
---------------
-- Processor --
---------------
processor the_processor
features
ETH : requires bus access Ethernet_Bus;
end the_processor;
---------------
-- Processes --
---------------
process A
features
Alpha : out event data port Alpha_Type;
end A;
process implementation A.Impl
subcomponents
Producer : thread P.Impl;
connections
Z3:port Producer.Data_Source -> Alpha;
end A.Impl;
process B
features
Beta : in event data port Alpha_Type;
end B;
process implementation B.Impl
subcomponents
Consumer : thread Q.Impl;
connections
Z4:port Beta -> Consumer.Data_Sink;
end B.Impl;
------------
-- System --
------------
system PC_Simple
end PC_Simple;
system implementation PC_Simple.Native
subcomponents
T : data Alpha_Type;
pr_A : process A.Impl;
pr_B : process B.Impl;
CPU : processor the_processor;
the_bus : bus Ethernet_Bus;
connections
Z5:bus access the_bus -> CPU.ETH;
Z6:port pr_A.Alpha -> pr_B.Beta
{Actual_Connection_Binding => (reference (the_bus));};
properties
Actual_Processor_Binding => (reference (CPU)) applies to pr_A;
Actual_Processor_Binding => (reference (CPU)) applies to pr_B;
end PC_Simple.Native;
end Producer_Consumer;
This diff is collapsed.
AADL_VERSION=-aadlv2
OCARINA_FLAGS= -o - -g lnt
package radar
public
data radar_types
end radar_types;
SYSTEM radar
END radar;
SYSTEM IMPLEMENTATION radar.simple
SUBCOMPONENTS
aerial : DEVICE antenna;
rotor : DEVICE motor;
monitor : DEVICE screen;
main : PROCESS processing.others;
cpu : PROCESSOR cpu_leon2;
VME : BUS VME;
RAM : MEMORY RAM;
CONNECTIONS
A1:PORT aerial.antenna_out -> main.receive_pulse;
A2:PORT rotor.motor_out -> main.get_angle;
A3:PORT main.send_pulse -> aerial.antenna_in;
A4:PORT main.to_screen -> monitor.screen_in;
A5:BUS ACCESS VME -> aerial.VME;
A6:BUS ACCESS VME -> rotor.VME;
A7:BUS ACCESS VME -> monitor.VME;
A8:BUS ACCESS VME -> cpu.VME;
A9:BUS ACCESS VME -> RAM.VME;
PROPERTIES
Actual_Memory_Binding => (reference (ram)) applies to main;
Actual_Processor_Binding => (reference (cpu)) applies to main;
END radar.simple;
DEVICE antenna
FEATURES
antenna_in : IN EVENT PORT;
antenna_out : OUT DATA PORT radar_types;
VME : REQUIRES BUS ACCESS VME;
PROPERTIES
Compute_Execution_Time => 1 ms .. 2 ms;
Deadline => 1 ms;
Period => 1 ms;
END antenna;
DEVICE motor
FEATURES
motor_out : OUT DATA PORT radar_types;
VME : REQUIRES BUS ACCESS VME;
PROPERTIES
Compute_Execution_Time => 1 ms .. 2 ms;
Deadline => 1 ms;
Period => 1 ms;
END motor;
DEVICE screen
FEATURES
screen_in : IN EVENT PORT;
VME : REQUIRES BUS ACCESS VME;
PROPERTIES
Compute_Execution_Time => 1 ms .. 2 ms;
Deadline => 1 ms;
Period => 1 ms;
END screen;
PROCESS processing
FEATURES
to_screen : OUT EVENT PORT;
send_pulse : OUT EVENT PORT;
receive_pulse : IN DATA PORT radar_types;
get_angle : IN DATA PORT radar_types;
END processing;
PROCESS IMPLEMENTATION processing.others
SUBCOMPONENTS
receive : THREAD receiver.impl;
analyse : THREAD analyser.impl;
display : THREAD display_panel.impl;
transmit : THREAD transmitter.impl;
control_angle : THREAD controller.impl;
CONNECTIONS
A10:PORT receive_pulse -> receive.receiver_in;
A11:PORT display.display_out -> to_screen;
A12:PORT transmit.transmitter_out_1 -> send_pulse;
A13:PORT get_angle -> control_angle.controller_in;
A14:PORT receive.receiver_out -> analyse.from_receiver;
A15:PORT analyse.analyser_out -> display.display_in;
A16:PORT transmit.transmitter_out_2 -> analyse.from_transmitter;
A17:PORT control_angle.controller_out -> analyse.from_controller;
END processing.others;
THREAD receiver
FEATURES
receiver_out : OUT DATA PORT radar_types;
receiver_in : IN DATA PORT radar_types;
END receiver;
THREAD IMPLEMENTATION receiver.impl
CALLS CS : {
RS : SUBPROGRAM Receiver_Spg;
};
CONNECTIONS
A18:PARAMETER RS.receiver_out -> receiver_out;
A19:PARAMETER receiver_in -> RS.receiver_in;
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 1 ms .. 2 ms;
Deadline => 15 ms;
Period => 15 ms;
END receiver.impl;
SUBPROGRAM Receiver_Spg
FEATURES
receiver_out : OUT PARAMETER radar_types;
receiver_in : IN PARAMETER radar_types;
END Receiver_Spg;
THREAD analyser
FEATURES
from_transmitter : IN EVENT PORT;
from_receiver : IN DATA PORT radar_types;
analyser_out : OUT DATA PORT radar_types;
from_controller : IN DATA PORT radar_types;
END analyser;
THREAD IMPLEMENTATION analyser.impl
CALLS CS : {
AS : SUBPROGRAM Analyser_Spg;
};
CONNECTIONS
A20:PARAMETER from_receiver -> AS.from_receiver;
A21:PARAMETER AS.analyser_out -> analyser_out;
A22:PARAMETER from_controller -> AS.from_controller;
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 4 ms .. 6 ms;
Deadline => 50 ms;
Period => 50 ms;
END analyser.impl;
SUBPROGRAM Analyser_Spg
FEATURES
from_receiver : IN PARAMETER radar_types;
analyser_out : OUT PARAMETER radar_types;
from_controller : IN PARAMETER radar_types;
END Analyser_Spg;
THREAD display_panel
FEATURES
display_in : IN DATA PORT radar_types;
display_out : OUT EVENT PORT;
END display_panel;
THREAD IMPLEMENTATION display_panel.impl
CALLS CS : {
DS : SUBPROGRAM Display_Spg;
};
CONNECTIONS
A23:PARAMETER display_in -> DS.display_in;
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 1 ms .. 3 ms;
Deadline => 20 ms;
Period => 20 ms;
END display_panel.impl;
SUBPROGRAM Display_Spg
FEATURES
display_in : IN PARAMETER radar_types;
END Display_Spg;
THREAD transmitter
FEATURES
transmitter_out_1 : OUT EVENT PORT;
transmitter_out_2 : OUT EVENT PORT;
END transmitter;
THREAD IMPLEMENTATION transmitter.impl
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 1 ms .. 1 ms;
Compute_Entrypoint_Source_Text => "radar.transmitter";
Deadline => 5 ms;
Period => 5 ms;
END transmitter.impl;
THREAD controller
FEATURES
controller_in : IN DATA PORT radar_types;
controller_out : OUT DATA PORT radar_types;
END controller;
THREAD IMPLEMENTATION controller.impl
CALLS CS1 : {
CS : SUBPROGRAM Controller_Spg;
};
CONNECTIONS
A24:PARAMETER controller_in -> CS.controller_in;
A25:PARAMETER CS.controller_out -> controller_out;
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 1 ms .. 1 ms;
Deadline => 15 ms;
Period => 15 ms;
END controller.impl;
SUBPROGRAM Controller_Spg
FEATURES
controller_in : IN PARAMETER radar_types;
controller_out : OUT PARAMETER radar_types;
END Controller_Spg;
PROCESSOR cpu_leon2
FEATURES
VME : REQUIRES BUS ACCESS VME;
END cpu_leon2;
BUS VME
END VME;
MEMORY RAM
FEATURES
VME : REQUIRES BUS ACCESS VME;
END RAM;
end radar;
This diff is collapsed.
AADL_VERSION=-aadlv2
OCARINA_FLAGS= -o - -g lnt
package robot
public
----------
-- Data --
----------
data Alpha_Type
end Alpha_Type;
-------------------
-- Subprograms --
-------------------
subprogram collecte_donnee
features
d_source : out parameter Alpha_Type;
DataAccess : requires data access Alpha_Type;
end collecte_donnee;
subprogram traite
features
d_info : in parameter Alpha_Type;
d_ordre : out parameter Alpha_Type;
end traite;
subprogram action
features
d_action : in parameter Alpha_Type;
end action;
---------------
-- Threads --
---------------
-- interfaces
thread capteur
features
evenement : out event data port Alpha_Type {Queue_Size => 2;};
DataAccess : requires data access Alpha_Type;
end capteur;
thread controle
features
comm_servo_out : out event data port Alpha_Type;
info_capteur_in : in event data port Alpha_Type {
Queue_Size => 5;
Overflow_Handling_Protocol => Error;
Queue_Processing_Protocol => FIFO;
Dequeue_Protocol => OneItem;
};
end controle;
thread servomoteur
features
ordre : in event data port Alpha_Type {Queue_Size => 2;};
end servomoteur;
-- implementations
thread implementation capteur.i
calls
Mycall1 : {
D_Spg : subprogram collecte_donnee;
};
connections
parameter D_Spg.d_source -> evenement;
data access DataAccess -> D_Spg.DataAccess;
properties
Dispatch_Protocol => Periodic;
Period => 8 ms;
Compute_Execution_Time => 0 ms .. 2 ms;
end capteur.i;
thread implementation controle.i
calls
Mycall2 : {
T_Spg : subprogram traite;
};
connections
parameter info_capteur_in -> T_Spg.d_info;
parameter T_Spg.d_ordre -> comm_servo_out;
properties
Dispatch_Protocol => Periodic;
Period => 10 ms;
Compute_Execution_Time => 0 ms .. 5 ms;
end controle.i;
thread implementation servomoteur.i
calls
main : {
A_Spg : subprogram action;
};
connections
parameter ordre -> A_Spg.d_action;
properties
Dispatch_Protocol => Sporadic;
Period => 12 ms;
Compute_Execution_Time => 0 ms .. 2 ms;
end servomoteur.i;
-----------------
-- Processes --
-----------------
-- interfaces
process p_capteur
features
evenement1 : out event data port Alpha_Type;
end p_capteur;
process p_controle
features
info_capteur_droit : in event data port Alpha_Type;
comm_servo_droit : out event data port Alpha_Type;
info_capteur_gauche : in event data port Alpha_Type;
comm_servo_gauche : out event data port Alpha_Type;
end p_controle;
process p_servomoteur
features
ordre : in event data port Alpha_Type;
end p_servomoteur;
-- implementations
process implementation p_capteur.i
subcomponents
th_c : thread capteur.i;
connections
port th_c.evenement -> evenement1;
end p_capteur.i;
process implementation p_controle.i
subcomponents
th_ctrl_droit : thread controle.i;
th_ctrl_gauche : thread controle.i;
connections
in_pro1 : port info_capteur_droit -> th_ctrl_droit.info_capteur_in;
port th_ctrl_droit.comm_servo_out -> comm_servo_droit;
port info_capteur_gauche -> th_ctrl_gauche.info_capteur_in;
port th_ctrl_gauche.comm_servo_out -> comm_servo_gauche;
end p_controle.i;
process implementation p_servomoteur.i
subcomponents
th_servomoteur : thread servomoteur.i;
connections
port ordre -> th_servomoteur.ordre;
end p_servomoteur.i;
--------------
-- System --
--------------
processor the_processor
end the_processor;
-- interface