// WARNING! // does not compile using the current revision of the trunk of BIP2 // compatible only with the new syntax for time introduced in the real-time-branch // // model of periodic execution of two tasks A (period 1s) and B (period 2s) // if A and B can be executed at the same time (i.e. at 2s, 4s, 6s ...), B is executed first model periodic connector type Singleton(Port p) define [ p ] end connector type RendezVous(Port p, Port q) define [ p q ] end atomic type Periodic(int P) export port Port tick export port Port period data int x = 0 place LOOP initial to LOOP on tick from LOOP to LOOP provided x < P do { x++; } on period from LOOP to LOOP provided x == P do { x = 0; } end compound type System component Periodic A(1) component Periodic B(2) connector RendezVous Tick(A.tick, B.tick) connector Singleton CA(A.period) connector Singleton CB(B.period) priority prio CA < CB end /* instantiation of the root component */ component System system end