## 3 FENP_MC: Fixed Execution Non-Preemptive Mixed Criticality
### Fenp_mc
#### 3.4.3 Implementation Guidelines  
The execution mapping function, presented in Algorithm 2 is used by the function for computing start times in Algorithm 3. Both algorithms are adaptations of [24] for MCSs. \begin{table}
\begin{tabular}{c c} \hline \hline
**TaskID** & **StartTime** \\ \hline
1 & 0 \\
2 & 3 \\
3 & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Hi-criticality mode dispatch table for the task set example in Table 1. \begin{table}
\begin{tabular}{c c} \hline \hline
**TaskID** & **StartTime** \\ \hline
1 & 0 \\
2 & 3 \\
3 & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Lo-criticality mode dispatch table for the task set example in Table 1.  
```
Input:\(i\) (task index), \(t\) (time instance), critLevel (the system criticality mode) Output:\(\Deltasigma=sigma1-sigma2\)
1 \(temp\gets mod(t,T_{i})-S_{i,\textit{critLevel}}\)
2 if\(temp<0\)then
3\(sigma1\gets 0\)
4 else
5\(sigma1\gets 1\)
6 endif
7 if\(temp-C_{i,\textit{critLevel}}<0\)then
8\(sigma2\gets 0\)
9 else
10\(sigma2\gets 1\)
11 endif
12 return\(sigma1-sigma2\)
```  
**Algorithm 2** MFunc  
```
Input:\(\Gamma_{q}\) (the scheduling table of processor \(q\)), critLevel (the system criticality mode) Output: FAILURE to calculate the start times, SUCCESS otherwise
13 for\(i=1;i<\textit{size of }\Gamma_{q};i++\)do
14 schedulable \(\gets 0\)
15\(count\gets 0\)
16\(gcd\gets 1\)
17\(StartTime\leftarrow-1\)
18 for\(t=0;t\leq T_{i};t++\)do
19\(delta\gets 0\)
20 for\(j=0;j<i;j++\)do
21 if\(delta\
eq 0\)then
22 break
23 endif
24\(gcd\gets greatest\) common divisor of \(T_{i}\) and \(T_{j}\)
25 for\(k=0;k<T_{j}/gcd;k++\)do
26 if\(delta\
eq 0\) or \(\textit{MFunc}(j,t+k*T_{i},\textit{critLevel})\
eq 0\)then
27\(delta\gets 1\)
28 break
29 endif
30 endfor
31 endfor
32 if\(count\geq C_{j,\textit{critLevel}}\)then
33\(S_{i,\textit{critLevel}}\gets StartTime\)
34\(schedulable\gets 1\)
35 break
36 endif
37 if\(delta\
eq 0\)then
38\(count\gets 0\)
39\(StartTime\leftarrow-1\)
```  
**Algorithm 3** Start_Time_calculation  
```
Input:\(\Gamma_{q}\) (the scheduling table of processor \(q\)), critLevel (the system criticality mode) Output: FAILURE to calculate the start times, SUCCESS otherwise
13 for\(i=1;i<\textit{size of }\Gamma_{q};i++\)do
14 schedulable \(\leftarrow 0\)
25\(count\gets 0\)
36\(gcd\gets 1\)
37\(StartTime\leftarrow-1\)
38 for\(t=0;t\leq T_{i};t++\)do
39\(delta\gets 0\)
40 for\(j=0;j<i;j++\)do
41 if\(delta\
eq 0\)then
42 break
43 endif
44\(gcd\gets greatest\) common divisor of \(T_{i}\) and \(T_{j}\)
45 for\(k=0;k<T_{j}/gcd;k++\)do
46 if\(delta\
eq 0\) or \(\textit{MFunc}(j,t+k*T_{i},\textit{critLevel})\
eq 0\)then
47\(delta\gets 1\)
48 break
49 endif
50 endfor
51 endfor
52 if\(count\geq C_{j,\textit{critLevel}}\)then
53\(S_{i,\textit{critLevel}}\gets StartTime\)
54\(schedulable\gets 1\)
55 break
56 endif
57 if\(delta\
eq 0\)then
58\(count\gets 0\)
59\(StartTime\leftarrow-1\)
```  
**Algorithm 4** MFunc  
```
Input:\(\Gamma_{q}\) (the scheduling table of processor \(q\)), critLevel (the system criticality mode) Output: FAILURE to calculate the start times, SUCCESS otherwise
13 for\(i=1;i<\textit{size of }\Gamma_{q};i++\)do
14 schedulable \(\leftarrow 0\)
25\(count\gets 0\)
39\(gcd\gets 1\)
40\(StartTime\leftarrow-1\)
41 for\(t=0;t\leq T_{i};t++\)do
42\(delta\gets 0\)





## 4 P_FENP_MC

### Theoretical Aspects

For mixed criticality multicore systems, we propose an adaptation of the P_FENP which we call P_FENP_MC. The mapping algorithm is similar to that proposed in [28]. P_FENP_MC consists of two phases, namely, an offline phase and an online phase. The task partitioning to processors is carried out offline. A feasibility test is then conducted on each processor, followed by creating the table for that processor. Tasks are scheduled according to the dispatch tables in the online phase. The system starts in Lo-criticality mode; therefore, tasks will be scheduled according to the Lo-criticality dispatch table.