automated extraction of scenario sequences from

25

Upload: others

Post on 25-Nov-2021

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automated Extraction of Scenario Sequences from

Where innovation starts

Automated Extraction of Scenario Sequencesfrom Disciplined Data�ow Networks

Firew Siyoum1, Marc Geilen1, Johan Eker2,Carl von Platen3 and Henk Corporaal1

October 18, 2013

1Eindhoven University of Technology, The Netherlands2Ericsson, Lund, Sweden3ARM, Lund, Sweden

MEMOCODE 2013, Portland, Oregon

Page 2: Automated Extraction of Scenario Sequences from

2/17

Embedded Streaming Applications

I Modern multimedia and wireless systems arestream processing applications.

I E.g. audio and video encoders/decoders,WLAN IEEE 802.11x, WCDMA and LTE.

Design-time Analysis

I Analysing deadlock-freedom and bu�er boundedness is crucial.

I They also have real-time temporal constrains such as throughput.

1 2 3 4 ... 8 9 ... 19

7654321

1 Frame (10ms)

(0.5ms)1 Slot1 Sub-Frame

(1ms)

cyclic pre�x

7 OFDM Symbols (short cyclic pre�x)

Figure:LTE frame structure

Page 3: Automated Extraction of Scenario Sequences from

2/17

Embedded Streaming Applications

I Modern multimedia and wireless systems arestream processing applications.

I E.g. audio and video encoders/decoders,WLAN IEEE 802.11x, WCDMA and LTE.

Design-time Analysis

I Analysing deadlock-freedom and bu�er boundedness is crucial.

I They also have real-time temporal constrains such as throughput.

1 2 3 4 ... 8 9 ... 19

7654321

1 Frame (10ms)

(0.5ms)1 Slot1 Sub-Frame

(1ms)

cyclic pre�x

7 OFDM Symbols (short cyclic pre�x)

Figure:LTE frame structure

Page 4: Automated Extraction of Scenario Sequences from

3/17

Analysis Challenge

I Applications are partitioned into a set oftasks that run in parallel on a MPSoC.

Vector Vector

proc. proc.

Filters

WPAGPP

WPA

Codec

AD/DA

RF/IFPeriph.

Shared

memoryPeriph.

Communication network

Vector

proc.C

H

E

B G

I

D

J F

Communicating tasks

I Tasks are data-dependent and state-dependent.

Page 5: Automated Extraction of Scenario Sequences from

4/17

Data�ow Models of Computation

Synchronous Data�ow (SDF)

I consists of actors that communicate tokens through FIFO channels.

I Actors have �xed port rates and execution durations.

2 12

1

1

12

A = {x, y, z}C = {cxx, cxy, cyz, czy}X (x) = 2,X (y) = 3,X (z) = 2

x y z1

I Repetition vector: the number of �rings of each actor that brings thegraph back to its original state. e.g [x , y , z ] = [2, 1, 2]

Limitation of SDF

I is not expressive enough to capture dynamic behavior.

Page 6: Automated Extraction of Scenario Sequences from

4/17

Data�ow Models of Computation

Synchronous Data�ow (SDF)

I consists of actors that communicate tokens through FIFO channels.

I Actors have �xed port rates and execution durations.

2 12

1

1

12

A = {x, y, z}C = {cxx, cxy, cyz, czy}X (x) = 2,X (y) = 3,X (z) = 2

x y z1

I Repetition vector: the number of �rings of each actor that brings thegraph back to its original state. e.g [x , y , z ] = [2, 1, 2]

Limitation of SDF

I is not expressive enough to capture dynamic behavior.

Page 7: Automated Extraction of Scenario Sequences from

5/17

Data�ow Models of Computation

Scenario-aware Data�ow (SADF)

I A scenario is a single mode of operation and is modeled by a SDF.

I A FSM encodes the possible sequences of scenarios.

scenario s1 scenario s2 fsm

bdcba a s1 s2

I a more accurate analysis than SDF. e.g. > 60% in resource saving

Limitation of FSM-SADF

I model construction is challenged by large number of scenarios.

I manual construction is time-consuming and error-prone.

Page 8: Automated Extraction of Scenario Sequences from

5/17

Data�ow Models of Computation

Scenario-aware Data�ow (SADF)

I A scenario is a single mode of operation and is modeled by a SDF.

I A FSM encodes the possible sequences of scenarios.

scenario s1 scenario s2 fsm

bdcba a s1 s2

I a more accurate analysis than SDF. e.g. > 60% in resource saving

