Modeling of Time in Discrete-Event Simulation of Systems-on-Chip - - PowerPoint PPT Presentation

modeling of time in discrete event simulation of systems
SMART_READER_LITE
LIVE PREVIEW

Modeling of Time in Discrete-Event Simulation of Systems-on-Chip - - PowerPoint PPT Presentation

jTLM Duration Applications Implementation Conclusion Modeling of Time in Discrete-Event Simulation of Systems-on-Chip Giovanni Funchal 1 , 2 and Matthieu Moy 1 1 Verimag (Grenoble INP) Grenoble, France 2 STMicroelectronics Grenoble, France


slide-1
SLIDE 1

jTLM Duration Applications Implementation Conclusion

Modeling of Time in Discrete-Event Simulation of Systems-on-Chip

Giovanni Funchal1,2 and Matthieu Moy1

1Verimag (Grenoble INP)

Grenoble, France

2STMicroelectronics

Grenoble, France Work partially supported by HELP ANR project

MEMOCODE, July 2011

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 1 / 22 >

slide-2
SLIDE 2

jTLM Duration Applications Implementation Conclusion

Outline

1

Transaction Level Modeling and jTLM

2

Time and Duration in jTLM

3

Applications

4

Implementation

5

Conclusion

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 2 / 22 >

slide-3
SLIDE 3

jTLM Duration Applications Implementation Conclusion

Outline

1

Transaction Level Modeling and jTLM

2

Time and Duration in jTLM

3

Applications

4

Implementation

5

Conclusion

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 3 / 22 >

slide-4
SLIDE 4

jTLM Duration Applications Implementation Conclusion

Modern Systems-on-a-Chip

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 4 / 22 >

slide-5
SLIDE 5

jTLM Duration Applications Implementation Conclusion

Modern Systems-on-a-Chip

Software Hardware

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 4 / 22 >

slide-6
SLIDE 6

jTLM Duration Applications Implementation Conclusion

Transaction-Level Modeling

(Fast) simulation essential in the design-flow

◮ To write/debug software ◮ To validate architectural choices ◮ As reference for hardware verification Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 5 / 22 >

slide-7
SLIDE 7

jTLM Duration Applications Implementation Conclusion

Transaction-Level Modeling

(Fast) simulation essential in the design-flow

◮ To write/debug software ◮ To validate architectural choices ◮ As reference for hardware verification

Transaction-Level Modeling (TLM):

◮ High level of abstraction ◮ Suitable for Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 5 / 22 >

slide-8
SLIDE 8

jTLM Duration Applications Implementation Conclusion

Transaction-Level Modeling

(Fast) simulation essential in the design-flow

◮ To write/debug software ◮ To validate architectural choices ◮ As reference for hardware verification

Transaction-Level Modeling (TLM):

◮ High level of abstraction ◮ Suitable for

Industry Standard = SystemC/TLM

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 5 / 22 >

slide-9
SLIDE 9

jTLM Duration Applications Implementation Conclusion

SystemC/TLM vs. “TLM Abstraction Level” SystemC TLM

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 6 / 22 >

slide-10
SLIDE 10

jTLM Duration Applications Implementation Conclusion

SystemC/TLM vs. “TLM Abstraction Level” SystemC TLM

Cycle accurate RTL Gate level TLM 2.0

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 6 / 22 >

slide-11
SLIDE 11

jTLM Duration Applications Implementation Conclusion

SystemC/TLM vs. “TLM Abstraction Level” SystemC TLM

Cycle accurate RTL Gate level TLM 2.0

?

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 6 / 22 >

slide-12
SLIDE 12

jTLM Duration Applications Implementation Conclusion

SystemC/TLM vs. “TLM Abstraction Level” SystemC TLM

Cycle accurate RTL Gate level TLM 2.0

?

δ-cycle Coroutine semantics Function calls Parallelism Clocks

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 6 / 22 >

slide-13
SLIDE 13

jTLM Duration Applications Implementation Conclusion

SystemC/TLM vs. “TLM Abstraction Level” SystemC TLM

