## Part 1 - Representing Interference as Arrival Curves

We implemented a MATLAB toolbox to derive the access pattern of a set of superblocks, that executes periodically, onto a shared resource. The definition of the set of superblocks that executes on a particular core is done in an ASCII file, which is the input to the analysis. The file has the following format:

%number of superblocks
%period
%minimum number of access requests
%maximum number of access requests
%communication time per access request
%minimum computation time
%maximum computation time
10
10000
39 7 195 81 182 252 259 180 57 10
39 7 195 81 182 252 259 180 57 10
2
0 2 54 23 61 75 80 56 17 0
0 2 54 23 61 75 80 56 17 0


The derivation of the arrival curves, is then performed by calling the function:


RTCcurve_upper = interference_single_periodic_task(config_file, output, delta, debug)



The first argument to this function is config_file, representing the MATLAB file handle to the configuration file. The argument output, defines whether a plot representing the curves should be plotted output=1, or not output=0, while argument delta specifies the maximum value on the x-axis, in case a plot is produced. Argument debug=1 allows to produce a plot with all the intermediate data that is produces during the derivation of the arrival curve. The function returns the parameters RTCcurve_upper representing the resulting arrival curve.

This results in the following output:

## Part 2 - Worst-Case Analysis for hybrid arbitration on the shared resource

In order to perform WCRT analysis for the set of superblocks that executes on the processing element under analysis, we consider all the other processing elements in the multicore platform as interferers. Their interference is represented as arrival curve for each core, and thus we represent their overall interference as the sum the corresponding arrival curves. As an example, consider a system with 4 cores, where Core 1 is the processing element under analysis. Then we compute the overall interference as follows:


alpha_2 = interference_single_periodic_task(config_file_core2, output, delta, debug);
alpha_3 = interference_single_periodic_task(config_file_core3, output, delta, debug);
alpha_4 = interference_single_periodic_task(config_file_core4, output, delta, debug);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%produces the overall interference, considering that core1
%is the core under analysis
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
alpha_23 = rtcplus(alpha_2, alpha_3);
alpha_interference = rtcplus(alpha_23, alpha_4);



As a result, the overall interference is now stored in alpha_interference.

Following that, the set of superblocks that have to be analyzed and the arbiter have to be defined. Consider a configuration file as described above for each core. Then, the configuration for the processing element under analysis (Core 1 in our example), is performed as follows:


[A D H] = importdata(config_file_core1_opt, ' ',7);
number_of_blocks = A.data(1);
S_opt = zeros(number_of_blocks, 5);
%the upper bound on the execution time
S_opt(1:number_of_blocks, 1) = A.data(3+2*number_of_blocks+1:3+3*number_of_blocks),
%the upper bound on access requests
S_opt(1:number_of_blocks, 2) = A.data(3+number_of_blocks:3+2*number_of_blocks-1);
%the slot assignment, e.g., Slot 1 is assigned to this core
S_opt(1:number_of_blocks, 3) = 1;
%the execution model: 0 = sequential, x \in R = the starting time for time-triggered execution
S_opt(1:number_of_blocks, 4) = 0;
%the period
S_opt(1:number_of_blocks, 5) = 2.5;



Then, the arbiter has to be defined:


%communication time per access request
C = 0.5;

%the arbiter
%the static segment
theta.assignments = [ 2 1 3];
%the starting times of the static slots
theta.starting_times = [0 11 15];
%the length of the static segment
theta.L = 17
%the length of the dynamic segment
theta.dyn_length = 7;
%note: the arbitration length is L+dyn_length

%the worst-case number of interferers and
%pending access requests at the beginning
%of the dynamic segment
Ltot = 2
Lpre = 2;

%the length of a minislot in the dynamic
%segment
ml = 0.5;



Eventually, the WCRT can be computed by the following command:


[schedulable, wcct] = analyzeTask(S, alpha_interference, theta, Ltot, C, ml, Lpre);