86
1 of 86 Embedded Systems Design Fö 5 PETRI NETS 1. Basic Petri Net Model 2. Properties and Analysis of Petri Nets 3. Extended Petri Net Models

1. Basic Petri Net Model 2. Properties and Analysis of

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1. Basic Petri Net Model 2. Properties and Analysis of

1 of 86Embedded Systems Design Fö 5

PETRI NETS

1. Basic Petri Net Model

2. Properties and Analysis of Petri Nets

3. Extended Petri Net Models

Page 2: 1. Basic Petri Net Model 2. Properties and Analysis of

2 of 86Embedded Systems Design Fö 5

Petri Nets

Systems are specified as a directed bipartite graph.

The two kinds of nodes in the graph:

Page 3: 1. Basic Petri Net Model 2. Properties and Analysis of

3 of 86Embedded Systems Design Fö 5

Petri Nets

Systems are specified as a directed bipartite graph.

The two kinds of nodes in the graph:

1. Places: they hold the distributed state of the system expressed by the presence/absence of tokens in the places.

Page 4: 1. Basic Petri Net Model 2. Properties and Analysis of

4 of 86Embedded Systems Design Fö 5

Petri Nets

Systems are specified as a directed bipartite graph.

The two kinds of nodes in the graph:

1. Places: they hold the distributed state of the system expressed by the presence/absence of tokens in the places.

2. Transitions: denote the activity in the system

Page 5: 1. Basic Petri Net Model 2. Properties and Analysis of

5 of 86Embedded Systems Design Fö 5

Petri Nets

Systems are specified as a directed bipartite graph.

The two kinds of nodes in the graph:

1. Places: they hold the distributed state of the system expressed by the presence/absence of tokens in the places.

2. Transitions: denote the activity in the system

The state of the system: captured by the marking of the places (number of tokens in each place)

Page 6: 1. Basic Petri Net Model 2. Properties and Analysis of

6 of 86Embedded Systems Design Fö 5

Petri Nets

The dynamic evolution of the system: determined by the firing process of transitions.

A transition is enabled and may fire whenever all its predecessor places are marked.

Page 7: 1. Basic Petri Net Model 2. Properties and Analysis of

7 of 86Embedded Systems Design Fö 5

Petri Nets

The dynamic evolution of the system: determined by the firing process of transitions.

A transition is enabled and may fire whenever all its predecessor places are marked.

If a transition fires it removes a token from each predecessor place and adds a token to each successor place.

Page 8: 1. Basic Petri Net Model 2. Properties and Analysis of

8 of 86Embedded Systems Design Fö 5

Nondeterminism

Both T1 and T2 are enabled and any of the two may fire.

T1 T2

Page 9: 1. Basic Petri Net Model 2. Properties and Analysis of

9 of 86Embedded Systems Design Fö 5

Nondeterminism

Both T1 and T2 are enabled and any of the two may fire.

T1 T2

T1 T2

T 1 fi

res

Page 10: 1. Basic Petri Net Model 2. Properties and Analysis of

10 of 86Embedded Systems Design Fö 5

Nondeterminism

Both T1 and T2 are enabled and any of the two may fire.

T1 T2

T1 T2

T2 fires

Page 11: 1. Basic Petri Net Model 2. Properties and Analysis of

11 of 86Embedded Systems Design Fö 5

Nondeterminism

Both T1 and T2 are enabled and any of the two may fire.

Any of these two states might be the next state.

T1 T2

T1 T2 T1 T2

Page 12: 1. Basic Petri Net Model 2. Properties and Analysis of

12 of 86Embedded Systems Design Fö 5

Nondeterminism

T1 T2

Page 13: 1. Basic Petri Net Model 2. Properties and Analysis of

13 of 86Embedded Systems Design Fö 5

Nondeterminism

T1 T2

T1 T2

T 1 fi

res

Page 14: 1. Basic Petri Net Model 2. Properties and Analysis of

