Synthesis of Embedded Software Using Free-Choice Petri Nets.

Slides:



Advertisements
Similar presentations
© 2004 Wayne Wolf Topics Task-level partitioning. Hardware/software partitioning.  Bus-based systems.
Advertisements

Distributed Snapshots: Determining Global States of Distributed Systems Joshua Eberhardt Research Paper: Kanianthra Mani Chandy and Leslie Lamport.
CSCI 4717/5717 Computer Architecture
1 SE-561 Formal Methods in Software Petri Nets - I.
Knowledge Based Synthesis of Control for Distributed Systems Doron Peled.
Introduction to Petri Nets Hugo Andrés López
A university for the world real R © 2009, Chapter 3 Advanced Synchronization Moe Wynn Wil van der Aalst Arthur ter Hofstede.
Based on: Petri Nets and Industrial Applications: A Tutorial
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
Formal Methods for Real- Time Embedded Software Engineering 正規方法應用於即時嵌入式 軟體工程 熊博安 國立中正大學資訊工程學系 民國九十一年五月二十二日.
Timed Automata.
Memory Management Chapter 7.
1 A class of Generalized Stochastic Petri Nets for the performance Evaluation of Mulitprocessor Systems By M. Almone, G. Conte Presented by Yinglei Song.
IE 469 Manufacturing Systems
Requirements on the Execution of Kahn Process Networks Marc Geilen and Twan Basten 11 April 2003 /e.
Petri net modeling of biological networks Claudine Chaouiya.
I MPLEMENTING S YNCHRONOUS M ODELS ON L OOSELY T IME T RIGGERED A RCHITECTURES Discussed by Alberto Puggelli.
1 Complexity of Network Synchronization Raeda Naamnieh.
10. Petri Nets Prof. O. Nierstrasz. Roadmap  Definition: —places, transitions, inputs, outputs —firing enabled transitions  Modelling: —concurrency.
CS447/ECE453/SE465 Prof. Alencar University of Waterloo 1 CS447/ECE453/SE465 Software Testing Tutorial Winter 2008 Based on the tutorials by Prof. Kontogiannis,
Ordering and Consistent Cuts Presented By Biswanath Panda.
Banker’s Algorithm Implementation in CPN Tools Michal Žarnay Department of Transportation Networks University of Žilina, Slovakia.
Scheduling for Embedded Real-Time Systems Amit Mahajan and Haibo.
CP — Concurrent Programming 12. Petri Nets Prof. O. Nierstrasz Wintersemester 2005 / 2006.
A Schedulability-Preserving Transformation of BDF to Petri Nets Cong Liu EECS 290n Class Project December 10, 2004.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
1 Quasi-Static Scheduling of Embedded Software Using Free-Choice Petri Nets Marco Sgroi, Alberto Sangiovanni-Vincentelli Luciano Lavagno University of.
Scheduling with Optimized Communication for Time-Triggered Embedded Systems Slide 1 Scheduling with Optimized Communication for Time-Triggered Embedded.
Dataflow Process Networks Lee & Parks Synchronous Dataflow Lee & Messerschmitt Abhijit Davare Nathan Kitchen.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
Models of Computation for Embedded System Design Alvise Bonivento.
1 Petri Nets Marco Sgroi EE249 - Fall 2002.
1 Petri Nets Marco Sgroi EE249 - Fall 2001 Most slides borrowed from Luciano Lavagno’s lecture ee249 (1998)
Expressing Giotto in xGiotto and related schedulability problems Class Project Presentation Concurrent Models of Computation for Embedded Software University.
© Andy Wellings, 2003 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
CS533 - Concepts of Operating Systems
01/27/2005 Combinationality of cyclic definitions EECS 290A – Spring 2005 UC Berkeley.
Technische universiteit eindhoven Department of Electrical Engineering Electronic Systems Liveness and Boundedness of Synchronous Data Flow Graphs A.H.
S. M. Farhad PhD Student Supervisor: Dr. Bernhard Scholz
Modeling with ordinary Petri Nets Events: Actions that take place in the system The occurrence of these events is controlled by the state of the system.
Real-Time Embedded Software Synthesis 即時嵌入式軟體合成 熊博安國立中正大學資訊工程學系民國九十年十一月廿九日.
Time-Memory Scheduling and Code Generation of Real-Time Embedded Software Chuen-Hau Gau and Pao-Ann Hsiung National Chung Cheng University Chiayi, Taiwan,
CY2003 Computer Systems Lecture 7 Petri net. © LJMU, 2004CY2003- Week 72 Overview Petri net –concepts –Petri net representation –Firing a transition –Marks.
1 Formal Synthesis and Control of Soft Embedded Real-Time Systems Pao-Ann Hsiung National Chung Cheng University Dept. of Computer Science and Information.
Formal Synthesis and Code Generation of Embedded Real-Time Software Pao-Ann Hsiung National Chung Cheng University Chiayi-621, Taiwan, ROC. 9th ACM/IEEE.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
6. A PPLICATION MAPPING 6.3 HW/SW partitioning 6.4 Mapping to heterogeneous multi-processors 1 6. Application mapping (part 2)
Petri Nets Lecturer: Roohollah Abdipour. Agenda Introduction Petri Net Modelling with Petri Net Analysis of Petri net 2.
Undergraduate course on Real-time Systems Linköping 1 of 45 Autumn 2009 TDDC47: Real-time and Concurrent Programming Lecture 5: Real-time Scheduling (I)
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
1 Copyright  2001 Pao-Ann Hsiung SW HW Module Outline l Introduction l Unified HW/SW Representations l HW/SW Partitioning Techniques l Integrated HW/SW.
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 33: Worst Case Execution Time Steven Reiss, Fall 2015.
School of Computer Science & Software Engineering
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
High Performance Embedded Computing © 2007 Elsevier Lecture 4: Models of Computation Embedded Computing Systems Mikko Lipasti, adapted from M. Schulte.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Channels. Models for Communications Synchronous communications – E.g. Telephone call Asynchronous communications – E.g. .
Diagnostic Information for Control-Flow Analysis of Workflow Graphs (aka Free-Choice Workflow Nets) Cédric Favre(1,2), Hagen Völzer(1), Peter Müller(2)
Advantages of FSM Their simplicity make it easy for inexperienced developers to implement with little to no extra knowledge (low entry level)
CPE555A: Real-Time Embedded Systems
Dr. Eng Amr T. Abdel-Hamid
2. Specification and Modeling
Clockless Computing COMP
CSCI1600: Embedded and Real Time Software
Introduction to Petri Nets (PNs)
COMP60621 Fundamentals of Parallel and Distributed Systems
CENG334 Introduction to Operating Systems
COMP60611 Fundamentals of Parallel and Distributed Systems
CSCI1600: Embedded and Real Time Software
Presentation transcript:

