(1) Subprogram groups represent subprogram libraries. Subprogram groups can be made accessible to other components through subprogram group access features (see Section 8.4) and subprogram group access connections (see Section 9.4). This grouping concept allows the number of connection declarations to be reduced, especially at higher levels of a system when a number of provided subprograms from one subcomponent and its contained subcomponents must be connected to requires subprogram access in another subcomponent and its contained subcomponents. The content of a subprogram group is declared through a subprogram group type declaration. This declaration is then referenced when subprogram groups are declared as subcomponents.
Naming Rules
(N1) The defining identifier of a subprogram group type must be unique within the package namespace of the package where the subprogram group type is declared.
(N2) Each subprogram group provides a local namespace. The defining subprogram identifiers of subprogram declarations in a subprogram group type must be unique within the namespace of the subprogram group type.
(N3) The local namespace of a subprogram group type extension includes the defining identifiers in the local namespace of the subprogram group type being extended. This means, the defining identifiers of subprogram or subprogram group declarations in a subprogram group type extension must not exist in the local namespace of the subprogram group type being extended. The defining identifiers of subprogram or subprogram group refinements in a subprogram group type extension must refer to a subprogram or subprogram group in the local namespace of an ancestor subprogram group type.
(N4) The defining subprogram identifiers of subprogram access feature declarations in feature group refinements must not exist in the local namespace of any subprogram group being extended. The defining subprogram identifier of subprogram_refinement declarations in subprogram group refinements must exist in the local namespace of any feature group being extended.
(N5) The package name of the unique subprogram group type reference must refer to a package name in the global namespace. The subprogram group type identifier of the unique subprogram group type reference must refer to a subprogram group type identifier in the named package.
Legality Rules
Category |
Type |
Implementation |
subprogram group |
Features: · feature group · provides subprogram access · requires subprogram access · requires subprogram group access · provides subprogram group access · feature Flow specifications: no Modes: no Properties: yes |
Subcomponents: · subprogram · subprogram group · data · abstract Subprogram calls: no Connections: yes Flows: no Modes: no Properties: yes |
(L1) A subprogram group type can contain provides and requires subprogram access, and provides and requires subprogram group access.
(L2) A subprogram group implementation can contain abstract, data, subprogram group, and subprogram subcomponents as well as data and subprogram access connections.
(L3) A subprogram group type or implementation may contain zero or more subcomponent declarations. If it contains zero elements, then the subprogram group type or implementation is considered to be incompletely specified.
Standard Properties
-- Port properties defined to be inherit, thus can be associated with a
-- feature group to apply to all contained ports.
Source_Text: inherit list of aadlstring
-- properties related to execution time
Reference_Processor: inherit classifier ( processor )
-- Properties specifying memory requirements of subprograms
Source_Code_Size: Size
Source_Data_Size: Size
Source_Stack_Size: Size
Source_Heap_Size: Size
Allowed_Memory_Binding_Class:
inherit list of classifier (memory, system, processor)
Allowed_Memory_Binding: inherit list of reference (memory, system, processor)
Semantics
(2) A subprogram group declaration represents groups of component subprograms, i.e., subprogram libraries. Subprograms in a subprogram group may require access to other subprograms or subprogram groups.
(3) Requires subprogram group access is resolved to provides subprogram group access or a subprogram group subcomponent.
(4) The subprograms of a subprogram group or a subprogram group access feature can be connected to or referenced in a subprogram call.
Processing Requirements and Permissions
(5) Subprogram groups represent subprogram libraries. These can be application libraries or system libraries. Libraries may be shared across multiple applications, i.e., across multiple processes.
(6) Methods of implementation may optionally allow a provides subprogram access declaration of a subprogram group to not be connected to a subprogram instantiation, i.e., subprogram subcomponent. It may assume these subprograms to be implicitly declared and instantiated as part of a subprogram group instantiation.
Examples
subprogram group mathlib
features
matrixMultiply: provides subprogram access ;
matrixAdd: provides subprogram access ;
vectorAdd: requires subprogram access ;
end mathlib;