14 of 86Embedded Systems Design Fö 5

Nondeterminism

T1 T2

T1 T2

T2 fire s

Page 15: 1. Basic Petri Net Model 2. Properties and Analysis of

15 of 86Embedded Systems Design Fö 5

Nondeterminism

T1 T2

T1 T2

T1 &T

2 fire

Page 16: 1. Basic Petri Net Model 2. Properties and Analysis of

16 of 86Embedded Systems Design Fö 5

Nondeterminism

T1 T2

T1 T2 T1 T2T1 T2

Any of the three states might be the next state.

Page 17: 1. Basic Petri Net Model 2. Properties and Analysis of

17 of 86Embedded Systems Design Fö 5

Nondeterminism

T2 T3

T1

Page 18: 1. Basic Petri Net Model 2. Properties and Analysis of

18 of 86Embedded Systems Design Fö 5

Nondeterminism

No nondeterminism here:T1 is the only enambled transition!

T1 fires

T2 T3

T1

T2 T3

T1

Page 19: 1. Basic Petri Net Model 2. Properties and Analysis of

19 of 86Embedded Systems Design Fö 5

Nondeterminism

T2 T3

T1

T2 T3

T1

T2 T3

T1

T 2 fi

res

Page 20: 1. Basic Petri Net Model 2. Properties and Analysis of

20 of 86Embedded Systems Design Fö 5

Nondeterminism

T2 T3

T1

T2 T3

T1

T2 T3

T1T3 fires

Page 21: 1. Basic Petri Net Model 2. Properties and Analysis of

21 of 86Embedded Systems Design Fö 5

Nondeterminism

T2 T3

T1

T2 T3

T1

T2 T3

T1

T2 &T

3 fire

Page 22: 1. Basic Petri Net Model 2. Properties and Analysis of

22 of 86Embedded Systems Design Fö 5

Nondeterminism

T2 T3

T1

T2 T3

T1

T2 T3

T1

T2 T3

T1

T2 T3

T1

Any of the three states might be the next state.

Page 23: 1. Basic Petri Net Model 2. Properties and Analysis of

23 of 86Embedded Systems Design Fö 5

Petri Net Example

A producer and a consumer process communicating through a buffer:

prod.

send

rec.

cons.

B

Page 24: 1. Basic Petri Net Model 2. Properties and Analysis of

24 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B

Page 25: 1. Basic Petri Net Model 2. Properties and Analysis of

25 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

Page 26: 1. Basic Petri Net Model 2. Properties and Analysis of

26 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

B

Page 27: 1. Basic Petri Net Model 2. Properties and Analysis of

27 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

B B

Page 28: 1. Basic Petri Net Model 2. Properties and Analysis of

28 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

B B B

Page 29: 1. Basic Petri Net Model 2. Properties and Analysis of

29 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

B

Page 30: 1. Basic Petri Net Model 2. Properties and Analysis of

30 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B

Page 31: 1. Basic Petri Net Model 2. Properties and Analysis of

31 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

Page 32: 1. Basic Petri Net Model 2. Properties and Analysis of

32 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

B

Page 33: 1. Basic Petri Net Model 2. Properties and Analysis of

33 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

B B

Page 34: 1. Basic Petri Net Model 2. Properties and Analysis of

34 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

B B B

Page 35: 1. Basic Petri Net Model 2. Properties and Analysis of

35 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

B

Page 36: 1. Basic Petri Net Model 2. Properties and Analysis of

36 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B

Page 37: 1. Basic Petri Net Model 2. Properties and Analysis of

37 of 86Embedded Systems Design Fö 5

Petri Net Example

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

Page 38: 1. Basic Petri Net Model 2. Properties and Analysis of

38 of 86Embedded Systems Design Fö 5

Petri Net Example

Notice that the buffer is considered to be infinite (tokens accumulate in B).

prod.

send

rec.

cons.

prod.

send

rec.

cons.