Synthesis of Embedded Software Using Free-Choice Petri Nets

Challenges in Embedded System Design Software development and its integration with the hardware − Start with a implementation-independent specification of overall system − Map it to a heterogeneous architecture …

Introduction Embedded system specification − Data computations Schedule can be completely computed at compile time,. − Control structures Data dependent control − like if-then-else or do loops Real time controls − Suspension, trigger actions after the occurrence of external or internal events.

Introduction − Schedule Static − static(single task, predictable, executed with no run-time overhead) Data dependent − in addition to data computation, the order of operations are executed depends on the value of some data, which is known at run-time. − quasi-static scheduling techniques computing most of the schedule at compile time, leaving at run-time only the solution of data-dependent decisions. partition the functionality of the specification into tasks.

Introduction − Dynamic schedule Or real-time controls, the run-time behaviour depends on the occurrence of external events. Classical Real-Time scheduling techniques can be used to decide at run-time which tasks should be executed in reaction to such events. An ideal scheduling technique should combine the best aspects of the scheduling techniques: 1.static scheduling to exploit fixed dependencies between blocks of operations,

Introduction 2.quasi-static scheduling to identify data-dependent operations with the same rate and schedule them, 3.dynamic scheduling to determine which tasks, among those identified at the previous step, should be executed. Software synthesis technique: Static and quasi-static scheduling generates sequential code and can statically allocate communication buffers.

Introduction An effective software synthesis technique should: 1.check if the specification can be scheduled in finite memory, and thus be implemented on an embedded processor, 2.allow one to evaluate tradeoffs between memory size and execution speed of the final implementation. — This paper: A new approach to software synthesis. PNA set of software tasks

Introduction − Transitions: data computations ; − Places: non-FIFO channels between computation units. − Data-dependent control : places, called choices, with multiple output transitions, − Data: tokens passed by transitions through places, − Free-Choice (FCPNs): it has a clear distinction between the concurrency and choice. The outcome of a choice depends on the value rather than on the arrival time of a token.

Introduction FCPN is quasi-statically schedulable if for every possible resolution of the control at the choice places, there exists a cyclic finite sequence that returns the tokens of the net to their initial places. cyclic sequences ensures that the number of data tokens that accumulate in any place is bounded even for infinite execution.

