A Fast Heuristic Scheduling Algorithm for Periodic ConcurrenC Models

Size: px
Start display at page:

Download "A Fast Heuristic Scheduling Algorithm for Periodic ConcurrenC Models"

Transcription

1 A Fst Heuristi Sheduling Algorithm for Periodi ConurrenC Models Weiwei Chen nd Riner Doemer Center for Emedded Computer Systems University of Cliforni, Irvine

2 Outline Introdution nd Relted Work ConurrenC Model Simultion Periodi ConurrenC Sheduling Sheduling of SDF-like Models Sheduling of Periodi ConurrenC Models Experiment Results Conlusion nd Future Work 0/9/00 () 009 W. Chen nd R. Doemer

3 Introdution Emedded systems re modeled nd desried t different levels of strtion. System-level Desription Lnguges (SLDLs), like SystemC nd SpeC re used for modeling nd verifition, nd re simulted y disrete event (DE) simultion mehnism. C-sed SLDLs re well-defined, ut Modeling is not. How to write good model? Modeling guidelines re needed. Simultion speed is not fst for DE-sed single-thred kernels. Soure: Soure: Soure: P. Chou, UCI Soure: 0/9/00 () 009 W. Chen nd R. Doemer 3

4 ConurrenC MoC ConurrenC, new model of omputtion (MoC) ws proposed to emphsize the importne of the modeling. A speifi suset, lled periodi ConurrenC, n e sttilly sheduled to improve the simultion speed. MoCs Astrtion SpeC Models ConurrenC user defined hnnels SystemC Models MoCs Desriptive Cpility SLDLs SpeC Wit 0ns nd e SystemC SLDLs Reltionship etween ConurrenC nd C-sed C SLDLs 0/9/00 () 009 W. Chen nd R. Doemer 4

5 Relted Work System-level Desription Lnguges SystemC [T.Grotker 00] SpeC[D.D.Gjski 000] Disrete Event (DE) simultion [N.Svoiu 00] [J.Zhu 00] Model of Computtion Khn Proess Network (KPN) [G. Khn 974] Synhronous Dtflow (SDF) [E.A.Lee 987] Cylo-stti Dtflow (CSDF) [G.Bilsen 995] ConurrenC [W.Chen, R.Doemer, 009] Stti Sheduling SDF [E.A.Lee 987], CSDF [G.Bilsen 994] Builds n inidene mtrix of the onneted model grph Solves lne eqution to get repetition vetors, nd periodi dmissile sequentil shedule (PASS) Model simultion in SLDL y modifying the simultion kernel [H.Ptel 004, 005] Anlysis tool SDF3 for throughput, storge pity, nd uffer size minimiztion(np-omplete [S.S.Btthryy 996]) [S.Stuijk 006, 008] 0/9/00 () 009 W. Chen nd R. Doemer 5

6 ConurrenC Model Simultion Simultion Strtegy 0/9/00 Periodi ConurrenC Model Not input dependent, KPN-like, Periodilly Shedulle stti shedulle optimized implementtion Otherwise Generi SLDL implementtion, DE simulted Non-Periodi ConurrenC Model Generi SLDL implementtion, DE simulted () 009 W. Chen nd R. Doemer 6

7 ConurrenC Exmples h h A SDF-like ConurrenC exmple 0/9/00 () 009 W. Chen nd R. Doemer 7

8 ConurrenC Exmples h h A SDF-like ConurrenC exmple 0/9/00 () 009 W. Chen nd R. Doemer 8

9 ConurrenC Exmples h h A SDF-like ConurrenC exmple 0/9/00 () 009 W. Chen nd R. Doemer 9

10 ConurrenC Exmples h h A SDF-like ConurrenC exmple The Periodi Admissile Sequentil Shedule (PASS) is:,,, 0/9/00 () 009 W. Chen nd R. Doemer 0

11 Optimiztion for Fst Simultion Optimized SpeC desription for the SDF-like model ehvior Min(void) { _int_queue h0(ul), h(ul), h(ul); _(h0, h); _(h0, h); _(h, h); ehvior Min(void) { _int_queue h0(ul), h(ul), h(ul); _seq _(h0, h); _seq _(h0, h); _seq _(h, h); int min(int rg, hr** rgv) { pr { _.min(); _.min(); _.min(); } return 0; } }; thred 0 thred thred thred 3 }; int min(int rg, hr** rgv) { while() { _.min(); _.min(); _.min(); _.min(); } return 0; } thred 0 PASS is (,,, ) SpeC desription for the SDF-like model 0/9/00 () 009 W. Chen nd R. Doemer

12 Sheduling Algorithm for SDF-like Models strt Sn eh proess. If the proess hs initiliztion prt, run it (put it into the sheduling history stk) Count = Y Get the ndidte Proesses set to e sheduled. P = {p there re enough tokens in the hnnels p is witing for.} Count ++ N Finding periodi sheduling order filed stop Seprte P into two sets, Pe nd Pne, where Pe = {p p is in P, p does not produe ny token.} Pne = {p p is in P, ut p is not in Pe.} Get the set Pm Pm = {p p is in Pne, nd the numer of the tokens stored in the input hnnel is the gretest. } Selet the first p from Pm. Y N Get one p from Pe. Shedule p, push p into the sheduling history, updte the Token list, remove p from Pe. Store the Token list into the sttus history hshing tle. Shedule p, push p into the sheduling history stk, updte the lists, Store the Token list into the sttus history hshing tle. N Y Get the periodi sheduling order 0/9/00 () 009 W. Chen nd R. Doemer Y stop N