Limitation of FSM-SADF

I model construction is challenged by large number of scenarios.

I manual construction is time-consuming and error-prone.

Page 9: Automated Extraction of Scenario Sequences from

6/17

We propose

Disciplined Data�ow Network

I is a network of actors that communicate through FIFO connections.

I is de�nes certain construction rules for parallel data�ow programs.

αd2αd

1

SSR1 SSR2

αk5αk

4

kernel actors

detector actorsdata channels

control channels

αk2 αk

3αk1

Objectives of DDN

1. automatically test if a data�ow program complies with these rules

2. automatically extract a FSM-based SADF model if it complies

Page 10: Automated Extraction of Scenario Sequences from

6/17

We propose

Disciplined Data�ow Network

I is a network of actors that communicate through FIFO connections.

I is de�nes certain construction rules for parallel data�ow programs.

αd2αd

1

SSR1 SSR2

αk5αk

4

kernel actors

detector actorsdata channels

control channels

αk2 αk

3αk1

Objectives of DDN

1. automatically test if a data�ow program complies with these rules

2. automatically extract a FSM-based SADF model if it complies

Page 11: Automated Extraction of Scenario Sequences from

7/17

We propose

Disciplined Data�ow Network

I de�nes rules that restrict state and data dependencies of actors.

I is constructed from two types of actors: detectors and kernels.

αd2αd

1

SSR1 SSR2

αk5αk

4

kernel actors

detector actorsdata channels

control channels

αk2 αk

3αk1

I Detectors are controllers and kernels are followers.

I A detector can control multiple kernels.

I A kernel is controlled by at most one detector.

I A detector and the set of kernels it controls form a SSR.

Page 12: Automated Extraction of Scenario Sequences from

8/17

Kernel Actor

I has a set of �rings and each �ring has a DDN �ring rule.• DDN �ring rules are integer constraints.• DDN �ring rules are complete.

I Completeness guarantees termination-free execution.

actor ExampleKernel ()InputPort i, jOutputPort o

Firing 1: if (i > 2 and j < 5) // firing rule 1doSomething ...

Firing 2: if (i <= 2 and 5 <= j < 10) // firing rule 2doAnotherThing ...

Firing 3: if (j >= 10) // firing rule 3doNothing ...

end

Page 13: Automated Extraction of Scenario Sequences from

9/17

Detector Actor

I Firing rules do not have to be DDN �ring rules.

I Output tokens are of type integer and take values from a �nite set.

I Each �ring produces a set of control tokens.

actor ExampleDetector ()InputPort i,OutputPort o

Firing 1: if foo(i) > 0 // produce control token 0doSomething ...writeToOutputPort (0)

Firing 2: if i > 0 // produce control tokens 1 to 5doAnotherThing ...x := pick from 1 to 5writeToOutputPort(x)

end

Page 14: Automated Extraction of Scenario Sequences from

10/17

Scenario Extraction

Scenario con�guration

I A single �ring of a detector de�nes a scenario of the SSR.

I Thus, a tuple of �rings, one from each detector of the DDN,determines a scenario of the whole network.

I such a tuple is called a scenario con�guration.

Page 15: Automated Extraction of Scenario Sequences from

11/17

Scenario Sequence Extraction

Con�guration-space Exploration

I Extracting con�gurations using the Cartesian product is pessimistic.

I We extract scenario con�gurations more accurately from local FSMsof detectors, through con�guration-space exploration.

fd11 fd1

2 fd13

fd23fd2

2 fd21

f3, f1f1, f2

f1, f1

f2, f2 f2, f3

f3, f2 f2, f1 f3, f3

f1, f3

Complete Space

f1,−

f3, f2 f3, f3

f2, f1

Simpli�ed Space

Page 16: Automated Extraction of Scenario Sequences from

11/17

Scenario Sequence Extraction

Con�guration-space Exploration

I Extracting con�gurations using the Cartesian product is pessimistic.

I We extract scenario con�gurations more accurately from local FSMsof detectors, through con�guration-space exploration.

fd11 fd1

2 fd13

fd23fd2

2 fd21

f3, f1f1, f2

f1, f1

f2, f2 f2, f3

f3, f2 f2, f1 f3, f3

f1, f3

Complete Space

f1,−

f3, f2 f3, f3

f2, f1

Simpli�ed Space

Page 17: Automated Extraction of Scenario Sequences from

11/17

Scenario Sequence Extraction

Con�guration-space Exploration

I Extracting con�gurations using the Cartesian product is pessimistic.