prod.

send

rec.

cons.

B B B

Page 39: 1. Basic Petri Net Model 2. Properties and Analysis of

39 of 86Embedded Systems Design Fö 5

Petri Net Example

Here we have the same model as on the previous slides, but with limited buffer. The buffer size is three (number of initial tokens in B’)

Nr. of tokens in B’: how many free slots are available in the buffer;

Nr. of tokens in B: how many messages (tokens) are in the buffer.

Total number of tokens in B and B’ is constant (= 3).

prod.

send

rec.

cons.

B

B’

Page 40: 1. Basic Petri Net Model 2. Properties and Analysis of

40 of 86Embedded Systems Design Fö 5

Petri Net Example

Here we have the same model as on the previous slides, but with limited buffer. The buffer size is three (number of initial tokens in B’)

Nr. of tokens in B’: how many free slots are available in the buffer;

Nr. of tokens in B: how many messages (tokens) are in the buffer.

Total number of tokens in B and B’ is constant (= 3).

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

Page 41: 1. Basic Petri Net Model 2. Properties and Analysis of

41 of 86Embedded Systems Design Fö 5

Petri Net Example

Here we have the same model as on the previous slides, but with limited buffer. The buffer size is three (number of initial tokens in B’)

Nr. of tokens in B’: how many free slots are available in the buffer;

Nr. of tokens in B: how many messages (tokens) are in the buffer.

Total number of tokens in B and B’ is constant (= 3).

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

Page 42: 1. Basic Petri Net Model 2. Properties and Analysis of

42 of 86Embedded Systems Design Fö 5

Petri Net Example

Here we have the same model as on the previous slides, but with limited buffer. The buffer size is three (number of initial tokens in B’)

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

Page 43: 1. Basic Petri Net Model 2. Properties and Analysis of

43 of 86Embedded Systems Design Fö 5

Petri Net Example

Here we have the same model as on the previous slides, but with limited buffer. The buffer size is three (number of initial tokens in B’)

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

Page 44: 1. Basic Petri Net Model 2. Properties and Analysis of

44 of 86Embedded Systems Design Fö 5

Petri Net Example

Here we have the same model as on the previous slides, but with limited buffer. The buffer size is three (number of initial tokens in B’)

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

prod.

send

rec.

cons.

B

B’

Page 45: 1. Basic Petri Net Model 2. Properties and Analysis of

45 of 86Embedded Systems Design Fö 5

Some Features and Applications of Petri Nets

Intuitive.

Easy to express concurrency, synchronisation, nondeterminism.

Nondeterminism is an important difference between Petri nets and dataflow!

As an uninterpreted model, Petri Nets can be used for several, very different classes of problems.

Uninterpreted model: nothing has to be specified related to the particular activities associated to the transitions.

Page 46: 1. Basic Petri Net Model 2. Properties and Analysis of

46 of 86Embedded Systems Design Fö 5

Some Features and Applications of Petri Nets

Petri Nets have been intensively used for modeling and analysis of industrial production systems, information systems, but also

Computer architectures

Operating systems

Concurrent programs

Distributed systems

Hardware systems

Page 47: 1. Basic Petri Net Model 2. Properties and Analysis of

47 of 86Embedded Systems Design Fö 5

Properties and Analysis of Petri Nets

Several properties of the system can be analysed using Petri nets:

Boundedness: number of tokens in a place does not exceed a limit.

If this limit is 1, the property is sometimes called safeness.

- You can check that available resources are not exceeded.

Page 48: 1. Basic Petri Net Model 2. Properties and Analysis of

48 of 86Embedded Systems Design Fö 5

Properties and Analysis of Petri Nets

Several properties of the system can be analysed using Petri nets:

Boundedness: number of tokens in a place does not exceed a limit.

If this limit is 1, the property is sometimes called safeness.

- You can check that available resources are not exceeded.

Liveness: A transition t is called live if for every possible marking there exists a chance for that transition to become enabled.