13 SDF-like Model Sheduling Exmple h h List of the numer of tokens in eh hnnel (Token[h]) List of the hnnels tht eh proess is witing for (the numer of tokens required) hwit[pro][h] 0/9/00 () 009 W. Chen nd R. Doemer 3

14 SDF-like Model Sheduling Exmple h h h STEP 0 h List of the numer of tokens in eh hnnel (Token[h]) List of the hnnels tht eh proess is witing for (the numer of tokens required) hwit[pro][h] 0/9/00 () 009 W. Chen nd R. Doemer 4

15 SDF-like Model Sheduling Exmple h h h h h STEP 0 STEP h List of the numer of tokens in eh hnnel (Token[h]) List of the hnnels tht eh proess is witing for (the numer of tokens required) hwit[pro][h] 0/9/00 () 009 W. Chen nd R. Doemer 5

16 SDF-like Model Sheduling Exmple h h h h h h STEP 0 STEP STEP h h List of the numer of tokens in eh hnnel (Token[h]) List of the hnnels tht eh proess is witing for (the numer of tokens required) hwit[pro][h] 0/9/00 () 009 W. Chen nd R. Doemer 6

17 SDF-like Model Sheduling Exmple h h h h h h STEP 0 STEP STEP h h h STEP 3 h List of the numer of tokens in eh hnnel (Token[h]) List of the hnnels tht eh proess is witing for (the numer of tokens required) hwit[pro][h] 0/9/00 () 009 W. Chen nd R. Doemer 7

18 SDF-like Model Sheduling Exmple h h h h h h h h STEP 0 STEP STEP h STEP 4 h h STEP 3 h List of the numer of tokens in eh hnnel (Token[h]) PASS List of the hnnels tht eh proess is witing for (the numer of tokens required) hwit[pro][h] 0/9/00 () 009 W. Chen nd R. Doemer 8

19 Periodi ConurrenC Exmple [,0] [0,] f Y Z [,] [,] [,] h(0) [,] T X h() [,] [,] T g [,0] [0,] KPN-like ConurrenC exmple tht qulifies s CSDF-like 0/9/00 () 009 W. Chen nd R. Doemer 9

20 Sheduling of Periodi ConurrenC Models Additionl Dt Struture (for hnnel predition) Internl stte of eh proess (lol ontrol vriles). quired dynmilly when sheduling Witing hnnel list for eh proess nd the numer of input tokens for eh proess for eh itertion. quired dynmilly when sheduling Code Sliing REPLACE: reple hnnel send / reeive with Token[P] list updting (in _t()) nd hwit[n][p] prediting (in _h()). REMOVE: () the loop sttement, e.g. while(); () sttements deling with the dt vriles. KEEP: sttements deling with the stte vriles (in _t()) nd mke these vriles stti to the funtionl lok. 0/9/00 () 009 W. Chen nd R. Doemer 0

21 Code Sliing Exmple Slied desription ode for the KPN-like model SpeC desription for the KPN-like model 0/9/00 () 009 W. Chen nd R. Doemer

22 Periodi ConurrenC Model Sheduling Exmple STEP 3 STEP 0 STEP STEP STEP 6 STEP 5 STEP 4 List of the numer of tokens in eh hnnel. Token[h] f g h(0) f g h() PASS List of the hnnels tht eh proess is witing for. hwit[pro][h] (the numer of tokens required for eh itertion) Internl ondition vriles 0/9/00 () 009 W. Chen nd R. Doemer

23 Experiment Results Stti Sheduling Algorithm Performne Heuristi stti sheduling lgorithm Optimized heuristi stti sheduling lgorithm (sttus omprisons re redued) sdf3 sheduling lgorithm Simultion speed of the models omprison is mde etween generi DE implementtion nd stti sheduled implementtion. 0/9/00 () 009 W. Chen nd R. Doemer 3

24 Experiment Results 0/9/00 () 009 W. Chen nd R. Doemer 4

25 Experiment Results 0/9/00 () 009 W. Chen nd R. Doemer 5

26 Experiment Results 0/9/00 () 009 W. Chen nd R. Doemer 6

27 Experiment Results 0/9/00 () 009 W. Chen nd R. Doemer 7

28 Conlusion nd Future Work Conlusion A new heuristi sheduling lgorithm of periodi ConurrenC models re disussed. The lgorithm hieves speedup thn lssi mtrix-sed lgorithms nd n hndle lrge models whih nnot e hndled y the previous lgorithm in resonle time. Stti Sheduling helps to improve the simultion speed of periodi ConurrenC models. Future work Support for timing informtion in ConurrenC loks. Extend this sheduling strtegy into distriuted simultion environment. 0/9/00 () 009 W. Chen nd R. Doemer 8

29 kups 0/9/00 () 009 W. Chen nd R. Doemer 9

30 Algorithm Performne Optimiztion Min ide: Redue the time of sttus omprison. length of PASS is l, PASS is found t ith sheduling step Numer of omprisons without optimiztion: i(i-)/ ith l 0/9/00 () 009 W. Chen nd R. Doemer 30

31 Algorithm Performne Optimiztion Min ide: Redue the time of sttus omprison. length of PASS is l, PASS is found t ith sheduling step Numer of omprisons without optimiztion: i(i-)/ ith l Compre every N steps, PASS is found t tnth sheduling step (tn >= i), the length of PASS is still l (proved in the pper). Numer of omprisons without optimiztion: t(t-)n/ Speedup for omprison is lmost N. ith N l 0/9/00 () 009 W. Chen nd R. Doemer 3