Cycle accurate RTL Gate level TLM 2.0

?

δ-cycle Coroutine semantics Function calls Parallelism Clocks jTLM = this talk

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 6 / 22 >

slide-14
SLIDE 14

jTLM Duration Applications Implementation Conclusion

jTLM: goals and peculiarities

jTLM’s goal: define “TLM” independently of SystemC

◮ Not cooperative (true parallelism) ◮ Not C++ (Java) ◮ No δ-cycle

Interesting features

◮ Small and simple code (≈ 500 LOC) ◮ Nice experimentation platform

Not meant for production

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 7 / 22 >

slide-15
SLIDE 15

jTLM Duration Applications Implementation Conclusion

Outline

1

Transaction Level Modeling and jTLM

2

Time and Duration in jTLM

3

Applications

4

Implementation

5

Conclusion

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 8 / 22 >

slide-16
SLIDE 16

jTLM Duration Applications Implementation Conclusion

Simulation Time Vs Wall-Clock Time

Simulation time

10 20 30 40

Wall-clock time Time elapse Computation

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 9 / 22 >

slide-17
SLIDE 17

jTLM Duration Applications Implementation Conclusion

Time in SystemC and jTLM

SystemC jTLM A B P Q

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 10 / 22 >

slide-18
SLIDE 18

jTLM Duration Applications Implementation Conclusion

Time in SystemC and jTLM

SystemC jTLM A B P Q Process A: // computation f(); // time taken by f wait(20, SC_NS);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 10 / 22 >

slide-19
SLIDE 19

jTLM Duration Applications Implementation Conclusion

Time in SystemC and jTLM

SystemC jTLM A B P Q Process A: // computation f(); // time taken by f wait(20, SC_NS); f() wait(20)

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 10 / 22 >

slide-20
SLIDE 20

jTLM Duration Applications Implementation Conclusion

Time in SystemC and jTLM

SystemC jTLM A B P Q Process A: // computation f(); // time taken by f wait(20, SC_NS); f() wait(20) Process P: g(); awaitTime(20); g() awaitTime

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 10 / 22 >

slide-21
SLIDE 21

jTLM Duration Applications Implementation Conclusion

Time in SystemC and jTLM

SystemC jTLM A B P Q Process A: // computation f(); // time taken by f wait(20, SC_NS); f() wait(20) Process P: g(); awaitTime(20); consumesTime(15) { h(); } g() awaitTime h()

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 10 / 22 >

slide-22
SLIDE 22

jTLM Duration Applications Implementation Conclusion

Time in SystemC and jTLM

SystemC jTLM A B P Q Process A: // computation f(); // time taken by f wait(20, SC_NS); f() wait(20) Process P: g(); awaitTime(20); consumesTime(15) { h(); } g() awaitTime h() i() j()

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 10 / 22 >

slide-23
SLIDE 23

jTLM Duration Applications Implementation Conclusion

Time à la SystemC: awaitTime(T)

By default, time does not pass ⇒ instantaneous tasks awaitTime(T) : let other processes execute for T time units Simulation time

10 20 30 40

Wall-clock time Time elapse Computation f(); // instantaneous awaitTime(20);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 11 / 22 >

slide-24
SLIDE 24

jTLM Duration Applications Implementation Conclusion

Task with Known Duration: consumesTime(T)

Semantics:

◮ Start and end dates known ◮ Actions contained in task spread in

between

Advantages:

◮ Model closer to actual system ◮ Less bugs hidden ◮ Better parallelization

consumesTime(15) { f1(); f2(); f3(); } consumesTime(10) { g(); }

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 12 / 22 >

slide-25
SLIDE 25

jTLM Duration Applications Implementation Conclusion

Execution of consumesTime(T)

Slow computation

Simulation time

10 20 30 40

Wall-clock time Task starts Simulation time blocked Task finishes

Fast computation

Simulation time

10 20 30 40

Wall-clock time Task starts Computation ends Task finishes Rest of the platform drives time idle

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 13 / 22 >