The whole net is live, if all its transitions are live.

- Important in order to check that the system is not deadlocked.

Page 49: 1. Basic Petri Net Model 2. Properties and Analysis of

49 of 86Embedded Systems Design Fö 5

Properties and Analysis of Petri Nets

Several properties of the system can be analysed using Petri nets:

Boundedness: number of tokens in a place does not exceed a limit.

If this limit is 1, the property is sometimes called safeness.

- You can check that available resources are not exceeded.

Liveness: A transition t is called live if for every possible marking there exists a chance for that transition to become enabled.

The whole net is live, if all its transitions are live.

- Important in order to check that the system is not deadlocked.

Reachability: given a current marking M and another marking M’, does there exist a sequence of transitions by which M’ can be obtained?

- You can check that a certain desired state (marking) is reached.

- You can check that a certain undesired state is never reached.

Page 50: 1. Basic Petri Net Model 2. Properties and Analysis of

50 of 86Embedded Systems Design Fö 5

Properties and Analysis of Petri Nets

Mathematical tools are available for analysis of Petri Nets.

The properties discussed above can be formally verified.

Petri nets (like dataflow systems) are asynchronous concurrent.

Events can happen at any time.

There exists a partial order of events.

Page 51: 1. Basic Petri Net Model 2. Properties and Analysis of

51 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

Basic Petri Net models have a limited expressive power.

Page 52: 1. Basic Petri Net Model 2. Properties and Analysis of

52 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

Basic Petri Net models have a limited expressive power.

Timed Petri Nets

Transitions have associated times (time intervals)

Tokens are carrying time stamps.

With timed Petri nets we can model the timing aspects

Page 53: 1. Basic Petri Net Model 2. Properties and Analysis of

53 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

Basic Petri Net models have a limited expressive power.

Timed Petri Nets

Transitions have associated times (time intervals)

Tokens are carrying time stamps.

With timed Petri nets we can model the timing aspects

Coloured Petri Nets

Tokens have associated values

Transitions have associated functions

Coloured Petri Nets are similar to dataflow models (but also capture nondeterminism!).

Page 54: 1. Basic Petri Net Model 2. Properties and Analysis of

54 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

Coloured and Timed Petri net

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

(5, 0)

x y

2×x y+3

y+x

x y

x yx>0

(2, 0)

x-3 y+2

Tokens carry Time stamps

Page 55: 1. Basic Petri Net Model 2. Properties and Analysis of

55 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

Coloured and Timed Petri net

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

(5, 0)

x y

2×x y+3

y+x

x y

x yx>0

(2, 0)

x-3 y+2

Tokens carry Time stamps

Transitions have associated time (interval)

Page 56: 1. Basic Petri Net Model 2. Properties and Analysis of

56 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

Coloured and Timed Petri net

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

(5, 0)

x y

2×x y+3

y+x

x y

x yx>0

(2, 0)

x-3 y+2

Tokens carry Time stamps

Transitions have associated time (interval)

Tokens have associated values

Page 57: 1. Basic Petri Net Model 2. Properties and Analysis of

57 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

Coloured and Timed Petri net

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

(5, 0)

x y

2×x y+3

y+x

x y

x yx>0

(2, 0)

x-3 y+2

Tokens carry Time stamps

Transitions have associated time (interval)

Tokens have associated values

Transitions have associated functions and guards

Page 58: 1. Basic Petri Net Model 2. Properties and Analysis of

58 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

(5, 0)

x y

2×x y+3

y+x

x y

x yx>0

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

x y

2×x y+3

y+x

x y

x yx>0

(2, 0)

(10,2)

x-3 y+2 x-3 y+2

(2, 0)

Page 59: 1. Basic Petri Net Model 2. Properties and Analysis of

59 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

(5, 0)

x y

2×x y+3

y+x

x y

x yx>0

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

x y

2×x y+3

y+x

x y

