# A C-Based Framework for Low-Cost Real-Time Embedded Systems
## 8 Performance Evaluation and Analysis
### Comparison with Other Frameworks  
The framework was compared with two other approaches among the ones discussed in Section 2. Namely, CPAL was selected among higher-level, MBD frameworks because it has successfully been used for practical cyber-physical and embedded applications. Moreover, it supports both interpreted and compiled execution, which provided further insights for the comparison. Arduino was chosen as a representative of lower-level, C++-based frameworks due to its popularity and availability on a variety of hardware platforms. In both cases, the hardware platform used for the comparison was the one closest to the RtFw testbed described in Section 8, chosen among the platforms for which a publicly available port was available. Table 5 summarizes those platforms and their main characteristics. To bring them as close as possible, all cores but one have been disabled on multi-core processors, and the BCM2837 has been forced to operate at its minimum clock speed. The comparison was carried out according to the following metrics: (a) minimum sustainable time-driven cycle time without incurring systematic timing errors; (b) total (code+data+BSS) footprint of the framework, as determined by the size tool, including dynamically linked libraries and excluding the operating system, unless bundled with the application; (c) level of programming abstraction. They were selected as a trade-off between the lack of access to the source code of CPAL and Arduino, which prevented its instrumentation and their significance. In particular, metric (a) is a black-box method to evaluate the total overhead of a framework. Metric (b) is undoubtedly less precise than the memory footprint evaluation of Section 8.3 but can easily be extracted from the executable image and still provides valuable information. Metric (c) directly affects programmers' productivity and learning curve. The elementary application used for the experiment was the same for all frameworks. It reads two 16-bit input variables from a remote I/O card using the Modbus-CAN protocol, checks for I/O errors, calculates their minimum and maximum if possible, and writes the results into two 16-bit remote output variables. For a fair comparison, the same communication libraries were used with all frameworks, \begin{table}
\begin{tabular}{l l l l l l} \hline \hline
**Framework** & & **OS** & **Processor** & **CPU** & **Cores @ Freq.** \\ \hline CPAL 1.27 & (interpreted) & Linux & BCM2837 & Cortex-A53 & 4 @ 600 MHz \\ CPAL 1.24 & (compiled) & Linux & BCM2837 & Cortex-A53 & 4 @ 600 MHz \\ Arduino 2.3.6 & (compiled) & FreeRTOS & ESP32-WROOM-32E & LX6 & 2 @ 240 MHz \\ RtFw & (compiled) & FreeRTOS & LPC1768 & Cortex-M3 & 1 @ 100 MHz \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Frameworks and platforms selected for the comparison. All cores but one have been disabled on multi-core processors; the BCM2837 has been forced to operate at its minimum clock speed. leading to the I/O timings listed in the second row of both sub-tables of Table 2. The minimum cycle time was measured by starting at 8 ms, proceeding by bisection towards 1 ms, and stopping when a systematic timing error was detected. Raw experimental results are shown in Table 6, while Table 7 summarizes the outcome of the comparison in a semi-quantitative way, where frameworks are classified as \"+\" (advantageous), \"o\" (neutral), or \"\(-\)\" (disadvantageous) with respect to the others based on the results. All frameworks but interpreted CPAL were able to achieve a cycle time of 1 ms and were classified as \"+\" in the corresponding column of Table 7. Interpreted CPAL was classified as \"\(-\)\" instead. RTFw had the lowest footprint and was therefore classified as \"+\" in this category. The footprint of Arduino was about twice as high as RTFw, which led to its \"\(\circ\)\" classification. Both variants of CPAL were classified as \"\(-\)\" because their footprint was 5-10 times as high as RTFw.