slide-26
SLIDE 26

jTLM Duration Applications Implementation Conclusion

Outline

1

Transaction Level Modeling and jTLM

2

Time and Duration in jTLM

3

Applications

4

Implementation

5

Conclusion

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 14 / 22 >

slide-27
SLIDE 27

jTLM Duration Applications Implementation Conclusion

Exposing Bugs

Example bug: mis-placed synchronization: flag = true; awaitTime(5); writeIMG(); awaitTime(10); || while(!flag) awaitTime(1); awaitTime(10); readIMG(); ⇒ bug never seen in simulation

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 15 / 22 >

slide-28
SLIDE 28

jTLM Duration Applications Implementation Conclusion

Exposing Bugs

Example bug: mis-placed synchronization: flag = true; awaitTime(5); writeIMG(); awaitTime(10); || while(!flag) awaitTime(1); awaitTime(10); readIMG(); ⇒ bug never seen in simulation consumesTime(15) { flag = true; writeIMG(); } || while(!flag) awaitTime(1); awaitTime(10); readIMG(); ⇒ strictly more behaviors, including the buggy one

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 15 / 22 >

slide-29
SLIDE 29

jTLM Duration Applications Implementation Conclusion

Parallelization

P1 P2 P3 P4 jTLM’s Semantics Simultaneous tasks run in parallel

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 16 / 22 >

slide-30
SLIDE 30

jTLM Duration Applications Implementation Conclusion

Parallelization

P1 P2 P3 P4 jTLM’s Semantics Simultaneous tasks run in parallel Non-simultaneous tasks don’t

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 16 / 22 >

slide-31
SLIDE 31

jTLM Duration Applications Implementation Conclusion

Parallelization

P1 P2 P3 P4 jTLM’s Semantics Simultaneous tasks run in parallel Non-simultaneous tasks don’t Overlapping tasks do

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 16 / 22 >

slide-32
SLIDE 32

jTLM Duration Applications Implementation Conclusion

Parallelization

P1 P2 P3 P4 jTLM’s Semantics Simultaneous tasks run in parallel Non-simultaneous tasks don’t Overlapping tasks do Back to SystemC:

◮ Parallelizing within δ-cycle = great if you have clocks ◮ Simulation time is the bottleneck with quantitative/fuzzy time Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 16 / 22 >

slide-33
SLIDE 33

jTLM Duration Applications Implementation Conclusion

Outline

1

Transaction Level Modeling and jTLM

2

Time and Duration in jTLM

3

Applications

4

Implementation

5

Conclusion

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 17 / 22 >

slide-34
SLIDE 34

jTLM Duration Applications Implementation Conclusion

Time Queue and awaitTime(T)

