t.aadl 2.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package Sampling
public
  data Sample
  properties
    Source_Data_Size => 16 Bytes;
  end Sample;
  
  data Sample_Set
  properties
    Source_Data_Size => 1 MByte;
  end Sample_Set;
  
  data implementation Sample_Set.impl
  subcomponents
    Data_Set: data Sample ;
  end Sample_Set.impl;
  
  data Dynamic_Sample_Set extends Sample_Set
  end Dynamic_Sample_Set;
  
  data implementation Dynamic_Sample_Set.impl extends Sample_Set.impl
  properties
    Source_Data_Size => 8 Bytes applies to Data_Set;
  end Dynamic_Sample_Set.impl;
end Sampling;

package SamplingTasks
public
  with Sampling;
  thread Init_Samples
  features
    OrigSet : requires data access Sampling::Sample_Set;
    SampleSet : requires data access Sampling::Sample_Set;
  end Init_Samples;
  
  thread Collect_Samples
  features
    Input_Sample : in event data port Sampling::Sample;
    SampleSet : requires data access Sampling::Sample_Set;
    Filtering_Routine: requires subprogram access Sample_Subprogram;
  end Collect_Samples;
  
  thread implementation Collect_Samples.Batch_Update
  properties
    Source_Name => "InSample" applies to Input_Sample;
  end Collect_Samples.Batch_Update;
  
  thread Distribute_Samples
  features
    SampleSet : requires data access Sampling::Sample_Set;
    UpdatedSamples : out event data port Sampling::Sample;
  end Distribute_Samples;
  
  process Sample_Manager
  features
    Input_Sample: in event data port Sampling::Sample;
    External_Samples: requires data access Sampling::Sample_Set;
    Result_Sample: out event data port Sampling::Sample;
  end Sample_Manager;
  
  process implementation Sample_Manager.Slow_Update
  subcomponents
    Samples: data Sampling::Sample_Set;
    Init_Samples : thread Init_Samples;
    
    -- the required access is resolved to a subcomponent declaration
    Collect_Samples: thread Collect_Samples.Batch_Update;
    Distribute: thread Distribute_Samples;
    Sample_Filter: subprogram Sample_Subprogram.Simple;
    
  connections
    ISSSConn: data access Samples -> Init_Samples.SampleSet;
    ISOSConn: data access External_Samples -> Init_Samples.OrigSet;
    CSSSConn: data access Samples -> Collect_Samples.SampleSet;
    CSISConn: port Input_Sample -> Collect_Samples.Input_Sample;
    DSSConn: data access Samples -> Distribute.SampleSet;
    DUSConn: port Distribute.UpdatedSamples -> Result_Sample;
    CSFRConn: subprogram access Sample_Filter -> Collect_Samples.Filtering_Routine;
  end Sample_Manager.Slow_Update;
  
  subprogram Sample_Subprogram
  end Sample_Subprogram;
  
  subprogram implementation Sample_Subprogram.Simple
  end Sample_Subprogram.Simple;
end SamplingTasks;