wiki:CaseStudySimulink
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.

Simulink case study

The F14 model

In Simulink, an example model design an avionic system. This avionic system uses several components in Simulink. Our goal is to map this example in AADL generated application. To do that, we need to integrate the Simulink model inside the AADL model.

Simulink model (graphical version)

AADL model (graphical version)

Mapping challenges

In this example, we map each color on a node in a distributed system in the architecture. For that, we map each color of the Simulink model into a distinct AADL subprogram and each node calls one AADL subprogram. The model is given below.

AADL model (textual version)

package flight_control

public

data simulink_realt
properties
   Type_Source_Name => "real_T";
   Source_Name => "sldemo_f14";
   source_text     => ("../../simulink-code");
   Source_Data_Size => 8 Bytes;
   source_language => Simulink;
end simulink_realt;

--
-- All controller stuff
--

subprogram controller_spg
features
   actuator          : out parameter simulink_realt {Source_Name => "sldemo_f14/Actuator Model";};
   aircraft3         : in  parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Gain1";};
   aircraftblibli    : in  parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Pitch Channel/Integrate qdot";};
properties
   source_language => Simulink;
   source_name     => "sldemo_f14";
   source_text     => ("../../simulink-code");
end controller_spg;

thread controller_thr
features
   actuator          : out data port simulink_realt;
   aircraft3         : in  data port simulink_realt;
   aircraftblibli    : in  data port simulink_realt;
properties
   Dispatch_Protocol                  => Periodic;
   Period                             => 1000 Ms;
end controller_thr;

thread implementation controller_thr.impl
calls
seq:
{
   myspg : subprogram controller_spg;
};
connections
   parameter myspg.actuator -> actuator;
   parameter aircraft3      -> myspg.aircraft3;
   parameter aircraftblibli -> myspg.aircraftblibli;
end controller_thr.impl;

process controller
features
   actuator          : out data port simulink_realt;
   aircraft3         : in  data port simulink_realt;
   aircraftblibli    : in  data port simulink_realt;
end controller;

process implementation controller.impl
subcomponents
   thr : thread controller_thr.impl;
connections
   port thr.actuator    -> actuator;
   port aircraft3       -> thr.aircraft3;
   port aircraftblibli  -> thr.aircraftblibli;
end controller.impl;

--
-- All aircraft stuff
--

subprogram aircraft_spg
features
   actuatorsrc       : in  parameter simulink_realt {Source_Name => "sldemo_f14/Actuator Model";};
   aircraft1         : out parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Vertical Channel/Sum";};
   aircraft2         : out parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Pitch Channel/Sum";};
   blibli            : out parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Pitch Channel/Integrate qdot";};
   aircraft3         : out parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Gain1";};
properties
   source_language => Simulink;
   source_name     => "sldemo_f14";
   source_text     => ("../../simulink-code");
end aircraft_spg;

thread aircraft_thr
features
   actuatorsrc       : in  data port simulink_realt;
   aircraft1         : out data port simulink_realt;
   aircraft2         : out data port simulink_realt;
   blibli            : out data port simulink_realt;
   aircraft3         : out data port simulink_realt;
properties
   Dispatch_Protocol                  => Periodic;
   Period                             => 1000 Ms;
end aircraft_thr;

thread implementation aircraft_thr.impl
calls
seq:
{
   myspg : subprogram aircraft_spg;
};
connections
   parameter actuatorsrc     -> myspg.actuatorsrc;
   parameter myspg.aircraft1 -> aircraft1;
   parameter myspg.aircraft2 -> aircraft2;
   parameter myspg.aircraft3 -> aircraft3;
   parameter myspg.blibli    -> blibli;
end aircraft_thr.impl;

process aircraft
features
   actuatorsrc       : in  data port simulink_realt;
   aircraft1         : out data port simulink_realt;
   aircraft2         : out data port simulink_realt;
   blibli            : out data port simulink_realt;
   aircraft3         : out data port simulink_realt;
end aircraft;

process implementation aircraft.impl
subcomponents
   mythr : thread aircraft_thr.impl;
connections
   port actuatorsrc     -> mythr.actuatorsrc;
   port mythr.aircraft1 -> aircraft1;
   port mythr.aircraft2 -> aircraft2;
   port mythr.aircraft3 -> aircraft3;
   port mythr.blibli    -> blibli;
end aircraft.impl;

--
--  All pilot stuff
--

subprogram pilot_spg
features
   aircraft1         : in parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Vertical Channel/Sum";};
   aircraft2         : in parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Pitch Channel/Sum";};
   blibli            : in parameter simulink_realt {Source_Name => "sldemo_f14/Aircraft Dynamics Model/Pitch Channel/Integrate qdot";};
properties
   source_language => Simulink;
   source_name     => "sldemo_f14";
   source_text     => ("../../simulink-code");
end pilot_spg;

thread pilot_thr
features
   aircraft1         : in  data port simulink_realt;
   aircraft2         : in  data port simulink_realt;
   blibli            : in  data port simulink_realt;
properties
   Dispatch_Protocol                  => Periodic;
   Period                             => 1000 Ms;
end pilot_thr;

thread implementation pilot_thr.impl
calls
seq:
{
   myspg : subprogram pilot_spg;
};
connections
   parameter aircraft1 -> myspg.aircraft1;
   parameter aircraft2 -> myspg.aircraft2;
   parameter blibli    -> myspg.blibli;
end pilot_thr.impl;

process pilot
features
   aircraft1         : in  data port simulink_realt;
   aircraft2         : in  data port simulink_realt;
   blibli            : in  data port simulink_realt;
end pilot;

process implementation pilot.impl
subcomponents
   thr : thread pilot_thr.impl;
connections
   port aircraft1 -> thr.aircraft1;
   port aircraft2 -> thr.aircraft2;
   port blibli    -> thr.blibli;
end pilot.impl;


--
--  Main system
--

processor cpu
features
   net : requires bus access ethernet;
end cpu;

processor implementation cpu.impl
properties
   Deployment::location           => "127.0.0.1";
   Deployment::Execution_Platform => Native;
end cpu.impl;

bus ethernet
properties
  Deployment::Transport_API => BSD_Sockets;
end ethernet;


system main_system
end main_system;

system implementation main_system.impl
subcomponents
--  Hardware components
   net         : bus ethernet;
   mycpu       : processor cpu.impl;

--  Software components
   pilot       : process pilot.impl       {Deployment::port_number => 12002;};
   aircraft    : process aircraft.impl    {Deployment::port_number => 12003;};
   controller  : process controller.impl  {Deployment::port_number => 12004;};
connections
   port controller.actuator   -> aircraft.actuatorsrc {Actual_Connection_Binding => (reference (net));};
   port aircraft.blibli       -> controller.aircraftblibli {Actual_Connection_Binding => (reference (net));};
   port aircraft.aircraft3    -> controller.aircraft3 {Actual_Connection_Binding => (reference (net));};
   port aircraft.aircraft2    -> pilot.aircraft2 {Actual_Connection_Binding => (reference (net));};
   port aircraft.aircraft1    -> pilot.aircraft1 {Actual_Connection_Binding => (reference (net));};
   port aircraft.blibli       -> pilot.blibli {Actual_Connection_Binding => (reference (net));};
properties
   actual_processor_binding => (reference (mycpu)) applies to pilot;
   actual_processor_binding => (reference (mycpu)) applies to aircraft;
   actual_processor_binding => (reference (mycpu)) applies to controller;
end main_system.impl;

end flight_control;
Last modified 8 years ago Last modified on 06/05/09 17:01:34

Attachments (2)

Download all attachments as: .zip