x yx>0

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

x y

2×x y+3

y+x

x y

x yx>0

(2, 0)

(10,2) (5, 4)(10,2)

x-3 y+2 x-3 y+2 x-3 y+2

(2, 0)

Page 60: 1. Basic Petri Net Model 2. Properties and Analysis of

60 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

x y

2×x y+3

y+x

x y

x yx>0

(15,6)

x-3 y+2

Page 61: 1. Basic Petri Net Model 2. Properties and Analysis of

61 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

x y

2×x y+3

y+x

x y

x yx>0

[1, 5] [2, 7]

[2, 2]

[2, 4][1, 3]

x y

2×x y+3

y+x

x y

x yx>0

(15,6)

x-3 y+2 x-3 y+2

(17,8)

Page 62: 1. Basic Petri Net Model 2. Properties and Analysis of

62 of 86Embedded Systems Design Fö 5

Extended Petri Net Models

Extended Petri Nets have a larger expressive power then classical Petri Nets.

Analysis is more complex; the formal analysis of properties can take very large amounts of time (memory).

Simulation of the Petri Net is very often used in order to verify the system and to estimate performance

Page 63: 1. Basic Petri Net Model 2. Properties and Analysis of

63 of 86Embedded Systems Design Fö 5

DISCRETE EVENT MODELS

1. What Is a Discrete Event Model?

2. Discrete Event Simulation

3. Efficiency of Discrete Event Simulation

4. Potential Ambiguities in Discrete Event Simulation

Page 64: 1. Basic Petri Net Model 2. Properties and Analysis of

64 of 86Embedded Systems Design Fö 5

Discrete Event Models

The system is a collection of processes that respond to events.

Each event carries a time-stamp indicating the time at which the event occurs.

Time-stamps are totally ordered.

A Discrete Event (DE) simulator maintains a global event queue sorted by the time-stamps. The simulator also keeps a single global time.

Page 65: 1. Basic Petri Net Model 2. Properties and Analysis of

65 of 86Embedded Systems Design Fö 5

Discrete Event Simulator

. . . . .S1<=5 after 2s. . . . .wait on S3

Process P1

. . . . .wait on S1. . . . .S3 <= ...

Process P2

Page 66: 1. Basic Petri Net Model 2. Properties and Analysis of

66 of 86Embedded Systems Design Fö 5

Discrete Event Simulator

time1

time2

timei

ev_namevalue

ev_namevalue

ev_namevalue

ev_namevalue

ev_namevalue

ev_namevalue

Global clock

Page 67: 1. Basic Petri Net Model 2. Properties and Analysis of

67 of 86Embedded Systems Design Fö 5

Discrete Event Simulator

time1

time2

timei

ev_namevalue

ev_namevalue

ev_namevalue

ev_namevalue

ev_namevalue

ev_namevalue

Global clock

. . . . .S1<=5 after 2s. . . . .wait on S3

Process P1

. . . . .wait on S1. . . . .S3 <= ...

Process P2

S15

This event will be generated and placed into the event queue at time tglobal_clock + 2

Page 68: 1. Basic Petri Net Model 2. Properties and Analysis of

68 of 86Embedded Systems Design Fö 5

Discrete Event Simulator

Advance global clock to tcurrent, the time-stamp of the earliest event(s) in the event queue.

Update the values of all events having time-stamp = tcurrent.

Activate and run all processes which are sensible to the updated events; each process will eventually reach a wait for a certain event and enter a wait state.

The activated processes have generated new events; place these events at their right place in the event queue.

Any events left?

Yes

No

Simulationdone!

Page 69: 1. Basic Petri Net Model 2. Properties and Analysis of

69 of 86Embedded Systems Design Fö 5

Discrete Event Simulation

The discrete event model has been mainly used for system simulation.

Several languages have been developed for system modeling based on the discrete event model. Most well known:

- VHDL, Verilog (both used for hardware modeling), SystemC

