Skip to main content
. 2012 Aug 17;12(8):11334–11359. doi: 10.3390/s120811334
Algorithm 1. HTDVS-HRCT algorithm.

1 Algorithm HTDVS-HRCT()
/*τ(i,k) is the subtask to be executed. τ(i,m) is the last subtask of τi. LST(i) and GST(i) are the slack time before τ(i,k) is released. f(V(i,k)′) is the operating frequency corresponding to V(i,k)′; AET(i,k) is the actual execution time of τ(i,k). S(i,k) is the slowdown factor of τ(i,k). S(i,k) is a temporary variable.*/
2 Before task release:
3 if ((k == m) and (RiC(i,m)R(i,m-1) > 0)) {
4   Sleep(RiC(i,m)R(i,m-1));
5   return;
6  }
7   if (the restriction flag of τ(i,k) is true) {
8    if (GST(i) + LST(i)MRS(i,k)){
9     GST(i) = GST(i) + LST(i) − MRS(i,k);
10     LST(i) = MRS(i,k);
11    }
12   else {
13    LST(i) = LST(i) + GST(i);
14    GST(i) = 0;
15    }
16   }
17 else {
18   LST(i) = LST(i)+GST(i);
19   GST(i) =0;
20  }
21 S(i,k)′ = S(i,k);
22   if (τ(i,k) is G1-type) {
23    if (LST(i) + GST(i) − LRST(i,k)STIDL(i,k) and LST(i)STIDL(i,k))
24     S(i,k)= Sidl(i,k);
25    else if (LST(i) + GST(i)-LRST(i,k)STMIN(i,k) and LST(i)STMIN(i,k)) {
26     if (LRST(i,k) > GST(i))
27      S(i,k) = (S(i,k)*C(i,k) + LST(i) + GST(i) − LRST(i,k))/C(i,k);
28     else if (GST(i)LRST(i,k))
29      S(i,k) = (S(i,k)*C(i,k) + LST(i))/C(i,k);
30    }
31   }
32   else if (τ(i,k) is G2-type) {
33    if (the H tag of τ(i,k) is true) {
34     if (LST(i) + GST(i)IRST(i,k) and GST(i) < IRST(i,k))
35      S(i,k)=(S(i,k)*C(i,k) + LST(i) + GST(i) − IRST (i,k))/C(i,k);
36     else if (GST(i)IRST(i,k))
37      S(i,k) = (S(i,k)*C(i,k) + LST(i))/C(i,k);
38    }
39   else {
40    if (LST(i) + GST(i)MRST(i,k) and GST(i) < MRST(i,k))
41     S(i,k) = (S(i,k)*C(i,k) + LST(i) + GST(i) − MRST(i,k))/C(i,k);
42    else (GST(i) ≥ MRST(i,k))
43    S(i,k) = (S(i,k)*C(i,k) + LST(i))/C(i,k);
44    }
45   }
46 if (Vi is the least voltage that makes fi/fmax equal to or larger than 1/S(i,k));
47   Set the operating voltage V(i,k) to Vi;
48 Upon task completion:
49 LST(i) = LST(i) + S(i,k)*C(i,k)fmax/f(V(i,k)′)*AET(i,k);