Commit 5580af77 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Work on the concurrency view

parent 7dd9fa58
-- ************************ taste aadl parser **************************** --
-- (c) 2008-2018 European Space Agency - maxime.perrotin@esa.int
-- (c) 2008-2019 European Space Agency - maxime.perrotin@esa.int
-- LGPL license, see LICENSE file
-- Define a generic Option type
generic
......
......@@ -25,9 +25,26 @@ package body TASTE.Concurrency_View is
for Thread of Block.Calling_Threads loop
Put_Line (Output, " |_ Calling_Thread : " & Thread);
end loop;
Put_Line (Output, " |_ Node : "
& To_String (Block.Node.Value_Or
(Taste_Node'(Name => US ("(none)"), others => <>)).Name));
if Block.Node.Has_Value then
Put_Line (Output, " |_ Node : "
& To_String (Block.Node.Unsafe_Just.Name));
declare
P : constant Taste_Partition :=
Block.Node.Unsafe_Just.Find_Partition
(To_String (Block.Name)).Unsafe_Just;
begin
Put_Line (Output, " |_ Partition : " & To_String (P.Name));
Put_Line (Output, " |_ Coverage : " & P.Coverage'Img);
Put_Line (Output, " |_ Package : "
& To_String (P.Package_Name));
Put_Line (Output, " |_ CPU Name : "
& To_String (P.CPU_Name));
Put_Line (Output, " |_ CPU Platform : "
& P.CPU_Platform'Img);
Put_Line (Output, " |_ CPU Classifier : "
& To_String (P.CPU_Classifier));
end;
end if;
end loop;
for Thread of CV.Threads loop
......
......@@ -476,6 +476,18 @@ package body TASTE.Deployment_View is
return Option_Node.Nothing;
end Find_Node;
function Find_Partition (Node : Taste_Node;
Function_Name : String)
return Option_Partition.Option is
begin
for Partition of Node.Partitions loop
if Partition.Bound_Functions.Contains (Function_Name) then
return Option_Partition.Just (Partition);
end if;
end loop;
return Option_Partition.Nothing;
end Find_Partition;
procedure Dump_Nodes (DV : Complete_Deployment_View; Output : File_Type) is
begin
for Each of DV.Nodes loop
......
......@@ -145,13 +145,18 @@ package TASTE.Deployment_View is
package Taste_Partitions is
new Indefinite_Ordered_Maps (String, Taste_Partition);
type Taste_Node is
type Taste_Node is tagged
record
Name : Unbounded_String;
Drivers : Taste_Drivers.Vector;
Partitions : Taste_Partitions.Map;
end record;
-- Helper function: find the partition where a function is bounded
function Find_Partition (Node : Taste_Node;
Function_Name : String)
return Option_Partition.Option;
package Node_Maps is new Indefinite_Ordered_Maps (String, Taste_Node);
type Complete_Deployment_View is tagged
......
--------------------------------------------------------
--! File generated by asn2aadl v2.1.27: DO NOT EDIT !
--------------------------------------------------------
--! InputASN1FileChecksum:6bf664b31ce9ca6fd89af52cea7ea0f2:/home/taste/aadl-parser/test/test-cv/DataView.asn:
--! InputASN1FileChecksum:ee8a7e01f29874c0d50f437d5abb9599:/home/taste/tool-inst/share/taste-types/taste-types.asn:
--------------------------------------------------------
package DataView
public
with Data_Model;
with Taste;
with Base_Types;
with Deployment;
DATA Simulink_Tunable_Parameter
PROPERTIES
TASTE::Ada_Package_Name => "TASTE_Directives";
Type_Source_Name => "Simulink-Tunable-Parameter";
Deployment::ASN1_Module_Name => "TASTE-Directives";
TASTE::Forbid_in_PI => true;
END Simulink_Tunable_Parameter;
DATA Timer
PROPERTIES
TASTE::Ada_Package_Name => "TASTE_Directives";
Type_Source_Name => "Timer";
Deployment::ASN1_Module_Name => "TASTE-Directives";
TASTE::Forbid_in_PI => true;
END Timer;
DATA Taste_directive
PROPERTIES
TASTE::Ada_Package_Name => "TASTE_Directives";
Type_Source_Name => "Taste-directive";
Deployment::ASN1_Module_Name => "TASTE-Directives";
TASTE::Forbid_in_PI => true;
END Taste_directive;
data Stream_Element_Buffer
-- Root type for buffer elements
properties
Data_Model::Data_Representation => Character;
end Stream_Element_Buffer;
DATA T_Int32
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn");
TASTE::Ada_Package_Name => "TASTE_BasicTypes";
Deployment::ASN1_Module_Name => "TASTE-BasicTypes";
Source_Language => (ASN1);
-- Size of a buffer to cover all forms of message representation:
-- Real message size is 8; suggested aligned message buffer is...
Source_Data_Size => 8 Bytes;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-Int32";
-- what kind of type is this?
TASTE::ASN1_Basic_Type =>aINTEGER;
END T_Int32;
DATA IMPLEMENTATION T_Int32.impl
END T_Int32.impl;
DATA T_Int32_Buffer_Max
END T_Int32_Buffer_Max;
DATA IMPLEMENTATION T_Int32_Buffer_Max.impl
-- Buffer to hold a marshalled data of type T_Int32
PROPERTIES
Data_Model::Data_Representation => array;
Data_Model::Dimension => (8); -- Size of the buffer
Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer));
END T_Int32_Buffer_Max.impl;
DATA T_Int32_Buffer
END T_Int32_Buffer;
DATA IMPLEMENTATION T_Int32_Buffer.impl
-- Buffer to hold a marshalled data of type T_Int32
SUBCOMPONENTS
Buffer : data T_Int32_Buffer_Max.impl;
Length : data Base_Types::Unsigned_32;
PROPERTIES
Data_Model::Data_Representation => Struct;
END T_Int32_Buffer.impl;
DATA T_UInt8
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn");
TASTE::Ada_Package_Name => "TASTE_BasicTypes";
Deployment::ASN1_Module_Name => "TASTE-BasicTypes";
Source_Language => (ASN1);
-- Size of a buffer to cover all forms of message representation:
-- Real message size is 8; suggested aligned message buffer is...
Source_Data_Size => 8 Bytes;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-UInt8";
-- what kind of type is this?
TASTE::ASN1_Basic_Type =>aINTEGER;
END T_UInt8;
DATA IMPLEMENTATION T_UInt8.impl
END T_UInt8.impl;
DATA T_UInt8_Buffer_Max
END T_UInt8_Buffer_Max;
DATA IMPLEMENTATION T_UInt8_Buffer_Max.impl
-- Buffer to hold a marshalled data of type T_UInt8
PROPERTIES
Data_Model::Data_Representation => array;
Data_Model::Dimension => (8); -- Size of the buffer
Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer));
END T_UInt8_Buffer_Max.impl;
DATA T_UInt8_Buffer
END T_UInt8_Buffer;
DATA IMPLEMENTATION T_UInt8_Buffer.impl
-- Buffer to hold a marshalled data of type T_UInt8
SUBCOMPONENTS
Buffer : data T_UInt8_Buffer_Max.impl;
Length : data Base_Types::Unsigned_32;
PROPERTIES
Data_Model::Data_Representation => Struct;
END T_UInt8_Buffer.impl;
DATA T_Boolean
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn");
TASTE::Ada_Package_Name => "TASTE_BasicTypes";
Deployment::ASN1_Module_Name => "TASTE-BasicTypes";
Source_Language => (ASN1);
-- Size of a buffer to cover all forms of message representation:
-- Real message size is 1; suggested aligned message buffer is...
Source_Data_Size => 8 Bytes;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-Boolean";
-- what kind of type is this?
TASTE::ASN1_Basic_Type =>aBOOLEAN;
END T_Boolean;
DATA IMPLEMENTATION T_Boolean.impl
END T_Boolean.impl;
DATA T_Boolean_Buffer_Max
END T_Boolean_Buffer_Max;
DATA IMPLEMENTATION T_Boolean_Buffer_Max.impl
-- Buffer to hold a marshalled data of type T_Boolean
PROPERTIES
Data_Model::Data_Representation => array;
Data_Model::Dimension => (8); -- Size of the buffer
Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer));
END T_Boolean_Buffer_Max.impl;
DATA T_Boolean_Buffer
END T_Boolean_Buffer;
DATA IMPLEMENTATION T_Boolean_Buffer.impl
-- Buffer to hold a marshalled data of type T_Boolean
SUBCOMPONENTS
Buffer : data T_Boolean_Buffer_Max.impl;
Length : data Base_Types::Unsigned_32;
PROPERTIES
Data_Model::Data_Representation => Struct;
END T_Boolean_Buffer.impl;
DATA T_UInt32
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn");
TASTE::Ada_Package_Name => "TASTE_BasicTypes";
Deployment::ASN1_Module_Name => "TASTE-BasicTypes";
Source_Language => (ASN1);
-- Size of a buffer to cover all forms of message representation:
-- Real message size is 8; suggested aligned message buffer is...
Source_Data_Size => 8 Bytes;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-UInt32";
-- what kind of type is this?
TASTE::ASN1_Basic_Type =>aINTEGER;
END T_UInt32;
DATA IMPLEMENTATION T_UInt32.impl
END T_UInt32.impl;
DATA T_UInt32_Buffer_Max
END T_UInt32_Buffer_Max;
DATA IMPLEMENTATION T_UInt32_Buffer_Max.impl
-- Buffer to hold a marshalled data of type T_UInt32
PROPERTIES
Data_Model::Data_Representation => array;
Data_Model::Dimension => (8); -- Size of the buffer
Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer));
END T_UInt32_Buffer_Max.impl;
DATA T_UInt32_Buffer
END T_UInt32_Buffer;
DATA IMPLEMENTATION T_UInt32_Buffer.impl
-- Buffer to hold a marshalled data of type T_UInt32
SUBCOMPONENTS
Buffer : data T_UInt32_Buffer_Max.impl;
Length : data Base_Types::Unsigned_32;
PROPERTIES
Data_Model::Data_Representation => Struct;
END T_UInt32_Buffer.impl;
DATA TASTE_Boolean
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("/home/taste/aadl-parser/test/test-cv/DataView.asn");
TASTE::EncodingDefinitionFile => classifier(DataView::ACN_DataView);
TASTE::Ada_Package_Name => "TASTE_Dataview";
Deployment::ASN1_Module_Name => "TASTE-Dataview";
Source_Language => (ASN1);
-- Size of a buffer to cover all forms of message representation:
-- Real message size is 1; suggested aligned message buffer is...
Source_Data_Size => 8 Bytes;
-- name of the corresponding data type in the source file:
Type_Source_Name => "TASTE-Boolean";
-- what kind of type is this?
TASTE::ASN1_Basic_Type =>aBOOLEAN;
END TASTE_Boolean;
DATA IMPLEMENTATION TASTE_Boolean.impl
END TASTE_Boolean.impl;
DATA TASTE_Boolean_Buffer_Max
END TASTE_Boolean_Buffer_Max;
DATA IMPLEMENTATION TASTE_Boolean_Buffer_Max.impl
-- Buffer to hold a marshalled data of type TASTE_Boolean
PROPERTIES
Data_Model::Data_Representation => array;
Data_Model::Dimension => (8); -- Size of the buffer
Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer));
END TASTE_Boolean_Buffer_Max.impl;
DATA TASTE_Boolean_Buffer
END TASTE_Boolean_Buffer;
DATA IMPLEMENTATION TASTE_Boolean_Buffer.impl
-- Buffer to hold a marshalled data of type TASTE_Boolean
SUBCOMPONENTS
Buffer : data TASTE_Boolean_Buffer_Max.impl;
Length : data Base_Types::Unsigned_32;
PROPERTIES
Data_Model::Data_Representation => Struct;
END TASTE_Boolean_Buffer.impl;
DATA T_Int8
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("/home/taste/tool-inst/share/taste-types/taste-types.asn");
TASTE::Ada_Package_Name => "TASTE_BasicTypes";
Deployment::ASN1_Module_Name => "TASTE-BasicTypes";
Source_Language => (ASN1);
-- Size of a buffer to cover all forms of message representation:
-- Real message size is 8; suggested aligned message buffer is...
Source_Data_Size => 8 Bytes;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-Int8";
-- what kind of type is this?
TASTE::ASN1_Basic_Type =>aINTEGER;
END T_Int8;
DATA IMPLEMENTATION T_Int8.impl
END T_Int8.impl;
DATA T_Int8_Buffer_Max
END T_Int8_Buffer_Max;
DATA IMPLEMENTATION T_Int8_Buffer_Max.impl
-- Buffer to hold a marshalled data of type T_Int8
PROPERTIES
Data_Model::Data_Representation => array;
Data_Model::Dimension => (8); -- Size of the buffer
Data_Model::Base_Type => (classifier (DataView::Stream_Element_Buffer));
END T_Int8_Buffer_Max.impl;
DATA T_Int8_Buffer
END T_Int8_Buffer;
DATA IMPLEMENTATION T_Int8_Buffer.impl
-- Buffer to hold a marshalled data of type T_Int8
SUBCOMPONENTS
Buffer : data T_Int8_Buffer_Max.impl;
Length : data Base_Types::Unsigned_32;
PROPERTIES
Data_Model::Data_Representation => Struct;
END T_Int8_Buffer.impl;
SYSTEM Taste_DataView
END Taste_DataView;
SYSTEM IMPLEMENTATION Taste_DataView.others
SUBCOMPONENTS
T_Int32 : DATA T_Int32.impl;
T_UInt8 : DATA T_UInt8.impl;
T_Boolean : DATA T_Boolean.impl;
T_UInt32 : DATA T_UInt32.impl;
TASTE_Boolean : DATA TASTE_Boolean.impl;
T_Int8 : DATA T_Int8.impl;
END Taste_DataView.others;
DATA ACN_DataView
PROPERTIES
Source_Text => ("/home/taste/aadl-parser/test/test-cv/DataView.acn");
Source_Language => (ACN);
END ACN_DataView;
end DataView;
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
TASTE-Boolean ::= BOOLEAN
-- ASN.1 Type definitions must start with an uppercase
-- Field names in records (SEQUENCE) must start with a lowercase
-- Underscores are not allowed: use dash (hyphen)
-- Simple types:
-- MyInteger ::= INTEGER (0..255)
-- MyReal ::= REAL (0.0 .. 1000.0)
-- MyBool ::= BOOLEAN
-- MyEnum ::= ENUMERATED { hello, world, how-are-you }
-- Complex types:
-- MySeq ::= SEQUENCE {
-- input-data MyInteger,
-- output-data MyInteger,
-- validity ENUMERATED { valid, invalid }
-- }
--
-- MyChoice ::= CHOICE {
-- a BOOLEAN,
-- b MySeq
-- }
--
-- MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum
--
-- MyOctStr ::= OCTET STRING (SIZE (3))
--
-- -- You can also declare constants
-- myVar MySeqOf ::= { hello, world }
END
---------------------------------------------------
-- AADL2.1
-- TASTE type deploymentview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE deploymentview::DV::Node1
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS demo_partition
END demo_partition;
PROCESS IMPLEMENTATION demo_partition.others
END demo_partition.others;
END deploymentview::DV::Node1;
PACKAGE deploymentview::DV
PUBLIC
WITH interfaceview::IV::obsw;
WITH interfaceview::IV::GNC;
WITH interfaceview::IV::ground;
WITH ocarina_processors_x86;
WITH deploymentview::DV::Node1;
WITH Taste;
WITH Deployment;
WITH interfaceview::IV;
WITH TASTE_DV_Properties;
SYSTEM Node1
END Node1;
SYSTEM IMPLEMENTATION Node1.others
SUBCOMPONENTS
IV_obsw : SYSTEM interfaceview::IV::obsw::obsw.others {
Taste::FunctionName => "obsw";
};
IV_GNC : SYSTEM interfaceview::IV::GNC::GNC.others {
Taste::FunctionName => "GNC";
};
IV_ground : SYSTEM interfaceview::IV::ground::ground.others {
Taste::FunctionName => "ground";
};
demo_partition : PROCESS deploymentview::DV::Node1::demo_partition.others {
Taste::coordinates => "120727 61794 150761 81857";
Deployment::Port_Number => 0;
};
x86_linux : PROCESSOR ocarina_processors_x86::x86.linux {
Taste::coordinates => "116973 56062 154515 84723";
};
PROPERTIES
Taste::APLC_Binding => (reference (demo_partition)) APPLIES TO IV_obsw;
Taste::APLC_Binding => (reference (demo_partition)) APPLIES TO IV_GNC;
Taste::APLC_Binding => (reference (demo_partition)) APPLIES TO IV_ground;
Actual_Processor_Binding => (reference (x86_linux)) APPLIES TO demo_partition;
END Node1.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
Node1 : SYSTEM Node1.others {
Taste::coordinates => "112280 47873 159208 88817";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.0";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("/home/taste/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
---------------------------------------------------
-- AADL2.1
-- TASTE type interfaceview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE interfaceview::IV::obsw
PUBLIC
WITH interfaceview::IV::GNC;
WITH interfaceview::IV::ground;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_pulse
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_pulse;
SUBPROGRAM IMPLEMENTATION PI_pulse.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 100 ms;
END PI_pulse.others;
SUBPROGRAM PI_run
FEATURES
a : IN PARAMETER DataView::T_Boolean {
Taste::encoding => UPER;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_run;
SUBPROGRAM IMPLEMENTATION PI_run.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_run.others;
SUBPROGRAM RI_guidance
FEATURES
a : IN PARAMETER DataView::T_UInt32 {
Taste::encoding => NATIVE;
};
result : OUT PARAMETER DataView::T_Boolean {
Taste::encoding => NATIVE;
};
END RI_guidance;
SUBPROGRAM IMPLEMENTATION RI_guidance.others
END RI_guidance.others;
SUBPROGRAM RI_result
FEATURES
p : IN PARAMETER DataView::T_UInt32 {
Taste::encoding => UPER;
};
END RI_result;
SUBPROGRAM IMPLEMENTATION RI_result.others
END RI_result.others;
SYSTEM obsw
FEATURES
PI_pulse : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::obsw::PI_pulse.others {
Taste::coordinates => "99841 57006";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 1000 ms;
Taste::Deadline => 12 ms;
Taste::InterfaceName => "pulse";
};
PI_run : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::obsw::PI_run.others {
Taste::coordinates => "112280 75589";
Taste::RCMoperationKind => sporadic;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "run";
};
RI_guidance : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::GNC::PI_guidance.others {
Taste::coordinates => "118422 60156";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "guidance";
Taste::labelInheritance => "true";
};
RI_result : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::ground::PI_result.others {
Taste::coordinates => "118422 71181";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "result";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (SDL);
Taste::Active_Interfaces => any;
END obsw;
SYSTEM IMPLEMENTATION obsw.others
END obsw.others;
END interfaceview::IV::obsw;
PACKAGE interfaceview::IV::GNC
PUBLIC