ParameterConnections.aadl 9.78 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
subprogram sub
  features
    in_param: in parameter ;
    out_param: out parameter ;
    in_out_param: in out parameter ;
end sub;

thread t
  features
    in_data: in data port ;
    out_data: out data port ;
    in_out_data: in out data port ;
    
    in_event_data: in event data port ;
    out_event_data: out event data port ;
    in_out_event_data: in out event data port ;
    
    in_event: in event port ;
    out_event: out event port ;
    in_out_event: in out event port ;
end t;

thread implementation t.i
  calls
    cs1: {
      call1: subprogram sub ;
      call2: subprogram sub ;
      call3: subprogram sub ;
      call4: subprogram sub ;
      call5: subprogram sub ;
      call6: subprogram sub ;
      call7: subprogram sub ;
      call8: subprogram sub ;
      call9: subprogram sub ;
    };
    
  connections
    -- good: in data to in param
    parameter in_data -> call1.in_param;
    -- bad: in data to out param
    parameter in_data -> call1.out_param;
    -- good: in data to in/out param
    parameter in_data -> call1.in_out_param;
    
    -- bad: out data to in param
    parameter out_data -> call2.in_param;
    -- bad: out data to out param
    parameter out_data -> call2.out_param;
    -- bad: out data to in/out param
    parameter out_data -> call2.in_out_param;
    
    -- good: in/out data to in param
    parameter in_out_data -> call3.in_param;
    -- bad: in/out data to out param
    parameter in_out_data -> call3.out_param;
    -- good: in/out data to in/out param
    parameter in_out_data -> call3.in_out_param;
    
    -- good: in event data to in param
    parameter in_event_data -> call4.in_param;
    -- bad: in event data to out param
    parameter in_event_data -> call4.out_param;
    -- good: in event data to in/out param
    parameter in_event_data -> call4.in_out_param;
    
    -- bad: out event data to in param
    parameter out_event_data -> call5.in_param;
    -- bad: out event data to out param
    parameter out_event_data -> call5.out_param;
    -- bad: out event data to in/out param
    parameter out_event_data -> call5.in_out_param;
    
    -- good: in/out event data to in param
    parameter in_out_event_data -> call6.in_param;
    -- bad: in/out event data to out param
    parameter in_out_event_data -> call6.out_param;
    -- good: in/out event data to in/out param
    parameter in_out_event_data -> call6.in_out_param;

    -- bad: event to param
    parameter in_event -> call7.in_param ;
    -- bad: event to param
    parameter in_event -> call7.out_param ;
    -- bad: event to param
    parameter in_event -> call7.in_out_param ;

87
    -- bad: event to param XXX
88
    parameter out_event -> call8.in_param ;
89
    -- bad: event to param XXX
90
    parameter out_event -> call8.out_param ;
91
    -- bad: event to param XXX
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
    parameter out_event -> call8.in_out_param ;

    -- bad: event to param
    parameter in_out_event -> call9.in_param ;
    -- bad: event to param
    parameter in_out_event -> call9.out_param ;
    -- bad: event to param
    parameter in_out_event -> call9.in_out_param ;
end t.i;

thread implementation t.j
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- bad: in data cannot be dest
    parameter call.out_param -> in_data ;
    -- good: in/out param to out data
    parameter call.in_out_param -> out_data ;
    -- bad: in param cannot be source
    parameter call.in_param -> in_out_data ;
end t.j;

thread implementation t.k
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- good: out to out
    parameter call.out_param -> out_data ;
    -- good: in/out to in/out
    parameter call.in_out_param -> in_out_data ;
    -- bad: in cannot be src, in cannot be dest
    parameter call.in_param -> in_event_data ;
end t.k;

thread implementation t.l
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- good: out to in/out
    parameter call.out_param -> in_out_data ;
    -- bad: in cannot be dest
    parameter call.in_out_param -> in_event_data ;
    -- bad: in cannot be source
    parameter call.in_param -> out_event_data ;
end t.l;

thread implementation t.m
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- bad: in cannot be dest,
    parameter call.out_param -> in_event_data ;
    -- good: in/out to out
    parameter call.in_out_param -> out_event_data ;
    -- bad: in cannot src
    parameter call.in_param -> in_out_event_data ;
end t.m;
    
thread implementation t.n
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- good: out to out
    parameter call.out_param -> out_event_data ;
    -- good in/out to in/out
    parameter call.in_out_param -> in_out_event_data ;
    -- bad: in cannot be src, in cannot be dest, event cannot be dest
    parameter call.in_param -> in_event ;
end t.n;
    
