// 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 atomic type Periodic(int period) export port Port tick = tick clock x unit second place LOOP initial to LOOP on tick from LOOP to LOOP when x in [ period, period ] eager reset x do {} end compound type System component Periodic A(1) component Periodic B(2) connector Singleton CA(A.tick) connector Singleton CB(B.tick) priority prio CA < CB end component System system end