wiki:CaseStudyFlightMgmt
close Warning: Can't synchronize with repository "(default)" (Couldn't open Subversion repository /var/repositories/svn/aadl: SubversionException: ("Failed to load module for FS type 'fsfs'", 160033)). Look in the Trac log for more information.

Flight Management System

About this model

This model was done to prove the correctness of our code generator regarding real systems. It contains several threads that exchange data through event ports. It can be generated with Ocarina and runs with our Ada and C AADL runtimes.

AADL model

----------
-- Data --
----------

data Ravenscar
end Ravenscar;

data implementation Ravenscar.Integer
properties
  Data_Model::Data_Representation => Integer;
end Ravenscar.Integer;

-------------
-- Threads --
-------------

thread Sensor_Sim_T
features
  AoA            : out       data port Ravenscar.Integer;
  Climb_Rate     : out       data port Ravenscar.Integer;
  Engine_Failure : out event      port;
end Sensor_Sim_T;

thread Stall_Monitor_T
features
  AoA        : in        data port Ravenscar.Integer;
  Climb_Rate : in        data port Ravenscar.Integer;
  Stall_Warn : out event data port Ravenscar.Integer;
end Stall_Monitor_T;

thread Landing_Gear_T
features
  Req       : in  event port {Compute_Entrypoint => "On_Req";};
  Ack       : out event port;
  Dummy_Out : out event port;
  Dummy_In  : in  event port {Compute_Entrypoint => "On_Dummy_In";};
end Landing_Gear_T;

thread HCI_T
features
  Stall_Warning  : in  event data port Ravenscar.Integer 
    {Compute_Entrypoint => "On_Stall_Warning";};
  Engine_Failure : in  event      port 
    {Compute_Entrypoint => "On_Engine_Failure";};
  Gear_Cmd       : in  event      port 
    {Compute_Entrypoint => "On_Gear_Cmd";};
  Gear_Req       : out event      port;
  Gear_Ack       : in  event      port 
    {Compute_Entrypoint => "On_Gear_Ack";};
end HCI_T;

thread Operator_T
features
  Gear_Cmd: out event port;
end Operator_T;

thread implementation Sensor_Sim_T.RS
properties
  Period             => 20 Ms;
  Compute_Entrypoint => "On_Sensor_Sim";
  Dispatch_Protocol  => Periodic;
  Deadline           => 15 Ms;
  source_text        => ("flight-mgmt.c");
end Sensor_Sim_T.RS;

thread implementation Stall_Monitor_T.RS
properties
  Compute_Entrypoint => "On_Stall_Monitor";
  Dispatch_Protocol  => Periodic;
  Period             => 20 Ms;
  source_text        => ("flight-mgmt.c");
end Stall_Monitor_T.RS;

thread implementation HCI_T.RS
properties
  Dispatch_Protocol => Sporadic;
  Period            => 10 Ms;
end HCI_T.RS;

thread implementation Landing_Gear_T.RS
properties
  Dispatch_Protocol => Sporadic;
  Period            => 3000 Ms;
end Landing_Gear_T.RS;

thread implementation Operator_T.RS
properties
  Dispatch_Protocol  => Periodic;
  Period             => 10 Sec;
  Compute_Entrypoint => "On_Operator";
  source_text        => ("flight-mgmt.c");
end Operator_T.RS;

---------------
-- Processes --
---------------

process Mgmt_T
end Mgmt_T;

process implementation Mgmt_T.RS
subcomponents
  Sensor_Sim    : thread Sensor_Sim_T.RS;
  Stall_Monitor : thread Stall_Monitor_T.RS;
  HCI           : thread HCI_T.RS;
  Landing_Gear  : thread Landing_Gear_T.RS;
  Operator      : thread Operator_T.RS;
connections
  DataConnection1      :       data port Sensor_Sim.AoA 
    -> Stall_Monitor.AoA;
  DataConnection2      :       data port Sensor_Sim.Climb_Rate 
    -> Stall_Monitor.Climb_Rate;
  EventConnection1     : event      port Sensor_Sim.Engine_Failure 
    -> HCI.Engine_Failure;
  EventDataConnection1 : event data port Stall_Monitor.Stall_Warn 
    -> HCI.Stall_Warning;
  EventConnection2     : event      port HCI.Gear_Req 
    -> Landing_Gear.Req;
  EventConnection3     : event      port Landing_Gear.Ack 
    -> HCI.Gear_Ack;
  EventConnection4     : event      port Landing_Gear.Dummy_Out 
    -> Landing_Gear.Dummy_In;
  EventConnection5     : event      port Operator.Gear_Cmd 
    -> HCI.Gear_Cmd;
end Mgmt_T.RS;

---------------
-- Processor --
---------------

processor the_processor
properties
  Deployment::Execution_Platform => native;
end the_processor;

------------
-- System --
------------

system Flight_Mgmt
end Flight_Mgmt;

system implementation Flight_Mgmt.RS
subcomponents
  CPU  : processor the_processor;
  Mgmt : process Mgmt_T.RS;
properties
  Actual_Processor_Binding => reference CPU applies to Mgmt;
end Flight_Mgmt.RS;
Last modified 9 years ago Last modified on 03/11/09 15:47:21