Commit 0158a248 authored by jhugues's avatar jhugues

* Extend support for property types with "list of"



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@5762 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 39a85f98
......@@ -7,71 +7,70 @@ property set Communication_Properties is
Fan_Out_Policy: enumeration (Broadcast, RoundRobin, Selective, OnDemand)
applies to (port);
-- XXX not supported by Ocarina
-- Connection_Pattern: list of list of Supported_Connection_Patterns
-- applies to (connection);
-- Connection_Set: list of Connection_Pair
-- applies to (connection);
-- Connection_Pair: type record (
-- src: list of aadlinteger;
-- dst: list of aadlinteger;);
Connection_Pattern: list of list of Supported_Connection_Patterns
applies to (connection);
Connection_Set: list of Connection_Pair
applies to (connection);
Connection_Pair: type record (
src: list of aadlinteger;
dst: list of aadlinteger;);
Overflow_Handling_Protocol: enumeration (DropOldest, DropNewest, Error) => DropOldest
applies to (event port, event data port, subprogram access);
Queue_Processing_Protocol: Supported_Queue_Processing_Protocols => FIFO
applies to (event port, event data port, subprogram access);
Queue_Size: aadlinteger 0 .. Max_Queue_Size => 1
applies to (event port, event data port, subprogram access);
Required_Connection: aadlboolean => true
applies to (feature);
Timing: enumeration (sampled, immediate, delayed) => sampled
applies to (port connection);
Transmission_Type: enumeration (push, pull)
applies to (data port, port connection, bus, virtual bus);
Input_Rate: Rate_Spec => (Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed;)
applies to (port);
Input_Time: list of IO_Time_Spec => ((Time => Dispatch; Offset => 0 ns .. 0 ns;))
applies to (port);
IO_Time_Spec: type record (
Offset: Time_Range;
Time: IO_Reference_Time;
);
IO_Reference_Time: type enumeration (Dispatch, Start, Completion, Deadline, NoIO);
Output_Rate: Rate_Spec => (Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed;)
applies to (port);
Output_Time: list of IO_Time_Spec => ((Time => Completion; Offset => 0 ns .. 0 ns;))
applies to (port);
Rate_Spec: type record (
Value_Range: range of aadlreal;
Rate_Unit: enumeration (PerSecond, PerDispatch);
Rate_Distribution: Supported_Distributions;
);
Subprogram_Call_Rate: Rate_Spec => (Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed;)
applies to (subprogram access);
Transmission_Time: record (
Fixed: Time_Range;
PerByte: Time_Range;)
applies to (bus);
Actual_Latency: Time_Range
applies to (flow, connection, bus, processor, device, port);
Latency: Time_Range
applies to (flow, connection, bus, processor, device, port);
end Communication_Properties;
\ No newline at end of file
......@@ -7,110 +7,109 @@ property set Deployment_Properties is
Allowed_Processor_Binding_Class:
inherit list of classifier (processor, virtual processor, system)
applies to (thread, thread group, process, system, virtual processor, device);
Allowed_Processor_Binding: inherit list of reference (processor, virtual processor, system)
applies to (thread, thread group, process, system, virtual processor, device);
Actual_Processor_Binding: inherit list of reference (processor, virtual processor)
applies to (thread, thread group, process, system, virtual processor, device);
Allowed_Memory_Binding_Class:
inherit list of classifier (memory, system, processor)
applies to (thread, thread group, process, system, device, data, data port, event data port, subprogram, subprogram group, processor);
Allowed_Memory_Binding: inherit list of reference (memory, system, processor)
applies to (thread, thread group, process, system, device, data, data port, event data port, subprogram, subprogram group, processor);
Actual_Memory_Binding: inherit list of reference (memory)
applies to (thread, thread group, process, system, processor, device, data, data port, event data port, subprogram, subprogram group);
Allowed_Connection_Binding_Class:
inherit list of classifier (processor, virtual processor, bus, virtual bus, device, memory)
applies to (feature, connection, thread, thread group, process, system, virtual bus, port); -- XXX added port
Allowed_Connection_Binding: inherit list of reference (processor, virtual processor, bus, virtual bus, device, memory)
applies to (feature, connection, thread, thread group, process, system, virtual bus);
Actual_Connection_Binding: inherit list of reference (processor, virtual processor, bus, virtual bus, device, memory)
applies to (feature, connection, thread, thread group, process, system, virtual bus);
Allowed_Subprogram_Call: list of reference (subprogram)
applies to (subprogram access);
Actual_Subprogram_Call: reference (subprogram)
applies to (subprogram access);
Allowed_Subprogram_Call_Binding:
list of reference (bus, processor, device)
applies to (subprogram, thread, thread group, process, system);
Actual_Subprogram_Call_Binding: list of reference (bus, processor, memory, device)
applies to (subprogram);
Provided_Virtual_Bus_Class: inherit list of classifier (virtual bus)
applies to (bus, virtual bus, processor, virtual processor, device, memory, system);
Required_Virtual_Bus_Class: inherit list of classifier (virtual bus)
applies to (virtual bus, connection, port, thread, thread group, process, system, device);
Provided_Connection_Quality_Of_Service: inherit list of Supported_Connection_QoS
applies to (bus, virtual bus, processor, virtual processor, system, device, memory);
Required_Connection_Quality_Of_Service: inherit list of Supported_Connection_QoS
applies to (port, connection, virtual bus, thread, thread group, process, system, device);
-- XXX not supported by Ocarina
-- Not_Collocated: record ( Targets: list of reference (data,
-- thread, process, system, connection); Location:
-- classifier (processor, memory, bus, system);) applies
-- to (process, system);
-- Collocated: record ( Targets: list of reference (data, thread,
-- process, system, connection); Location: classifier
-- (processor, memory, bus, system);) applies to
-- (process, system);
Not_Collocated: record (
Targets: list of reference (data, thread, process, system, connection);
Location: classifier (processor, memory, bus, system);) applies
to (process, system);
Collocated: record ( Targets: list of reference (data, thread,
process, system, connection); Location: classifier
(processor, memory, bus, system);) applies to
(process, system);
Allowed_Connection_Type: list of enumeration
(Sampled_Data_Connection, Immediate_Data_Connection,
Delayed_Data_Connection, Port_Connection,
Data_Access_Connection,
Subprogram_Access_Connection)
applies to (bus, device);
Allowed_Dispatch_Protocol: list of Supported_Dispatch_Protocols
applies to (processor, virtual processor);
Allowed_Period: list of Time_Range
applies to (processor, system, virtual processor);
Allowed_Physical_Access_Class: list of classifier (device, processor, memory, bus)
applies to (bus);
Allowed_Physical_Access: list of reference (device, processor, memory, bus)
applies to (bus);
Memory_Protocol: enumeration (execute_only, read_only, write_only, read_write) => read_write
applies to (memory);
Runtime_Protection_Support : aadlboolean
Runtime_Protection_Support : aadlboolean
applies to (processor, virtual processor);
Scheduling_Protocol: inherit list of Supported_Scheduling_Protocols
applies to (virtual processor, processor);
Preemptive_Scheduler: aadlboolean
applies to (processor);
Thread_Limit: aadlinteger 0 .. Max_Thread_Limit
applies to (processor, virtual processor);
Priority_Map: list of Priority_Mapping
applies to (processor);
Priority_Mapping: type record (
Aadl_Priority: aadlinteger;
RTOS_Priority: aadlinteger;);
Priority_Range: range of aadlinteger
applies to (processor, virtual processor);
end Deployment_Properties;
......@@ -36,6 +36,7 @@ with Ocarina.ME_AADL.AADL_Tree.Nodes;
with Ocarina.BE_AADL.Properties;
with Ocarina.BE_AADL.Identifiers;
with Ocarina.BE_AADL.Components;
with Ocarina.BE_AADL.Components.Arrays;
package body Ocarina.BE_AADL.Components.Features is
......@@ -44,6 +45,7 @@ package body Ocarina.BE_AADL.Components.Features is
use Ocarina.BE_AADL.Properties;
use Ocarina.BE_AADL.Identifiers;
use Ocarina.BE_AADL.Components;
use Ocarina.BE_AADL.Components.Arrays;
-------------------
-- Print_Feature --
......@@ -174,6 +176,11 @@ package body Ocarina.BE_AADL.Components.Features is
else
Print_Token (T_Port);
end if;
if Present (Array_Dimensions (Node)) then
Write_Space;
Print_Array_Dimensions (Array_Dimensions (Node));
end if;
end Print_Port_Spec;
-------------------------------
......
......@@ -393,6 +393,12 @@ package body Ocarina.BE_AADL.Properties.Values is
Print_Identifier (Identifier (Node));
Write_Space;
Print_Token (T_Colon);
if Is_List (Node) then
Write_Space;
Print_Token (T_List);
Write_Space;
Print_Token (T_Of);
end if;
Write_Space;
Print_Property_Type_Designator (Property_Type_Designator (Node));
Print_Token (T_Semicolon);
......
......@@ -253,8 +253,10 @@ package body Ocarina.BE_AADL.Properties is
end if;
if Is_List (Property_Name_Type (Node)) then
Print_Tokens ((T_List, T_Of));
Write_Space;
for J in 1 .. Multiplicity (Property_Name_Type (Node)) loop
Print_Tokens ((T_List, T_Of));
Write_Space;
end loop;
end if;
Print_Property_Type_Designator
......
......@@ -79,7 +79,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// Scope_Definition:
// XXX
//
//
//
interface Scope_Definition : Node_Id {
Node_Id Corresponding_Entity;
......@@ -175,10 +175,10 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
interface Package_Name : AADL_Entity {
List_Id Identifiers;
};
// package_declaration ::= { aadl_declaration }+
// [ properties ( { property_association }+ | none_statement ) ]
// package_spec ::=
// package defining_package_name
// ( public package_declaration [ private package_declaration ] |
......@@ -211,7 +211,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// import_declaration | alias_declaration
interface Name_Visibility_Declaration : Node_Id {
boolean Is_Private;
boolean Is_Private;
Node_Id Parent;
List_Id List_Items;
};
......@@ -221,10 +221,10 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// with ( package_name | property_set_identifier )
// { , ( package_name | property_set_identifier ) }+ ;
interface Import_Declaration : Named_AADL_Entity {
interface Import_Declaration : Named_AADL_Entity {
boolean Is_Private;
List_Id List_Items; // list of package or property_sets imported
List_Id List_Items; // list of package or property_sets imported
};
// AADL_V2
......@@ -283,7 +283,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
List_Id Flows;
List_Id Properties;
List_Id Annexes;
Node_Id Parent; // Contains a entity_reference on the
Node_Id Parent; // Contains a entity_reference on the
// extended component, if any
List_Id Instances;
......@@ -337,7 +337,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
List_Id Modes;
List_Id Properties;
List_Id Annexes;
Node_Id Parent; // Contains a entity_reference on the
Node_Id Parent; // Contains a entity_reference on the
// extended component, if any
List_Id Instances;
List_Id Prototypes; // AADL_V2 only
......@@ -345,7 +345,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
};
interface Contained_Entity : Named_AADL_Entity {
Node_Id Container_Component;
Node_Id Container_Component;
};
interface Subclause : Contained_Entity {
......@@ -361,7 +361,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// AADL_V2
// prototype ::= defining_prototype_identifier : component_category
// [ unique_component_classifier_reference ]
// prototype_refinement ::= defining_prototype_identifier : refined to
// component_category [ unique_component_classifier_reference ] ;
......@@ -431,6 +431,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
boolean Is_Feature;
boolean Is_Event; // FIXME: Rename to Is_Event_Port
boolean Is_Data; // FIXME: Rename to Is_Data_Port
Node_Id Array_Dimensions; // AADL_V2
};
// AADL_V1
......@@ -446,7 +447,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// unique_port_group_type_reference ::=
// [ package_name :: ] port_group_type_identfier
// AADL_V2
// feature_group_spec ::=
// defining_feature_group_identifier : feature group
......@@ -454,7 +455,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// ( unique_feature_group_type_reference [ prototype_bindings ] )
// | prototype_identifier ) ]
// [ { { featuregroup_property_association }+ } ] ;
// feature_group_refinement ::=
// defining_feature_group_identifier : refined to
// feature group
......@@ -462,7 +463,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// ( unique_feature_group_type_reference [ prototype_bindings ] )
// | prototype_identifier ) ]
// [ { { featuregroup_property_association }+ } ] ;
// unique_feature_group_type_reference ::=
// [ package_name :: ] feature_group_type_identifier
......@@ -739,7 +740,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// | data_unique_type_reference . data_subprogram_identifier
interface Subprogram_Call : Subclause {
Node_Id In_Modes;
Node_Id In_Modes;
// Refers to the modes of the containing sequence. Handled by the
// Ocarina core only.
......@@ -917,12 +918,12 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// [ in_modes_and_transitions ] ;
// feature_connection ::=
// source_feature_reference connection_symbol
// source_feature_reference connection_symbol
// destination_feature_reference
// connection_symbol ::=
// directional_connection_symbol | bidirectional_connection_symbol
// directional_connection_symbol ::= ->
// bidirectional_connection_symbol ::= <->
......@@ -974,9 +975,9 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// are replaced by port connections in AADL V2
// parameter_connection ::=
// parameter source_parameter_reference directional_connection_symbol
// parameter source_parameter_reference directional_connection_symbol
// destination_parameter_reference
// parameter_connection_refinement ::=
// parameter
......@@ -1007,7 +1008,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// access_reference ::=
// -- requires or provides access feature in the component type
// requires_access_identifier | provides_access_identifier |
// -- requires or provides access feature a feature group of
// -- requires or provides access feature a feature group of
// -- the component type
// feature_group_identifier [ . requires_access_identifier ] |
// feature_group_identifier [ . provides_access_identifier ] |
......@@ -1023,7 +1024,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// feature group of a subcomponent and a feature group in the component type
// feature_group_connection ::=
// feature group source_feature_group_reference
// feature group source_feature_group_reference
// bidirectional_connection_symbol destination_feature_group_reference
// A feature group refinement can only add properties
......@@ -1038,7 +1039,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// -- feature group in a subcomponent
// subcomponent_identifier . feature_group_identifier |
// -- feature group element in a feature group of the component type
// component_type_feature_group_identifier .
// component_type_feature_group_identifier .
// element_feature_group_identifier
interface Connection : Subclause {
......@@ -1072,16 +1073,16 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
/*************************/
/* Property Declarations */
/*************************/
// AADL_V2
// Contained_element_path ::=
// ( contained_element { . contained_element }*
// [ annex_path ] )
// | annex_path
// contained_element ::=
// named_element_identifier
// named_element_identifier
// | named_element_array_selection_identifier
// annex_path ::=
......@@ -1095,6 +1096,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
interface Property_Type : Node_Id {
boolean Is_List;
long Multiplicity; // number of "list of" in property type
Node_Id Property_Type_Designator;
Node_Id Expanded_Type_Designator;
};
......@@ -1124,7 +1126,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
};
// multi_valued_property ::=
// list of property_type_designator
// (list of)+ property_type_designator
// [ => ( [ default_property_expression
// { , default_property_expression }* ] ) ]
......@@ -1246,7 +1248,11 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// | bus_classsifer_reference
interface Property_List_Value : List_Id { };
// interface Property_List_Value : Node_Id {
// List_Id Property_Values;
//};
// XXX Change to inherit from Node_Id, list being an internal field
/*
in_binding ::= in binding ( platform_classifier_reference
{ , platform_classifier_reference }* )
......@@ -1389,13 +1395,14 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
interface Reference_Term : Node_Id {
Node_Id Reference_Term;
};
};
// record_term ::=
// ( property_expression ( , property_expression )* )
// ( record_field_identifier => property_expression ;
// ( record_field_identifier => property_expression ; )* )
interface Record_Term : Node_Id {
List_Id List_Items;
List_Id List_Items; // list of Record_Term_Element
};
interface Record_Term_Element : Node_Id {
......@@ -1409,7 +1416,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
interface Computed_Term : Node_Id {
Node_Id Identifier;
};
/******************/
/* property types */
/******************/
......@@ -1490,7 +1497,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// classifier_type ::=
// classifier [ ( classifier_category_reference
// { , classifier_category_reference }* ) ]
interface Classifier_Type : Node_Id {
List_Id List_Items;
};
......@@ -1538,6 +1545,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
};
interface Record_Type_Element : Node_Id {
boolean Is_List;
Node_Id Identifier;
Node_Id Property_Type_Designator;
};
......@@ -1546,7 +1554,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// defining_property_type_identifier : type property_type_designator ;
// property_type_designator ::= property_type
// | unique_property_type_identifie
// | unique_property_type_identifier
// property_type ::= aadlboolean | aadlstring | enumeration_type
// | units_type | number_type | range_type
......@@ -1595,11 +1603,11 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// annex_subclause ::=
// annex annex_identifier (
// ( {** annex_specific_language_constructs **} ) | none )
// [ in_modes ] ;
//
// [ in_modes ] ;
//
// annex_library ::=
// annex annex_identifier (
// annex annex_identifier (
// ( {** annex_specific_reusable_constructs **} ) | none ) ;
interface Annex_Content : Node_Id {
......@@ -1619,7 +1627,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
Node_Id Container_Package;
};
// annex_path ::=
// annex_path ::=
// [ { annex_identifier } ] { ** element_identifier }+
interface Annex_Path : Contained_Entity {
......@@ -1636,7 +1644,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
// array_dimension_size ::= numeral | unique_property_constant_identifier
interface Array_Dimensions : AADL_Entity {
List_Id Array_List_Dim;
List_Id Array_List_Dim;
};
interface Array_Dimension_Size : AADL_Entity {
......@@ -1646,7 +1654,7 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
};
// array_selection_identifier ::= identifier array_selection
// array_selection ::= {[range_selection]}*
// array_selection ::= {[range_selection]}*
interface Array_Selection : Named_AADL_Entity {
List_Id Range_Selections;
......@@ -1659,11 +1667,11 @@ module Ocarina::ME_AADL::AADL_Tree::Nodes {
Node_Id Upper_Bound;
};
// Node_Container:
// Node_Container:
interface Node_Container : Node_Id {
Node_Id Item;
Node_Id Extra_Item;
};
};
......@@ -63,7 +63,8 @@ package body Ocarina.FE_AADL.Parser.Components.Arrays is
use Ocarina.ME_AADL.AADL_Tree.Nutils;
pragma Assert (Container /= No_Node
and then (Kind (Container) = K_Subcomponent));
and then (Kind (Container) = K_Subcomponent
or else Kind (Container) = K_Port_Spec));
Loc : Location;