// MODEL OF REAL TIME DYNAMIC VOLTAGE SCALING SYSTEM // cyclic conserving edf scheduler (chooses job with the most immediate deadline) // gxn/dxp 11/11/03 // non-deterministic since may be cases when two or more jobs have the same deadline mdp //------------------------------------------------------------------------------------------------- // FREQUENCIES (assume Vi greater than Vj if i1 -> (1-finish1) : (d1'=d1-1) & (w1'=w1+4) & (t1'=min(t1+1,C1)) // not finished + finish1 : (d1'=d1-1) & (t1'=0) & (f1'=1) & (w1'=0) & (u1'=min(t1+1,C1)); // finished [step1] schedule & frequency1 & d1=1 -> (1-finish1) : (f1'=2) // not finished (and error) + finish1 : (d1'=P1) & (t1'=0) & (f1'=0) & (w1'=0) & (u1'=C1); // finished // task is being performed at frequency 0.75 [step1] schedule & frequency2 & d1>1 -> (1-finish2) : (d1'=d1-1) & (w1'=w1+3) & (t1'=min(t1+1,C1)) // not finished + finish2 : (d1'=d1-1) & (t1'=0) & (f1'=1) & (w1'=0) & (u1'=min(t1+1,C1)); // finished [step1] schedule & frequency2 & d1=1 -> (1-finish2) : (f1'=2) // not finished (and error) + finish2 : (d1'=P1) & (t1'=0) & (f1'=0) & (w1'=0) & (u1'=C1); // finished // task is being performed at frequency 0.5 [step1] schedule & frequency3 & d1>1 -> (1-finish3) : (d1'=d1-1) & (w1'=w1+2) & (t1'=min(t1+1,C1)) // not finished + finish3 : (d1'=d1-1) & (t1'=0) & (f1'=1) & (w1'=0) & (u1'=min(t1+1,C1)); // finished [step1] schedule & frequency3 & d1=1 -> (1-finish3) : (f1'=2) // not finished (and error) + finish3 : (d1'=P1) & (t1'=0) & (f1'=0) & (w1'=0) & (u1'=C1); // finished // TASK NOT BEING PERFORMED (DEADLINE STILL CHANGES) - task 2 is running // deadline goes down [step2] d1>1 -> (d1'=d1-1); // end of period and finished task - move to next period [step2] d1=1 & f1=1 -> (d1'=P1) & (f1'=0) & (u1'=C1); // end of period and not finished - error [step2] d1=1 & f1=0 -> (f1'=2); // TASK NOT BEING PERFORMED (DEADLINE STILL CHANGES) - task 3 is running // deadline goes down [step3] d1>1 -> (d1'=d1-1); // end of period and finished task - move to next period [step3] d1=1 & f1=1 -> (d1'=P1) & (f1'=0) & (u1'=C1); // end of period and not finished - error [step3] d1=1 & f1=0 -> (f1'=2); // TASK NOT BEING PERFORMED (DEADLINE STILL CHANGES) - no task is running // deadline goes down [step] noschedule & d1>1 -> (d1'=d1-1); // end of period and finished task - move to next period [step] noschedule & d1=1 -> (d1'=P1) & (f1'=0) & (u1'=C1); endmodule //------------------------------------------------------------------------------------------------- // CONSTRUCT OTHER TASKS THROUGH RENAMING // task 2 module task2=task1[ d1=d2, d2=d3, d3=d1, u1=u2, u2=u3, u3=u1, t1=t2, w1=w2, f1=f2, f2=f3, f3=f1, P1=P2, P2=P3, P3=P1, C1=C2, C2=C3, C3=C1, T1=T2, step1=step2, step2=step3, step3=step1 ] endmodule // task 3 module task3=task1[ d1=d3, d2=d1, d3=d2, u1=u3, u2=u1, u3=u2, t1=t3, w1=w3, f1=f3, f2=f1, f3=f2, P1=P3, P2=P1, P3=P2, C1=C3, C2=C1, C3=C2, T1=T3, step1=step3, step2=step1, step3=step2 ] endmodule //------------------------------------------------------------------------------------------------- // REWARDS - related to power consumption (equals square of current voltage) rewards "power" // task performed at frequency 1 (voltage is 5) [step1] frequency1 & !noschedule : 25; [step2] frequency1 & !noschedule : 25; [step3] frequency1 & !noschedule : 25; // task performed at frequency 3 (voltage is 4) [step1] frequency2 & !noschedule : 16; [step2] frequency2 & !noschedule : 16; [step3] frequency2 & !noschedule : 16; // task performed at frequency 3 (voltage is 3) [step1] frequency3 & !noschedule : 9; [step2] frequency3 & !noschedule : 9; [step3] frequency3 & !noschedule : 9; endrewards