Current instant P , Q, R Process P: f(); awaitTime(50); Process Q: h(); awaitTime(30); g(); awaitTime(30); Process R: i(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 18 / 22 >

slide-35
SLIDE 35

jTLM Duration Applications Implementation Conclusion

Time Queue and awaitTime(T)

Current instant Q, R awaitTime(50) P Process P: f(); awaitTime(50); Process Q: h(); awaitTime(30); g(); awaitTime(30); Process R: i(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 18 / 22 >

slide-36
SLIDE 36

jTLM Duration Applications Implementation Conclusion

Time Queue and awaitTime(T)

Current instant R P awaitTime(30) Q Process P: f(); awaitTime(50); Process Q: h(); awaitTime(30); g(); awaitTime(30); Process R: i(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 18 / 22 >

slide-37
SLIDE 37

jTLM Duration Applications Implementation Conclusion

Time Queue and awaitTime(T)

Current instant P Q awaitTime(90) R Process P: f(); awaitTime(50); Process Q: h(); awaitTime(30); g(); awaitTime(30); Process R: i(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 18 / 22 >

slide-38
SLIDE 38

jTLM Duration Applications Implementation Conclusion

Time Queue and awaitTime(T)

Current instant P Q R Time Elapse Process P: f(); awaitTime(50); Process Q: h(); awaitTime(30); g(); awaitTime(30); Process R: i(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 18 / 22 >

slide-39
SLIDE 39

jTLM Duration Applications Implementation Conclusion

Time Queue and awaitTime(T)

P Q R Current instant Process P: f(); awaitTime(50); Process Q: h(); awaitTime(30); g(); awaitTime(30); Process R: i(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 18 / 22 >

slide-40
SLIDE 40

jTLM Duration Applications Implementation Conclusion

Time Queue and awaitTime(T)

P R Current instant awaitTime(30) Q Process P: f(); awaitTime(50); Process Q: h(); awaitTime(30); g(); awaitTime(30); Process R: i(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 18 / 22 >

slide-41
SLIDE 41

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

What about consumesTime(T) ?

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 19 / 22 >

slide-42
SLIDE 42

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

Current instant P , Q, R

Process P: f(); consumesTime(50){ g(); } h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){ k(); } Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-43
SLIDE 43

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

Current instant Q, R consumesTime(50) P

Process P: f(); consumesTime(50){ g(); } h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){ k(); } Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-44
SLIDE 44

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

Current instant Q, R P

Process P: f(); consumesTime(50){

  • g();

} h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){ k(); } Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-45
SLIDE 45

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

Current instant R P awaitTime(30) Q

Process P: f(); consumesTime(50){

  • g();

} h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){ k(); } Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-46
SLIDE 46

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

Current instant P Q awaitTime(90) R

Process P: f(); consumesTime(50){

  • g();

} h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){ k(); } Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-47
SLIDE 47

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

Current instant P Q R Time Elapse

Process P: f(); consumesTime(50){

  • g();

} h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){ k(); } Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-48
SLIDE 48

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

P Q R Current instant

Process P: f(); consumesTime(50){

  • g();

} h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){ k(); } Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-49
SLIDE 49

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

P R Current instant consumesTime(30) Q

Process P: f(); consumesTime(50){

  • g();

} h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){ k(); } Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-50
SLIDE 50

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

P R Current instant Q

Process P: f(); consumesTime(50){

  • g();

} h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){

  • k();

} Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-51
SLIDE 51

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

P R Current instant Q Time Elapse

Process P: f(); consumesTime(50){ g(); } h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){

  • k();

} Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-52
SLIDE 52

jTLM Duration Applications Implementation Conclusion

Time Queue and consumesTime(T)

P R Q Current instant

Process P: f(); consumesTime(50){ g(); } h(); Process Q: i(); awaitTime(30); j(); consumesTime(30){

  • k();

} Process R: l(); awaitTime(90);

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 20 / 22 >

slide-53
SLIDE 53

jTLM Duration Applications Implementation Conclusion

Outline

1

Transaction Level Modeling and jTLM

2

Time and Duration in jTLM

3

Applications

4

Implementation

5

Conclusion

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 21 / 22 >

slide-54
SLIDE 54

jTLM Duration Applications Implementation Conclusion

Perspectives

Summary

◮ Tasks with duration ◮ Exhibit more behaviors/bugs ◮ Better parallelization

Skipped from the talk (cf. paper)

◮ Tasks with a priori unknown duration ◮ jTLM’s cooperative mode

Perspectives

◮ Adapt the ideas to SystemC (ongoing, not so hard) ◮ Run-time Verification to explore schedules (science-fiction) ◮ Open-Source Release? Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 22 / 22 >

slide-55
SLIDE 55

jTLM Duration Applications Implementation Conclusion

Perspectives

Summary

◮ Tasks with duration ◮ Exhibit more behaviors/bugs ◮ Better parallelization

Skipped from the talk (cf. paper)

◮ Tasks with a priori unknown duration ◮ jTLM’s cooperative mode

Perspectives

◮ Adapt the ideas to SystemC (ongoing, not so hard) ◮ Run-time Verification to explore schedules (science-fiction) ◮ Open-Source Release?

Thank you! Questions?

Matthieu Moy (Verimag) Modeling of Time/jTLM MEMOCODE, July 2011 < 22 / 22 >