


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The modulo scheduling ii technique used in computer science for processor scheduling. It covers the use of list scheduling, priority function, and loop prolog and epilog. The document also explains how to calculate the scheduling window and the height of nodes in a dependence graph.
Typology: Study notes
1 / 34
This page cannot be seen from the preview
Don't miss anything!



























1.^ Insert pseudo edges from all nodes to branch withlatency = 0, distance = 0 (dotted edges)2.^ Compute II, For this example assume II = 23.^ HeightR(4) =4.^ HeightR(3) = 5.^ HeightR(2) = 6.^ HeightR(1)
0,0 0,0^ 2,0 0,
0, if X is not scheduledMAX (0, SchedTime(X) + EffDelay(X,Y)),
otherwise
With cyclic scheduling, not all the predecessors may be scheduled,so a more flexible earliest schedule time
is: MAX for all X = pred(Y) where EffDelay(X,Y) = Delay(X,Y) – II*Distance(X,Y) Every II cycles a new loop iteration will be initialized, thus every IIcycles the pattern will repeat. Thus, you only have to look in awindow of size II, if the operation cannot be scheduled there, thenit cannot be scheduled.^ Latest schedule time(Y) = L(Y) = E(Y) + II – 1
C0 A B C^ D Bn Cn-1^ Dn-2Cn^ Dn-1Dn
Loop bodywith 4 ops
Prolog -fill thepipe^ Kernel^ Epilog -drain thepipe
Generate special code before the loop (preheader) to fill the pipeand special code after the loop to drain the pipe.Peel off II-1 iterations for the prolog. Complete II-1 iterationsin epilog
Prolog
II = 3 Kernel Epilog
Disable usingpredicated execution Execute loop kernel on every iteration, but for prolog and epilogselectively disable the appropriate operations to fill/drain the pipeline
^ This occurs for prolog and kernel If LC = 0, then while ESC > 0, decrement RRB and write a 0 intoP[0], and branch to the top of the loop ^ This occurs for the epilog
A if P[0];^ B if P[1];
C if P[2]; D if P[3]; P[0] = BRF.B.B.F; LC = 3, ESC = 3 /* Remember 0 relative!! */Clear all rotating predicatesP[0] = 1 4 iterations, 4 stages, II = 1, Note 4 + 4 –1 iterations of kernel executed
^ /* Backtracking phase – undo previous scheduling decisions */ ^ Unschedule all previously scheduled ops that conflict with op budget--
LC = 99 1: r3[-1] = load(r1[0]) Loop:2: r4[-1] = r3[-1] * 263: store (r2[0], r4[-1])4: r1[-1] = r1[0] + 45: r2[-1] = r2[0] + 4remap r1, r2, r3, r47: brlc Loop Step 2: DSA convert LC = 99 1: r3 = load(r1) Loop:2: r4 = r3 * 263: store (r2, r4)4: r1 = r1 + 45: r2 = r2 + 47: brlc Loop
RecMII = 1RESMII = 2MII = 2
resources: 4 issue, 2 alu, 1 mem, 1 brlatencies: add=1, mpy=3, ld = 2, st = 1, br = 1LC = 99^ 1: r3[-1] = load(r1[0]) Loop:2: r4[-1] = r3[-1] * 263: store (r2[0], r4[-1])4: r1[-1] = r1[0] + 45: r2[-1] = r2[0] + 4remap r1, r2, r3, r47: brlc Loop
Step3: Draw dependence graphCalculate MII 0,0 0,