ba_example_007.aadl.out 4.72 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239







property set Data_Model is
  Base_Type : list of classifier (
data)
    applies to (data);

  Code_Set : aadlinteger
    applies to (data);

  Data_Digits : aadlinteger
    applies to (data);

  Data_Scale : aadlinteger
    applies to (data);

  Data_Representation : enumeration (Array, Boolean, Character, Enum, Float, Fixed, Integer, String, Struct, Union)
    applies to (data);

  Dimension : list of aadlinteger
    applies to (data);

  Element_Names : list of aadlstring
    applies to (data);

  Enumerators : list of aadlstring
    applies to (data);

  IEEE754_Precision : enumeration (Simple, Double)
    applies to (data);

  Initial_Value : list of aadlstring
    applies to (data, port, parameter);

  Integer_Range : range of aadlinteger
    applies to (data, port, parameter);

  Measurement_Unit : aadlstring
    applies to (data, port, parameter);

  Number_Representation : enumeration (Signed, Unsigned)
    applies to (data);

  Real_Range : range of aadlreal
    applies to (data, port, parameter);

  Representation : list of aadlstring
    applies to (data);

end Data_Model;

package Base_Types
public
  with data_model;

  data Boolean
  properties
    Data_Model::Data_Representation => Boolean;

  end Boolean;

  data Integer
  properties
    Data_Model::Data_Representation => Integer;

  end Integer;

  data Integer_8 extends Integer
  properties
    Data_Model::Number_Representation => Signed;
    Source_Data_Size => 1 Bytes;

  end Integer_8;

  data Integer_16 extends Integer
  properties
    Data_Model::Number_Representation => Signed;
    Source_Data_Size => 2 Bytes;

  end Integer_16;

  data Integer_32 extends Integer
  properties
    Data_Model::Number_Representation => Signed;
    Source_Data_Size => 4 Bytes;

  end Integer_32;

  data Integer_64 extends Integer
  properties
    Data_Model::Number_Representation => Signed;
    Source_Data_Size => 8 Bytes;

  end Integer_64;

  data Unsigned_8 extends Integer
  properties
    Data_Model::Number_Representation => Unsigned;
    Source_Data_Size => 1 Bytes;

  end Unsigned_8;

  data Unsigned_16 extends Integer
  properties
    Data_Model::Number_Representation => Unsigned;
    Source_Data_Size => 2 Bytes;

  end Unsigned_16;

  data Unsigned_32 extends Integer
  properties
    Data_Model::Number_Representation => Unsigned;
    Source_Data_Size => 4 Bytes;

  end Unsigned_32;

  data Unsigned_64 extends Integer
  properties
    Data_Model::Number_Representation => Unsigned;
    Source_Data_Size => 8 Bytes;

  end Unsigned_64;

  data Natural extends Integer
  properties
    Data_Model::Integer_Range => 0 .. Max_Target_Integer;

  end Natural;

  data Float
  properties
    Data_Model::Data_Representation => Float;

  end Float;

  data Float_32 extends Float
  properties
    Data_Model::IEEE754_Precision => Simple;
    Source_Data_Size => 4 Bytes;

  end Float_32;

  data Float_64 extends Float
  properties
    Data_Model::IEEE754_Precision => Double;
    Source_Data_Size => 8 Bytes;

  end Float_64;

  data Character
  properties
    Data_Model::Data_Representation => Character;

  end Character;

  data String
  properties
    Data_Model::Data_Representation => String;

  end String;

end Base_Types;

package Test
public
  with Base_Types;

  thread merger
  features
    p1 : in event data port Base_types::integer;
    p2 : in event data port Base_types::integer;
    m : out event data port Base_types::integer;

  end merger;

  thread implementation merger.twopersistentstates
  subcomponents
    x1 : data Base_types::integer;
    x2 : data Base_types::integer;

    annex behavior_specification {**
    states
      s0 : initial complete state;
      comp : state;
      next1, next2 : complete state;
    transitions      
      s0 -[on dispatch p1]-> next2 {
        x1 := p1
        };      
      s0 -[on dispatch p2]-> next1 {
        x2 := p2
        };      
      next1 -[on dispatch p1]-> comp {
        x1 := p1
        };      
      next2 -[on dispatch p2]-> comp {
        x2 := p2
        };      
      comp -[x1 < x2]-> next1 {
         m!(x1)
        };      
      comp -[x2 >= x1]-> next2 {
         m!(x2)
        };
    **};
  end merger.twopersistentstates;

  thread implementation merger.portbased
    annex behavior_specification {**
    states
      s0 : initial complete state;
      comp : state;
      next1 : complete state;
      next2 : complete state;
    transitions      
      s0 -[on dispatch p1]-> next2;      
      s0 -[on dispatch p2]-> next1;      
      next1 -[p1 < p2]-> next1 {
         m!(p1)
        };      
      next1 -[p2 >= p1]-> next2 {
         m!(p2)
        };      
      next2 -[p1 < p2]-> next1 {
         m!(p1)
        };      
      next2 -[p2 >= p1]-> next2 {
         m!(p2)
        };
    **};
  end merger.portbased;

end Test;