36

Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Data�ow programming

Generation of software and hardware code

Hervé Yviquel

Directed by E. Casseau1 and M. Raulet2

1IRISA (CAIRN) - University of Rennes 1

2IETR (Image) - INSA of Rennes

28 avril 2011

1 / 31

Page 2: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

2 / 31

Page 3: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Video back then...

3 / 31

Page 4: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

...and now !

1999

2003

Today

1994

4 / 31

Page 5: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Video standards

A lot of innovations in few years

• Redundancy, prede�ned pro�les

• Platform-speci�c reference software5 / 31

Page 6: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Target platforms

Several platforms with di�erent properties :1 Processors

I General-purpose : CPUsI Special-purpose : DSPs, GPUs

2 Programmable logicI FPGA

3 System-On-Chips (SoCs)I Texas Instruments' OMAP

FPGA

6 / 31

Page 7: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Recon�gurable Video Coding

RVC : a new MPEG standard

• Allows recon�guration and reusability

• Provides platform-independent data�ow models

Objective : Shows the validity of the data�ow approach

7 / 31

Page 8: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Recon�gurable Video Coding

RVC : a new MPEG standard

• Allows recon�guration and reusability

• Provides platform-independent data�ow models

Objective : Shows the validity of the data�ow approach

7 / 31

Page 9: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

8 / 31

Page 10: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

9 / 31

Page 11: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

De�nition

AC

B D

E

A directed graph = Network

• Vertex = Processes (Actors)

• Edges = Communication channels (Unidirectional FIFOs)

10 / 31

Page 12: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

Advantages

• No architectural considerations inthe algorithm

I Target can be any platformI Abstraction is preserved

• Explicit parallelismI Between actors on parallel pathsI Pipeline

AC

B D

E

time

A

B

C

A

B

C

A

D

E

D

E

B

C

D

E

...

...

...

...

11 / 31

Page 13: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

12 / 31

Page 14: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

Data�ow Process Networks (DPNs)

Generalization of Kahn Process Networks (KPNs)

• Dynamic data�owI Data Dependant behavior

• Execution of an actor = Sequence of actor �ringsI Data readingI Computational procedureI Data writing

• Unblocking semantic of FIFOs

13 / 31

Page 15: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

Data�ow Process Networks (DPNs)

Generalization of Kahn Process Networks (KPNs)

• Dynamic data�owI Data Dependant behavior

• Execution of an actor = Sequence of actor �ringsI Data readingI Computational procedureI Data writing

• Unblocking semantic of FIFOs

13 / 31

Page 16: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

Data�ow Process Networks (DPNs)

Generalization of Kahn Process Networks (KPNs)

• Dynamic data�owI Data Dependant behavior

• Execution of an actor = Sequence of actor �ringsI Data readingI Computational procedureI Data writing

• Unblocking semantic of FIFOs

13 / 31

Page 17: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

Writing DPN actors

• RVC-CAL : Subset of Cal Actor Language (CAL) [Eker andJanneck, 2003]

actor Clip () int(size=10) I, bool SIGNED ==> int(size=9) OUT :

int(size=7) count := -1; bool sflag;

read_signed: action SIGNED:[s] ==> guard

count < 0 do sflag := s; count := 63; end

limit: action I:[i] ==> OUT:[if i > 255 then 255 else i end] var int min = if sflag then -255 else 0 end do count := count - 1; end

priority read_signed > limit; end

end

14 / 31

Page 18: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

Analysis problems

• Most expressive data�ow modelI Nondeterminism

• Many analysis problems are undecidableI Proof of terminationI Computation of a static scheduling

15 / 31

Page 19: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

PresentationModel of Computation

Finding static behavior

• Classi�cation of actors (SDF, CSDF, etc) [Wipliez and Raulet - DASIP10]

• Merging of actorsI Increase performance (Remove FIFOs)I What conditions ?

16 / 31

Page 20: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

17 / 31

Page 21: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

18 / 31

Page 22: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

Open RVC-CAL Compiler (Orcc 1)

1. Orcc is available at http ://orcc.sf.net19 / 31

Page 23: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

20 / 31

Page 24: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

VHDL backend

• Natural implementation (1 actor = 1 entity)

• Not �nished but validate on subnetworks of MPEG-4 SP(IDCT2D)

[Siret and Nezan - DASIP10]

21 / 31

Page 25: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

22 / 31

Page 26: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

Scheduling on Software platform

AC

B D

E

Core1

Core2

Number of processor cores < Number of actors

• Run-time scheduling

• User-level scheduler (No need of threads)

• Dynamic scheduling strategies (round-robin, ...)

23 / 31

Page 27: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

Results from C backend

• MPEG-4 Simple Pro�le = 42 actors

• MPEG-4 Advanced Video Coding = 131 actors

Decoder Core QCIF CIF 720p Speedup

MPEG-4 SP 1 - 144 15.6 1

2 - 265 26.6 1.78

4 - 516 51.9 3.28

MPEG-4 AVC 1 169 40.6 - 1

2 294 71.4 - 1.74

4 473 97.1 - 2.59

24 / 31

Page 28: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

Limitation of static compilation

• No recon�guration and reusability

• Loosing platform-independent model

Compilation infrastructure

Source code (C, C++)

1010101…

Customer

25 / 31

Page 29: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Compilation frameworkHardware backendSoftware backends

Dynamic recon�guration

• JIT compilerI Recon�guration

• Virtual machineI Keep platform-independent model

Customers

Virtual Machine

Configuration engine

Transmission

Coded video

Configuration

(Network)

$

(bytecode)

$

(Actors)

MPEG-RVC

Video Tool LibraryVideo Tool

Library

[Gorin, Wipliez, Raulet, etc - SiPS10]

26 / 31

Page 30: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

1 Introduction

2 Data�ow programmingPresentationModel of Computation

3 Code generationCompilation frameworkHardware backendSoftware backends

4 Conclusion

27 / 31

Page 31: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Summary

Data�ow programming

• can target software and hardware platform

• shows encouraging performances

• scales up well on multicore architectureI Thanks to explicit parallelism

• permits recon�guration and reuseability

28 / 31

Page 32: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Perspectives

• Improve performancesI Find policy to merge static actorsI Faster scheduler (dynamic mapping)

• Target recon�gurable architectures

• etc.

29 / 31

Page 33: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Perspectives

• Improve performancesI Find policy to merge static actorsI Faster scheduler (dynamic mapping)

• Target recon�gurable architectures

• etc.

29 / 31

Page 34: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

Perspectives

• Improve performancesI Find policy to merge static actorsI Faster scheduler (dynamic mapping)

• Target recon�gurable architectures

• etc.

29 / 31

Page 35: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

30 / 31

Page 36: Data ow programming Generation of software and hardware codecompilfr.ens-lyon.fr/wp-content/uploads/2011/04/Yviquel.pdf · Introduction Data ow rogrammingp Code generation Conclusion

IntroductionData�ow programming

Code generationConclusion

31 / 31