Definitions − Petri Net: (P,T,F) − Preset: − Postset: − Source, Sink − Choice or conflict: place p, |p|>1 − Marking: μ ={μ1, μ2, μ3 … μn } − Reachability: a marking μ’ is reachable from a marking μ if there exists a firing sequence σ starting at marking μ and finishing at μ’. − Boundedness: k-bounded if the number of tokens in every place of reachable marking <k

Definitions Deadlock-freedom: no matter what marking has been reached, it is possible to fire at least one transition of the net − Liveness: for every reachable marking and every transition t it is possible to reach a marking that enables t.

Definitions − Common subclasses of PN: Marked Graph: A PN such that each place p has at most one input transition and one output transition Conflict free Net: A PN such that each place p has at most one output transition Free choice Net: A PN such that every arc from a place is either a unique outgoing arc or a unique incoming arc to a transition.

Definitions Marked Graphs can represent concurrency and synchronization but not conflict. Free Choice Nets allow one to model both conflict and synchronization, under the condition that every transition that is successor of a choice has exactly one predecessor place. Therefore, Free Choice Nets model data-dependent control by abstracting if-then-else control decisions as non-deterministic choices, but they can not model external conditions or multiple rendezvous.

Definitions − Cyclic Schedule: finite complete cycle: A sequence of transition firings that returns the net to its initial marking. The number of tokens that can accumulate in any place of the net is bounded and the net can be executed forever with bounded memory. a static schedule is a periodic sequence of transitions and the period is a finite complete cycle.

Definitions To find a finite complete cycle σ, we must first solve the state equations f(σ) T. D = 0. f(σ), called T-invariant, is a vector of times that transition ti fired in sequence σ. A Petri Net is consistent f(σ) T. D = 0. The existence of a T-invariant is a necessary, but not sufficient for a finite complete cycle to exist: deadlock can still occur if there are not enough tokens to fire any transition. once a T-invariant is obtained, it is necessary to verify that there exists a sequence σi that contains transition tj as many times as fj(σ).

Qusi-static Scheduling of FCPN

Given an FCPN N and an initial marking μ0, the pair (N,μ0) is (quasi-statically) schedulable, if there exists a valid schedule. Valid schedule: for each sequence σi that includes a conflict transition σij, for each transition tk that is in equal conflict relation with σij, there exists another sequence σl s.t. σi and σl are identical up to the (j-1)th transition and have respectively σij and tk at the j-th position in the sequence.

Qusi-static Scheduling of FCPN Σ={(t1,t2,t4),(t1,t3,t5)} is a valid schedule because for every solution of the conflict between transitions t2,and t3, it is possible to complete a cycle that returns the net to the initial marking by firing t4 after t2 or t5 after t3.

Qusi-static Scheduling of FCPN Σ={(t1t2t1t2t4),(t1t3t5t5)} is a valid schedule. there is no guarantee that this happens within a cycle because it is not possible to know a priori which transition among t2 and t3 fires.

Qusi-static Scheduling of FCPN A valid schedule does not necessarily include all the possible cyclic firing sequences, some even of infinite length, that can occur depending on the resolution of the non-deterministic choices. {(t1t3t5t5),(t1t2(t1t3t5t5) n t1t2t4)} A valid schedule should a complete set of cyclic firing sequences that ensure bounded memory execution of the net. (all the sequences that can occur)

Qusi-s S of FCPN- find a valid schedule Step1: Decompose the net into Conflict Free (CF) components T-allocation :a function α: P T that chooses exactly one among the successors of each place. T-reduction: associated with a T-allocation is a set of subnets generated from the image of the T-allocation using the Reduction Algorithm.

Qusi-s S of FCPN- find a valid schedule Step2: Check if every CF component is statically schedulable A T-reduction Ri is schedulable if (1)it is consistent, (2)for each source transition ts in N, it has a T-invariant Containing ts, (3)there exists a firing sequence that returns Ri to the initial marking without any deadlock when its execution is simulated Step 3. Derive a valid schedule, if there exists one A net is schedulable if for all its T-reductions, each of them corresponding to a sequence of choices, there exist a firing sequence containing at least one occurrence of every transition of the reduction.

Qusi-s S of FCPN- find a valid schedule Theorem: Given a FCPN, there exists a valid schedule iff every T-reduction is schedulable.

Qusi-s S of FCPN- find a valid schedule R1 is schedulable.

C-code generation The goal is: the synthesis of a software implementation that satisfies functional correctness minimizes a cost function of latency and memory size. Task: source transition with independent firing rate.

C-code generation

Experimental Result ATM server for virtual Private Network Using a FCPN it has 49 t, 41 places and 11 non-deterministic choices.