thread implementation t.o
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- good: out to in/out
    parameter call.out_param -> in_out_event_data ;
    -- bad: in cannot be dest, event cannot be dest
    parameter call.in_out_param -> in_event ;
    -- bad: in cannot be src, event cannot be dest
    parameter call.in_param -> out_event ;
end t.o;

thread implementation t.p
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- bad: in cannot be dest, event cannot be dest
    parameter call.out_param -> in_event ;
201
    -- bad: event cannot be dest XXX
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
    parameter call.in_out_param -> out_event ;
    -- bad: in cannot be src, event cannot be dest
    parameter call.in_param -> in_out_event ;
end t.p;

thread implementation t.q
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- bad: event cannot be dest
    parameter call.out_param -> out_event ;
    -- bad: event cannot be dest
    parameter call.in_out_param -> in_out_event ;
    -- bad: in cannot be src, in cannot be dest
    parameter call.in_param -> in_data ;
end t.q;

thread implementation t.r
  calls
    normal: {
      call: subprogram sub ;
    };
    
  connections
    -- bad: event cannot be dest
    parameter call.out_param -> in_out_event ;
    -- bad: in cannot be dest
    parameter call.in_out_param -> in_data ;
    -- bad: in cannot be src
    parameter call.in_param -> out_data ;
end t.r;



subprogram implementation sub.a
  calls
    normal: {
      call1: subprogram sub ;
      call2: subprogram sub ;
      call3: subprogram sub ;
    };
  
  connections
    -- good: in to in
    parameter in_param -> call1.in_param ;
    -- bad: call.out_param cannot be a dest
    parameter in_param -> call1.out_param ;
252
    -- good: in to in/out
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362
    parameter in_param -> call1.in_out_param ;

    -- bad: out_param cannot be source
    parameter out_param -> call2.in_param ;
    -- bad: out_param cannot be source, call.out_param cannot be a dest
    parameter out_param -> call2.out_param ;
    -- bad: out_param cannot be source
    parameter out_param -> call2.in_out_param ;

    -- good: in/out to in
    parameter in_out_param -> call2.in_param ;
    -- bad: call.out_param cannot be a dest
    parameter in_out_param -> call2.out_param ;
    -- good: in/out to in/out
    parameter in_out_param -> call2.in_out_param ;
end sub.a;

subprogram implementation sub.b
  calls
    normal: {
      call: subprogram sub ;
    };
  
  connections
    -- bad: call.in_param cannot be src, in_param cannot be dest
    parameter call.in_param -> in_param;
    -- good: out to out
    parameter call.out_param -> out_param;
    -- good: in/out to in/out
    parameter call.in_out_param -> in_out_param;
end sub.b;

subprogram implementation sub.c
  calls
    normal: {
      call: subprogram sub ;
    };
  
  connections
    -- bad: call.in_param cannot be src
    parameter call.in_param -> out_param;
    -- good: out to in/out
    parameter call.out_param -> in_out_param;
    -- bad: in_param cannot be dest
    parameter call.in_out_param -> in_param;
end sub.c;

subprogram implementation sub.d
  calls
    normal: {
      call: subprogram sub ;
    };
  
  connections
    -- bad: call.in_param cannot be src
    parameter call.in_param -> in_out_param;
    -- bad: in_param cannot be dest
    parameter call.out_param -> in_param;
    -- good: in/out to out
    parameter call.in_out_param -> out_param;
end sub.d;


thread tt
end tt;

thread implementation tt.a
  calls
    normal: {
      call1: subprogram sub ;
      call2: subprogram sub ;
    };
  connections
    -- bad: call1.in_param cannot be src
    parameter call1.in_param -> call2.in_param ;
    -- bad: call2.out_param cannot be dest
    parameter call1.out_param -> call2.out_param ;
    -- good: in/out to in/out
    parameter call1.in_out_param -> call2.in_out_param ;
end tt.a;

thread implementation tt.b
  calls
    normal: {
      call1: subprogram sub ;
      call2: subprogram sub ;
    };
  connections
    -- good: out to in
    parameter call1.out_param -> call2.in_param ;
    -- bad: call2.out_param cannot be dest
    parameter call1.in_out_param -> call2.out_param ;
    -- bad: call1.in_param cannot be src
    parameter call1.in_param -> call2.in_out_param ;
end tt.b;

thread implementation tt.c
  calls
    normal: {
      call1: subprogram sub ;
      call2: subprogram sub ;
    };
  connections
    -- good: in/out to in
    parameter call1.in_out_param -> call2.in_param ;
    -- bad: call1.in_param cannot be src, call2.out_param cannot be dest
    parameter call1.in_param -> call2.out_param ;
    -- good: out to in/out
    parameter call1.out_param -> call2.in_out_param ;
end tt.c;