The BIP framework Ananda Basu Joseph Sifakis Marius
The BIP framework Ananda Basu, Joseph Sifakis, Marius Bozga VERIMAG 02 March 2021
Overview n Create the system hierarchy (from Atoms to Compounds) n Describe the atomic components’ behavior and the architecture (connectors and priorities) in BIP n Generate from the BIP description platform specific code (C++ code) n Run execution or state space exploration n Results : execution trace or state-space graph
Modeling flow: BIP Model BIP compiler BIP Platform specific code Platform Execution Trace State Space graph
BIP Syntax : Atomic Component component name ( arg 1, arg 2…) ports p 1, p 2, … data type 1 x, y, z; type 2 u, v, w; … behavior state s 1 on p 1 provided g 1 when (t 1, ) do f 1 to s 1’ ……………… …… on pn provided gn when (tn, ) do fn to sn’ state s 2 on …. . end
Problem 1: “Pay Bursts Only Once” Bursty Event-Stream: Period = 10 Jitter = 50 Min. Interarrival Dist. = 1 CPU 2 CPU 3 T 1 T 2 T 3 WCED = 8 WCED = 4 End-to-end Delay? WCED = 1
Case study : Problem 1 Component Task: Task get count++ get finish tick READY finish, [delay<= WCET ] d start, (count>0) count--, delay: =0 EXEC tick delay++ get count++ tick
Case study : Problem 1 BIP code snippet for a Task component Task (int wcet) port get, start, tick, finish data {# int count, delay; #} … init {# count = 0; WCET = wcet; … #} behavior state READY on get do {# count++; #} to READY on start provided {# count > 0 #} do {# count--; delay = 0; #} to EXEC on tick to READY state EXEC on get do {# count++; #} to EXEC on finish when ({# delay <= WCET #}, delayable) to READY on tick do {# delay++; #} to EXEC end … end
Case study : Problem 1 Composition in BIP glue get T 2 T 3 finish T 1 T 2 get go Burst Input Stream Generator Evnt. T 1 T 2 finish T 1 tick Tick System tick
Case study : Problem 1 BIP code snippet for Task Composition component System contains Launcher Burst. Stream. Gen(10, 5, 1) contains Task T 1(8), T 2(4), T 3(1) connector Tick = Burst. Stream. Gen. tick, T 1. tick, T 2. tick, T 3. tick behavior end connector Evnt. T 1 = Burst. Stream. Gen. go, T 1. get behavior end … priority // start < get ( no event losses ) get. Start 1 T 1. Start : T 1. start < Evnt. T 1 : T 1. get … priority // finish < get ( no event losses ) get. Fin 1 T 1 T 2 : T 1. finish < Evnt. T 1 : T 1. get … priority // ( tick < finish ) get. Tick 2 if (T 1. delay == T 1. WCET) Tick : T 2. tick < T 1 T 2 : T 1. finish …
Case study : Problem 2 End-to-end Delay? Bursty Event-Stream: Period = 10 Jitter = 50 Min. Interarrival Dist. = 1 Preemptive Fixed. Priority Scheduling. (T 1 has higher priority than T 3) CPU 1 CPU 2 T 1 T 2 WCED = 8 T 3 WCED = 1 WCED = 4
Case study : Problem 2 Behavior & Architecture def get count++ preempt Task(preemptable) get tick preempt EXEC tick delay++ get count++ tick SUSPEND resume get count++ finish start, (count>0) count--, delay=0 finish, [delay<= WCET] d resume READY
Case study : Problem 2 Composition in BIP glue get T 1 tick finish go Burst Stream Generator tick resume preempt finish start preempt resume T 3 get tick Priorities : T 3 < T 1 System get T 2 finish tick
Burst Event Stream Generator in BIP ai-1 ai y x : = 0 y : = 0 k : = 0 tick, x++ y++ x RUN i i+1 … period, [ x = T ] x : = 0 k : = k+1 i+k go [k 0 x + k T J y d] y : = 0, k : =k-1 tick go
State Space graph
Results : Max End-to-End Delays P 3 P 1 P 2 Nonpreemptive Preemptive J=30, P=10, d=1 35 48 40 149 148 J=40, P=10, d=1 43 57 49 189 194 J=50, P=10, d=1 51 66 58 234 m. o (Measured using an Observer Component)
Summary n n Strengths ¨ Modeling of heterogeneous systems: Event and Data driven, Untimed and Timed, Synchronous and asynchronous ¨ Reusability: existing components can be combined to generate complex components using platform glue ¨ Incremental modeling ¨ Flexibility due to the combination between interactions and priorities Limitations ¨ Restrictions of computational approaches, eg state-space explosion, unable to compute average values.
- Slides: 16