Efficient way to simulate distributed systems.

In general, efficient for large systems with autonomous components, with relatively large idle times. Systems with non-regular, possibly long times between different activities.

Why is this the case?

Because DE simulation will only consider the particular times when a change in the system (an event) occurs. This is opposed to, for example, cycle-based models, where all clock-ticks are considered.

Page 70: 1. Basic Petri Net Model 2. Properties and Analysis of

70 of 86Embedded Systems Design Fö 5

Discrete Event Simulation

Event driven models are primarily employed for simulation.

Functional verification

Performance evaluation

Both synthesis and formal verification are very complex with DE models.

The classical trade-off between expressive power and the possibility of formal reasoning and efficient synthesis.

Page 71: 1. Basic Petri Net Model 2. Properties and Analysis of

71 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18 after 10. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

100S1

0S2 Initial values

Page 72: 1. Basic Petri Net Model 2. Properties and Analysis of

72 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18 after 10. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

100S1

0S2 Initial values

At time 10 Process A executes

15 S15

Page 73: 1. Basic Petri Net Model 2. Properties and Analysis of

73 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18 after 10. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

100S1

0S2 Initial values

At time 10 Process A executes

15 S15

At time 15

5S1

0S2

Processes B and C are ready to execute

Page 74: 1. Basic Petri Net Model 2. Properties and Analysis of

74 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18 after 10. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

time 155

S10

S2

Page 75: 1. Basic Petri Net Model 2. Properties and Analysis of

75 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18 after 10. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

B executes

25 S218

time 155

S10

S2

Page 76: 1. Basic Petri Net Model 2. Properties and Analysis of

76 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18 after 10. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

B executes

25 S218

time 155

S10

S2

C executes

Page 77: 1. Basic Petri Net Model 2. Properties and Analysis of

77 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18 after 10. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

B executes

25 S218

time 155

S10

S2

C executes

At time 25

5S1

18S2

C executes

Page 78: 1. Basic Petri Net Model 2. Properties and Analysis of

78 of 86Embedded Systems Design Fö 5

Delta Delay/Delta Cycles

A zero delay event will be registered at a time which is infinitesimally delayed relative to the current time.

A delta delay will be introduced on the event the new event will be consumed in the following simulation cycle and not the current one.

Page 79: 1. Basic Petri Net Model 2. Properties and Analysis of

79 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18 after 10. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

We have changed the example!No after clause!

Page 80: 1. Basic Petri Net Model 2. Properties and Analysis of

80 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

100S1

0S2 Initial values

Page 81: 1. Basic Petri Net Model 2. Properties and Analysis of

81 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

100S1

0S2 Initial values

At time 10 Process A executes

15 S15

Page 82: 1. Basic Petri Net Model 2. Properties and Analysis of

82 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

100S1

0S2 Initial values

At time 10 Process A executes

15 S15

At time 15

5S1

0S2

Processes B and C are ready to execute

Page 83: 1. Basic Petri Net Model 2. Properties and Analysis of

83 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

time 155

S10

S2

Page 84: 1. Basic Petri Net Model 2. Properties and Analysis of

84 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

B executes

15(+δ) S218

time 155

S10

S2

Page 85: 1. Basic Petri Net Model 2. Properties and Analysis of

85 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

B executes

time 155

S10

S2

C executes

15(+δ) S218

Page 86: 1. Basic Petri Net Model 2. Properties and Analysis of

86 of 86Embedded Systems Design Fö 5

An Example

wait on S1. . . . . . . . . . . . . S2<=18. . . . . . . . . . . . .

Process B

wait on Sx. . . . . . . . . . . .S1<= 5 after 5. . . . . . . . . . . .

Process A

. . . . . . . . . . . . wait on S1,S2. . . . . . . . . . . .

Process C

B executes

time 155

S10

S2

C executes

In the following simulation cycle: time 15(+δ)

5S1

18S2

C executes

15(+δ) S218