ba_example_003.aadl.out 5.06 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 240 241 242 243 244 245 246 247 248 249 250 251 252 253







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, Data_Model;

  thread sender
  features
    d : out event data port Base_Types::Integer;
    a : in event data port Base_Types::Integer;

  properties
    Dispatch_Protocol => Timed;
    Period => 10 Ms;

  end sender;

  thread implementation sender.v1
  subcomponents
    v : data Base_Types::Integer;

    annex behavior_specification {**
    states
      st : initial complete state;
      sf : complete state;
      s1, s2 : state;
    transitions      
      st -[on dispatch timeout]-> st {
        v := 1;
         d!(v)
        };      
      st -[on dispatch a]-> s1;      
      s1 -[a = 1]-> sf;      
      s1 -[a = 0]-> st;      
      sf -[on dispatch timeout]-> sf {
        v := 0;
         d!(v)
        };      
      sf -[on dispatch a]-> s2;      
      s2 -[a = 0]-> st;      
      s2 -[a = 1]-> sf;
    **};
  end sender.v1;

  thread implementation sender.v2
    annex behavior_specification {**
    states
      st : initial complete state;
      sf : complete state;
      s1, s2 : state;
    transitions      
      st -[on dispatch timeout]-> st {
         d!(1)
        };      
      st -[on dispatch a]-> s1;      
      s1 -[a = 1]-> sf;      
      s1 -[a = 0]-> st;      
      sf -[on dispatch timeout]-> sf {
         d!(0)
        };      
      sf -[on dispatch a]-> s2;      
      s2 -[a = 0]-> st;      
      s2 -[a = 1]-> sf;
    **};
  end sender.v2;

  thread implementation sender.v3
    annex behavior_specification {**
    states
      st : initial complete state;
      sf : complete state;
    transitions      
      st -[on dispatch timeout]-> st {
         d!(1)
        };      
      st -[on dispatch a(1)]-> sf;      
      st -[on dispatch a(others)]-> st;      
      sf -[on dispatch timeout]-> sf {
         d!(0)
        };      
      sf -[on dispatch a(0)]-> st;      
      sf -[on dispatch a(others)]-> sf;
    **};
  end sender.v3;

end Test;