Commit f57e80a5 authored by Maxime Perrotin's avatar Maxime Perrotin
parents e56596cd 843b8240
......@@ -4,34 +4,39 @@ property set EMV2
is
OccurrenceDistribution : EMV2::DistributionSpecification
applies to ({emv2}**error propagation, {emv2}**error flow, {emv2}**error behavior event
,{emv2}**error behavior state,{emv2}**error type,{emv2}**type set);
applies to ({emv2}**error propagation, {emv2}**error flow, {emv2}**error behavior event
,{emv2}**error behavior state,{emv2}**error type,{emv2}**type set);
--needed to separate the property "Occurrence" from its type declaration
--so other properties may have that type
DistributionSpecification : type record (
ProbabilityValue : aadlreal;
OccurrenceRate : aadlreal;
MeanValue : aadlreal;
StandardDeviation : aadlreal;
ShapeParameter : aadlreal;
ScaleParameter : aadlreal;
SuccessCount : aadlreal;
SampleCount : aadlreal;
Probability : aadlreal;
Distribution : EMV2::DistributionFunction;);
--Fixed represents a fixed distribution and takes a single parameter OccurrenceRate or ProbabilityValue.
--Poisson aka. Exponential represents an exponential distribution and takes a single parameter OccurrenceRate or ProbabilityValue.
--Normal aka. Gauss represents a distribution with an explicitly specified MeanValue and StandardDeviation.
--Weibull represents a shaped distribution with a ShapeParameter and a ScaleParameter.
--Binominal represents represents a discrete distribution with a SuccessCount, a SampleCount, and a Probability parameter.
ProbabilityValue : aadlreal;
OccurrenceRate : aadlreal;
MeanValue : aadlreal;
StandardDeviation : aadlreal;
ShapeParameter : aadlreal;
ScaleParameter : aadlreal;
SuccessCount : aadlreal;
SampleCount : aadlreal;
Probability : aadlreal;
Distribution : EMV2::DistributionFunction;);
-- Fixed represents a fixed distribution and takes a single parameter OccurrenceRate or ProbabilityValue.
-- Poisson aka. Exponential represents an exponential distribution and takes a single parameter OccurrenceRate or ProbabilityValue.
-- Normal aka. Gauss represents a distribution with an explicitly specified MeanValue and StandardDeviation.
-- Weibull represents a shaped distribution with a ShapeParameter and a ScaleParameter.
-- Binominal represents represents a discrete distribution with a SuccessCount, a SampleCount, and a Probability parameter.
DistributionFunction : type enumeration (Fixed, Poisson, Exponential, Normal, Gauss, Weibull, Binominal);
ExposurePeriod : aadlreal
applies to ({emv2}**error propagation, {emv2}**error flow, {emv2}**error behavior event
,{emv2}**error behavior state,{emv2}**error type,{emv2}**type set);
DurationDistributionSpecification : type record (
Duration : Time_Range;
Distribution : EMV2::DistributionFunction;);
Duration : Time_Range;
Distribution : EMV2::DistributionFunction;);
DurationDistribution : EMV2::DurationDistributionSpecification applies to ({emv2}**Repair Event, {emv2}**Recover Event,
{emv2}**Error Behavior Transition);
......@@ -42,14 +47,18 @@ DurationDistribution : EMV2::DurationDistributionSpecification applies to ({emv2
PropagationTimeDelay: EMV2::DurationDistributionSpecification
applies to (connection, {emv2}**propagation path);
-- property used to paramterize the transition branches in predeclared Error Behavior State Machines
TransientFailureRatio: aadlreal applies to ({EMV2}** Error Behavior Transition);
RecoveryFailureRatio: aadlreal applies to ({EMV2}** Error Behavior Transition);
StateKind : EMV2::StateKindEnum
applies to ({emv2}**error behavior state);
applies to ({emv2}**error behavior state);
StateKindEnum: type enumeration (Working, NonWorking);
-- Indicates whether an error type is detectable
DetectionMechanism : aadlstring
applies to ({emv2}**error detection);
applies to ({emv2}**error detection);
-- The FaultKind property allows the user to specify whether an error source,
......@@ -57,7 +66,7 @@ DetectionMechanism : aadlstring
-- Design faults are faults that could be eliminated at design time, but if present result in an error.
-- Operational faults are faults that inherently occur during operation and should be detected and managed during operation.
FaultKind : EMV2::FaultKindEnum
applies to ( {emv2}**error event, {emv2}**error propagation, {emv2}**error source, {emv2}**error type, {emv2}**type set);
applies to ( {emv2}**error event, {emv2}**error propagation, {emv2}**error source, {emv2}**error type, {emv2}**type set);
FaultKindEnum: type enumeration (Design, Operational);
......@@ -68,8 +77,8 @@ FaultKindEnum: type enumeration (Design, Operational);
-- In a discrete event system a transient error may last over several discrete events, e.g., a corrupted message may be sent over multiple periods.
-- A singleton error occurs in the context of a single discrete event. For example, a divide by zero error may be specific to a computation on a particular input.
Persistence : EMV2::PersistenceEnum
applies to ({emv2}**error type, {emv2}**type set, {emv2}**error behavior state,
{emv2}**error behavior event, {emv2}**error propagation);
applies to ({emv2}**error type, {emv2}**type set, {emv2}**error behavior state,
{emv2}**error behavior event, {emv2}**error propagation);
PersistenceEnum: type enumeration (Permanent, Transient, Singleton);
......@@ -81,24 +90,24 @@ PersistenceEnum: type enumeration (Permanent, Transient, Singleton);
-- (Catastrophic, Hazardous, Major, Minor, NoEffect) (qualify with ARP4761::).
Severity : inherit EMV2::SeverityRange applies to ({emv2}**error type, {emv2}**type set, {emv2}**error behavior state,
{emv2}**error source, {emv2}**error propagation, {emv2}**error event);
{emv2}**error propagation, {emv2}**error event, {emv2}**error flow);
SeverityRange: type aadlinteger 1 .. 5;
ProbabilityRange: type aadlreal 0.0 .. 1.0;
-- The likelihood property value indicates the likelihood of the hazard ranging from A (high) to E (low).
-- MIL-STD 882D uses descriptive labels (Frequent, Probable, Occasional, Remote, Improbable) (See property set MILSTD882).
-- The likelihood property value indicates the likelihood of the hazard ranging from A (high) to F (low).
-- MIL-STD 882E uses descriptive labels (Frequent, Probable, Occasional, Remote, Improbable, Eliminated) (See property set MILSTD882).
-- ARP 4761 uses descriptive labels (Frequent, Probable, Remote, ExtremelyRemote, ExtremelyImprobable) (See property set ARP4761).
Likelihood : inherit EMV2::LikelihoodLabels applies to ({emv2}**error type, {emv2}**type set, {emv2}**error behavior state,
{emv2}**error source, {emv2}**error propagation, {emv2}**error event);
{emv2}**error propagation, {emv2}**error event, {emv2}**error flow);
LikelihoodLabels: type enumeration (A, B, C, D, E);
LikelihoodLabels: type enumeration (A, B, C, D, E, F);
-- ARP4761-style labels for likelihood: qualify with ARP4761::
-- Frequent, Probable, Occasional, Remote, Improbable
-- MILSTD882-style labels for likelihood: qualify with MILSTD882::
-- Frequent, Probable, Occasional, Remote, Improbable
-- ARP4761-style labels for likelihood: qualify with ARP4761::
-- Frequent, Probable, Remote, ExtremelyRemote, ExtremelyImprobable
DALLabels: type enumeration (A,B,C,D,E);
......@@ -130,14 +139,14 @@ Hazards: list of record
Comment : aadlstring;
)
applies to ({emv2}**error type, {emv2}**type set, {emv2}**error behavior state,
{emv2}**error source, {emv2}**error propagation, {emv2}**error event);
{emv2}**error propagation, {emv2}**error event, {emv2}**error flow);
Description : aadlstring applies to (all);
HazardAllocation: record (
AssumedProbability : aadlreal;
ExposureTime : Time;
Notes : aadlstring;
AssumedProbability : aadlreal;
ExposureTime : Time;
Notes : aadlstring;
) applies to (all);
......
......@@ -2006,7 +2006,7 @@ package body Ocarina.Backends.Build_Utils is
procedure Compile_C_Files (C_Sources : Name_Tables.Instance) is
begin
-- Define VPATH, search path for All Prerequisites
-- Define VPATH, search path for all prerequisites
Write_Str ("VPATH = ../..");
if Scenario_Dir /= null then
......@@ -2048,58 +2048,33 @@ package body Ocarina.Backends.Build_Utils is
procedure Compile_CPP_Files (CPP_Sources : Name_Tables.Instance) is
begin
Write_Line ("compile-cpp-files:");
if Length (CPP_Sources) > 0 then
for J in Name_Tables.First .. Name_Tables.Last (CPP_Sources) loop
declare
O_File : Name_Id;
Include_Dir : Name_Id;
begin
Get_Name_String (CPP_Sources.Table (J));
if Name_Buffer (Name_Len - 2 .. Name_Len) = "cpp" then
Name_Buffer (Name_Len - 2 .. Name_Len) := "o ";
elsif Name_Buffer (Name_Len - 1 .. Name_Len) = "cc" then
Name_Buffer (Name_Len - 1 .. Name_Len) := "o ";
end if;
Set_Str_To_Name_Buffer
(Base_Name (Name_Buffer (1 .. Name_Len)));
O_File := Name_Find;
Write_Str (":");
Write_Str
(Dir_Name (Get_Name_String (CPP_Sources.Table (J))));
exit when J = Name_Tables.Last (CPP_Sources);
end loop;
end if;
Write_Eol;
Write_Eol;
Get_Name_String (CPP_Sources.Table (J));
while (Name_Buffer (Name_Len) /= Directory_Separator)
and then Name_Len > 0
loop
Name_Len := Name_Len - 1;
end loop;
-- Generic rule for compiling C++ files
if Name_Len > 0 then
Set_Str_To_Name_Buffer (Name_Buffer (1 .. Name_Len));
Include_Dir := Name_Find;
else
Include_Dir := No_Name;
end if;
Write_Line ("%.o : %.cpp");
Write_Char (ASCII.HT);
Write_Str ("$(CXX) -c $(INCLUDE) $(CFLAGS) " &
"-I$(RUNTIME_PATH)/include ");
if Scenario_Dir /= null then
Write_Str ("-I" & Scenario_Dir.all & " ");
end if;
Write_Line (" $< -o $@");
Write_Eol;
Write_Char (ASCII.HT);
Write_Str ("$(CC) -c $(INCLUDE) $(CFLAGS) ");
-- compile-c-files rule, simply biuld $(USER_OBJS)
if Include_Dir /= No_Name then
Write_Str ("-I");
Write_Str ("'");
Write_Name (Include_Dir);
Write_Str ("'");
end if;
Write_Line ("compile-cpp-files: $(USER_OBJS) $(CPP_OBJECTS)");
Write_Str (" '");
Write_Name (CPP_Sources.Table (J));
Write_Str ("' -o ");
Write_Name (O_File);
Write_Eol;
end;
end loop;
end if;
end Compile_CPP_Files;
-----------------------
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2019 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2020 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -1321,8 +1321,9 @@ package body Ocarina.Backends.C_Common.Mapping is
if AINU.Is_Subprogram (E)
and then Get_Source_Language (E) /= Language_C
and then Get_Source_Language (E) /= Language_CPP
then
Display_Error ("This is not a C function", Fatal => True);
Display_Error ("This is not a C-like function", Fatal => True);
end if;
-- Get the subprogram name
......
......@@ -81,11 +81,10 @@ package body Ocarina.Backends.PO_HI_Ada.Job is
(S : Name_Id) return Node_Id
is
P : constant Node_Id :=
-- Make_Defining_Identifier (Map_Interrogators_Name (E));
RU (RU_PolyORB_HI_Generated_Activity);
N : constant Node_Id := Make_Defining_Identifier (S);
begin
Set_Homogeneous_Parent_Unit_Name (N, P);
Set_Homogeneous_Parent_Unit_Name (N, P);
return N;
end Get_Fully_Qualified_Subprogram;
......@@ -585,7 +584,8 @@ package body Ocarina.Backends.PO_HI_Ada.Job is
(Selector_Name =>
Make_Defining_Identifier (SN (S_Wait_For_Incoming_Events)),
Actual_Parameter =>
Make_Defining_Identifier (SN (S_Wait_For_Incoming_Events)));
Get_Fully_Qualified_Subprogram
(SN (S_Wait_For_Incoming_Events)));
Append_Node_To_List (N, Parameter_List);
-- Build the package instantiation
......
......@@ -1281,6 +1281,13 @@ package body Ocarina.Backends.PO_HI_C.Activity is
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, CTN.Declarations (Current_File));
when Thread_Aperiodic =>
N :=
Message_Comment
("Sporadic task : " &
Get_Name_String (Display_Name (Identifier (S))));
Append_Node_To_List (N, CTN.Declarations (Current_File));
when Thread_Background =>
N :=
Message_Comment
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2019 ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2020 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -2996,15 +2996,25 @@ package body Ocarina.Analyzer.AADL.Links is
-- If we did not find anything, we look for an enumeration in
-- properties
if Present (Property_Type)
and then (Kind (Property_Type) = K_Property_Type
or else Kind (Property_Type)
= K_Unique_Property_Type_Identifier)
= K_Unique_Property_Type_Identifier
or else Kind (Property_Type)
= K_Constant_Property_Declaration)
then
if Kind (Property_Type) = K_Property_Type
and then Present (Property_Type_Designator (Property_Type))
then
Type_Designator := Property_Type_Designator (Property_Type);
elsif Kind (Property_Type)
= K_Constant_Property_Declaration
then
Type_Designator :=
Constant_Type (Property_Type);
else
Type_Designator := Property_Type_Designator
(Entity (Property_Type));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment