Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Schedulability-Preserving Transformation of BDF to Petri Nets Cong Liu EECS 290n Class Project December 10, 2004.

Similar presentations


Presentation on theme: "A Schedulability-Preserving Transformation of BDF to Petri Nets Cong Liu EECS 290n Class Project December 10, 2004."— Presentation transcript:

1 A Schedulability-Preserving Transformation of BDF to Petri Nets Cong Liu EECS 290n Class Project December 10, 2004

2 Outline Motivation Scheduling Petri Nets (PN) Scheduling Boolean Dataflow (BDF) Proposing a Transformation Extension of Consistence to PN Future Research Direction

3 Motivation Both BDF and Petri nets are concurrent models. Both have the scheduling problem Existence of Bounded Memory Schedules for BDF is undecidable [Buck 93]. No algorithms can guarantee to find a schedule if one exists. Petri nets are not Turing complete [Peterson 81]. Efficient scheduling algorithms exist [Cortedella 00]. Can we apply scheduling techniques for PN to scheduling BDF?

4 Motivation It is known SDF is equivalent to marked graph, a subclass of Petri nets How about BDF? If we want to build up equivalence, then what kind of equivalence? Trace equivalence Language containment Simulation relation What property to preserve during transformation? Turing-completeness of BDF make transformation applicable to a subclass of BDF

5 If-Then-Else using BDF while (1) { read (IN, x, 1); if (x>0) y = f(x); else y = g(x); write (OUT, y, 1); } SWITCH F T f SELECT F T OUT IN g >0?

6 If-Then-Else using PN while (1) { read (IN, x, 1); if (x>0) y = f(x); else y = g(x); write (OUT, y, 1); } B IN C OUT X>0?

7 Boolean Dataflow (BDF) Consumption/production rate is a two-valued (including zero) function of the value of a Boolean token received by the control port of the actor. Control ports always transfer exactly one token per execution. T F ED A B SWITCH F T F SELECT BDF: superset of synchronous dataflow (SDF) [Lee87]

8 Schedules of Boolean Dataflow A schedule is a finite list of guarded firings, where: there exists a feasible cyclic firing sequence returning to initial state regardless of values of Boolean controls Bounded length schedule Length of cyclic firing sequences are bounded by a constant, E.g. repeat (5) times. Bounded memory schedule Length of cyclic firing sequences are bounded by a constant, E.g. repeat (x) times. T F E D A B F (A,B,b:D,!b:E,F)

9 Scheduling Boolean Dataflow Solving balance equation Consistency check Simulation to test firability Clustering Dynamic scheduling

10 Petri Nets A directed graph with two kinds of nodes: place, transition System state (marking): number of tokens in each place Transition enabled if enough tokens in all incoming places Firing a transition consume/produce tokens Free choice set: {b, c} p1p1 p3p3 a b c e p2p2 d f p4p4 T-invariants: {a, b, d, f}, {a, c, e, f}

11 Scheduling Petri Nets A schedule is a rooted tree Finite Nodes → reachable markings, (root → initial marking) Edges → transitions Transitions in a FCS are fired at each node Each node has a path to root (if add returning arc) p1p1 p3p3 a b c e p2p2 d f p4p4 a null c p1p1 p3p3 p2p2 b p 4 e d f

12 Comparing BDF and PN schedules fire A; fire B; if (B) { fire D; } else { fire E; } fire F; p1p1 p3p3 a b c e p2p2 d f p4p4 a null c p1p1 p3p3 p2p2 b p 4 e d f T F E D A B F (A,B,b:D,!b:E,F)

13 Challenges to transformation Petri nets do not distinguish tokens. Petri nets do not preserve order of tokens. Proposed solutions: Use different places to hold tokens with different values Use synchronization (blocking write) to enforce ordering

14 A Transformation A set of “True”/ ”False” places express controls. A set of “Acknowledge” places to synchronize the production and consumption of Boolean tokens. T F C B A pTpT pFpF p F’ A T F CB p T’ T F B A C pTpT pFpF p F’ C T F A p T’ B

15 A Transformation Strong synchronization enforces blocking write at Boolean control ports A p F’ A TF p T’ p F’ p T’

16 FT D FT B C A SELECT F T D SWITCH FT B C A E F E FT pT1 pF1 pTa1 paF1 FT pT2 pF2 pTa2 paF2 Handling initial tokens

17 Algorithm Transform (BDF) { transform_SDF_actors; transform_BooleanGenerators; transform_SWITCH; transform_SELECT; handeling_initial_tokes; }

18 Propositions Proposition 1 If the transformed Petri net has a bounded length schedule, the corresponding BDF has a bounded length schedule. Sketch of proof: show that Petri net contains a subset of behaviors of BDF. Proposition 2 If the BDF has a bounded length schedule, the transformed Petri net has a bounded length schedule. Sketch of proof: Determine exact times each actor to be fired Transform BDF to acyclic precedence graph (APG) Decompose Petri net to marked graph component (MGC) Build up equivalence between APG and MGC

19 Extension of Consistence to PN The restrictions on the values of symbolic variables of a BDF are transformed into the dependence relation of corresponding transitions of the transformed Petri net. SELECT F T D SWITCH FT B C A E F For any T-invariants, if it contains transition T of SWITCH, it also contains transition T of SELECT p1 p2 p1 = p2

20 FT D FT B C A SELECT F T D SWITCH FT B C A E F E FT pT1 pF1 pTa1 paF1 FT pT2 pF2 pTa2 paF2

21 Future Research Direction Does the two propositions also holds for bounded memory schedule? Can generalize the notion of schedule by assuming some kind of fairness? Assuming program will always exit iterations Transform a Petri net to a BDF? Other equivalence alternatives? More exploration on schedulability and consistence notion for the transformation


Download ppt "A Schedulability-Preserving Transformation of BDF to Petri Nets Cong Liu EECS 290n Class Project December 10, 2004."

Similar presentations


Ads by Google