I We extract scenario con�gurations more accurately from local FSMsof detectors, through con�guration-space exploration.

fd11 fd1

2 fd13

fd23fd2

2 fd21

f3, f1f1, f2

f1, f1

f2, f2 f2, f3

f3, f2 f2, f1 f3, f3

f1, f3

Complete Space

f1,−

f3, f2 f3, f3

f2, f1

Simpli�ed Space

Page 18: Automated Extraction of Scenario Sequences from

12/17

Case-study

Extraction framework

I The approach is demonstrated for the CAL actor language.

I CAL is employed by the ISO/IEC standardization for theRecon�gurable Video Coding (RVC) MPEG standard.

C code generation

CAL2C

ParallelProgramDDN in CAL

Compiler frontend

CAL IR generation

Model Constructor

FSM-SADF extraction

FSM-SADF

Bound-T

Profiling WCET

SDF3

Dataflow Analysis

CAL IR C code

Page 19: Automated Extraction of Scenario Sequences from

13/17

Case-study

WLAN 802.11a Baseband Processing

firing schedule of mc

f4

f3

f2

switch

sync

hdec select

mc

shift

crc

replicat.

data channel

static kerneldetector

dynamic kernel

control channel

connection point

source

tunnel2pdecpdemtunnel1

hdem

f1

source switch sync

selectreplic.mc

shift

Extracted WLAN Scenario

Ψ(q0) = s1

q1

q3

q2

q0

Ψ(q3) = s4

Ψ(q2) = s3

Ψ(q1) = s2

Extracted FSM

Page 20: Automated Extraction of Scenario Sequences from

14/17

Case-study

RVC-MPEG4 SP Video Decoder

Page 21: Automated Extraction of Scenario Sequences from

15/17

Case-study

RVC-MPEG4 SP Video Decoder

invscan

AC

invpred

dtcr1

IQ

invscan

AC

invpred

IQ

invscan

AC

invpred

IQ

DCaddr invpred

DC

DCdtcr2

btype

value

spliteractors

mv

qp

IDCT

MC

merger

split

DCaddr invpred

DC

splitDC

dtcr2

IDCT

MC

DCaddr invpred

DC

splitDC

dtcr2

IDCT

MC

Extracted Scenario

splitter

splitter polate

inter−

dtcr1

mvrecn

IDCTinvpred

DC

DC

DC

split

ACadd

qp

splitter

3

63

63

64

64

64

64

64

3

mvseq

merger

invscan

fbIQ

dtcr2

2

64

22

2

64

63 63

64

6464

64 64

8181

addr

splitter

420b

mv

btype

invpred

63 63

64

Page 22: Automated Extraction of Scenario Sequences from

16/17

Case-study

Analysis

I Deadlock-freedom and boundedness: each scenario sequence

I Timing Analysis: we mapped the extracted scenarios onto amulti-core platform model and analysed the worst-case throughputs.

Page 23: Automated Extraction of Scenario Sequences from

17/17

Conclusions

Disciplined Data�ow Networks

I is an analysable programming model for dynamic streamingapplications.1. guarantees a scenario-based analysis model can always be constructed.2. guarantees the process of constructing the model can be automated.

I Caltoopia - http://www.github.com/caltoopia

I SDF3 - http://www.es.ele.tue.nl/sdf3

I Analysis - Worst-case throughput analysis of dynamic streaming applications, inproc. CODES+ISSS 2012

Thank you!

Questions?

Page 24: Automated Extraction of Scenario Sequences from

17/17

Conclusions

Disciplined Data�ow Networks

I is an analysable programming model for dynamic streamingapplications.1. guarantees a scenario-based analysis model can always be constructed.2. guarantees the process of constructing the model can be automated.

I Caltoopia - http://www.github.com/caltoopia

I SDF3 - http://www.es.ele.tue.nl/sdf3

I Analysis - Worst-case throughput analysis of dynamic streaming applications, inproc. CODES+ISSS 2012

Thank you!

Questions?

Page 25: Automated Extraction of Scenario Sequences from

17/17

Conclusions

Disciplined Data�ow Networks

I is an analysable programming model for dynamic streamingapplications.1. guarantees a scenario-based analysis model can always be constructed.2. guarantees the process of constructing the model can be automated.

I Caltoopia - http://www.github.com/caltoopia

I SDF3 - http://www.es.ele.tue.nl/sdf3

I Analysis - Worst-case throughput analysis of dynamic streaming applications, inproc. CODES+ISSS 2012

Thank you!

Questions?