OurModel.tex 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. \section{Detailed Intermittent Execution Model}
  2. \label{sec:detailed_execution_model}
  3. In this section, we describe our execution model and its implications for software design.
  4. Sec.~\ref{sec:system_description} introduces the target architecture and the reference system used for evaluations.
  5. In Sec.~\ref{sec:execution_model}, we present the proposed execution model, derived from key observations obtained through experimental results.
  6. In the following three sections, we discuss how this model affects both the power efficiency and correctness of software design.
  7. Finally, in Sec.~\ref{sec:other_architectures}, we evaluate the effectiveness of our model across systems with different architectural configurations.
  8. \subsection{System Description}
  9. \label{sec:system_description}
  10. \begin{figure}
  11. \centering
  12. \includegraphics[width=\linewidth]{figs/cropped/system.pdf}
  13. \caption{A typical hardware setup of intermittent systems.}
  14. \label{fig:hardware_setup}
  15. \end{figure}
  16. A typical intermittent system consists of two main components: a power management system and a computing system, as illustrated in Fig.~\ref{fig:hardware_setup}.
  17. The power management system is responsible for accumulating the incoming energy into storage and providing a stable-voltage current to the computing system.
  18. The computing system equips NVMs along with the MCU and peripherals, and utilize the NVMs for state retention between power failures.
  19. This setup includes two notable decoupling capacitors that affect the execution model of intermittent systems.
  20. The first one (C1 in the figure) is located within the power management system as voltage regulators require a capacitor larger than the device-specific minimum to ensure stable operation.
  21. The second capacitor (C2) is part of the computing system and is used for stabilizing the operating voltage against sudden current draw.
  22. Recent studies have increasingly explored 32-bit architectures for computing systems~\cite{shihIntermittent2024,wuIntOS2024,kimRapid2024,akhunovEnabling2023,kimLACT2024,kimLivenessAware2023,parkEnergyHarvestingAware2023,kortbeekWARio2022,khanDaCapo2023,barjamiIntermittent2024,songTaDA2024}, as emerging applications on intermittent systems, such as Deep Neural Networks (DNNs)~\cite{houTale2024,yenKeep2023,khanDaCapo2023,gobieskiIntelligence2019,islamEnabling2022,kangMore2022,leeNeuro2019,islamZygarde2020,custodeFastInf2024,barjamiIntermittent2024,songTaDA2024}, demand greater computational capabilities~\cite{bakarProtean2023a,carontiFinegrained2023}.
  23. In this context, we employ a custom-built board featuring a 32-bit ARM Cortex-M33 processor (STM32L5, operating at 16Mhz) with 512KB of Ferroelectric RAM (FRAM) as our reference system.
  24. For the power management system, we use a TI BQ25570-based board with power-on and power-off thresholds of 4.9 V and 3.4 V, respectively.
  25. % A TI BQ25570 based board is used for the power management system, with power-on and off thresholds of 4.9V and 3.4V, respectively.
  26. We empirically select 22uF and 220uF capacitors for C1 and C2, respectively, as these are the minimum capacitor sizes for stable checkpoint and recovery.
  27. Sec.~\ref{sec:other_architectures} evaluates the generality of our model across different architectures, such as systems with Magnetic RAM (MRAM) and a 16-bit core (e.g., MSP430).
  28. % In this work, our goal is to model the buffering effects of these capacitors and evaluate their implications on software designs.
  29. % (Recent studies present the need for better computing capability~\cite{bakarProtean2023a})
  30. % For model validation and evaluation, we use a custom-built board equipped with an ARM Cortex-M33 core and 512KB of FRAM.
  31. % Our setup requires XXuF and 220uF capacitors for C1 and C2, respectively, for stable execution of checkpoint and recovery.
  32. % Sec.~\ref{sec:other_architectures} evaluates our model in different architectures.
  33. \subsection{Execution Model}
  34. \label{sec:execution_model}
  35. \begin{figure}
  36. \centering
  37. \begin{subfigure}{\linewidth}
  38. \includegraphics[width=\textwidth]{figs/plot_expr_8a_cropped.pdf}
  39. \caption{Voltage traces for one power cycle.}
  40. \label{fig:execution_trace_one_cycle}
  41. \vspace{5pt}
  42. \end{subfigure}
  43. \begin{subfigure}{\linewidth}
  44. \includegraphics[width=\textwidth]{figs/plot_expr_8b_cropped.pdf}
  45. \caption{Voltage traces around the first power-on.}
  46. \label{fig:execution_trace_detailed}
  47. \end{subfigure}
  48. \caption{Voltages trace of energy storage and Vdd.}
  49. \label{fig:execution_trace}
  50. \end{figure}
  51. To derive general execution model with the effects of decoupling capacitors, we first present a sample measurement from our reference system.
  52. To achieve an operation time of 50ms under 1.5mA current supply, we use a 470uF capacitor for energy storage.
  53. Fig.~\ref{fig:execution_trace_one_cycle} illustrates the voltage traces of the energy storage and the MCU operating voltage (Vdd) over a single power cycle.
  54. Note that Vdd is maintained by decoupling capacitors after current supply from the power management system stops.
  55. The shaded areas represent the periods that system executes the application code.
  56. % Fig.~\ref{fig:execution_trace_one_cycle} shows the trace during one power cycle, and Fig.~\ref{fig:execution_trace_detailed} presents the first execution cycle in more detail.
  57. Fig.~\ref{fig:execution_trace_detailed} presents the first execution cycle in more detail. It shows several interesting differences between the traditional execution model and the actual operation.
  58. Among them, we highlight three key observations that affect software design decisions.
  59. \begin{itemize}
  60. \item \textbf{O1}: The capacitor voltage drops rapidly to charge decoupling capacitor when the system wakes up ($t1$--$t2$).
  61. \item \textbf{O2}: The system operates at sub-voltage using the decoupling capacitors, even after power supply stops ($t4$--$t5$).
  62. \item \textbf{O3}: Decoupling capacitors discharge while the system is powered off (after $t5$, as shown in Fig.~\ref{fig:execution_trace_one_cycle}).
  63. \end{itemize}
  64. \begin{figure}
  65. \centering
  66. \includegraphics[width=\linewidth]{figs/cropped/detailed_execution_model.pdf}
  67. \caption{Detailed execution model of intermittent systems.}
  68. \label{fig:detailed_execution_model}
  69. \end{figure}
  70. % As we discuss in the following sections, all three observations significantly impact the performance of intermittent system designs.
  71. % We propose a detailed execution model which reflects these observations.
  72. Fig.~\ref{fig:detailed_execution_model} illustrates our detailed execution model, incorporating these key observations.
  73. When the capacitor voltage reaches the power-on threshold, the voltage experience a rapid drop due to the buffering effects (\circled{1}), instead of gradual decline.
  74. After initialization (\circled{2}), the system begins execution at normal operating voltage (\circled{3}), 3.3V for example.
  75. When the voltage hits the power-off threshold, the power supply stops but system now starts to operate using the buffered energy (\circled{4}).
  76. Since the voltage of the decoupling capacitor decreases as it discharges, the system executes at sub-normal voltage until it reaches the voltage it cannot operate (e.g., 2.5V).
  77. % This voltage is known as Brown-Out Reset (BOR) voltage and is typically in a range of 1.7V to 2.5V in modern MCUs~\cite{}.
  78. Finally, until the next power-on event, the remaining energy in decoupling capacitors continues to discharge (\circled{5}).
  79. When designing intermittent systems, particularly those utilizing small capacitors, it is important for software designers to have clear understanding of this model.
  80. In the following sections, we discuss the impact of our model to software design in more detail.
  81. \subsection{Impact on Power Efficiency}
  82. \label{sec:power_efficiency}
  83. The traditional model implies that the energy consumed between power-on and power-off thresholds are entirely used in the computing system.
  84. However, our model reveals that considerable energy is used for charging the decoupling capacitors (\textbf{O1}) and dissipated during power-off durations (\textbf{O3}).
  85. This indicates that much smaller energy may be used for the useful computation compared to the designer's expectation.
  86. \begin{figure}
  87. \centering
  88. \includegraphics[width=\linewidth]{figs/plot_expr_5_cropped.pdf}
  89. \caption{Distribution of energy consumed in a power cycle in different capacitor sizes (1mA current supply).}
  90. \label{fig:power_distribution}
  91. \end{figure}
  92. Fig.~\ref{fig:power_distribution} shows the distribution of the energy consumption for each stage of operation within one power cycle, averaged over 50 executions, where 1mA of input current is provided at 1.9V.
  93. The x-axis represents capacitor sizes and the line in the secondary axis represents the average operation times for application code.
  94. The checkpoint is executed by the interrupt from the power management system~\cite{}, which is generated when the capacitor voltage reaches the power-off threshold (3.4V).
  95. Note that this is the most efficient point for checkpoint execution according to the traditional model.
  96. The results shows that significant energy is wasted in the decoupling capacitors.
  97. For example, 60.7\% of power is wasted during the power-off duration (denoted as \emph{Dischrged}) in 470uF case.
  98. The discharging behavior can be modeled as an RC-discharging circuit (i.e., $q=CVe^{-\frac{1}{RC}t}$), which exhibits an exponential discharge rate.
  99. As a result, the energy loss due to discharging is more expensive when the capacitor size is small.
  100. In our case, 50\% of energy is discharged within the first 161 ms.
  101. While the discharge rate decreases with larger capacitor sizes, it remains significant;
  102. for example, in the 1320uF case, 28.5\% of energy is discharged, which is still non-negligible.
  103. % The discharge rate decreases as the capacitor size increases, down to 28.5\% in 1320uF case, which is still not negligible.
  104. % The cost is more expensive when the capacitor size is small since the discharge rate follows the RC-discharging circuits.
  105. % While using smaller capacitors shortens the power-off durations, the discharging behavior penalizes them most since RC-discharging circuits discharge exponentially (in our case, 50\% of energy is discharged at the first 161 ms).
  106. % As a result, 60.7\% of power is wasted in 470uF, and the rate decreases as the capacitor size increases, down to 28.5\% in 1320uF case.
  107. Another important observation is the error introduced by the traditional model.
  108. The traditional model expects both the energies, \emph{Execution} and \emph{Discharged}, are used for computation.
  109. This introduces significant errors, up to 5.62x in 470uF setup.
  110. In the same context, the traditional model predicts that using a 470uF capacitor instead of a 1320uF would result in only 1.22x overhead in energy efficiency, while the actual difference is 4.71x.
  111. % However, our model shows that the actual energy efficiency differs by xx\% in reality, brining xx\% error in the traditional model.
  112. This can significantly mislead system designers when they select capacitor sizes by considering tradeoffs between overall efficiency and reactiveness.
  113. In Sec.~\ref{sec:design_guidelines}, we explore strategies to minimize overhead caused by discharging when designing software techniques.
  114. % More importantly, this wasted energy is expected to be used for the computation in traditional execution model, as all the energy except for the initialization and checkpoint/recovery is expected to be used in computations.
  115. % It brings significant errors between the two models in available energy for the execution.
  116. % In 470uF case, the actual energy efficiency (Execution) and the expectation from the traditional model (Execution and Discharged) differs by 4.99 times.
  117. % (Limitations of power failure injection and simulation based evaluations).
  118. % In Sec.~\ref{sec:design_guidelines}, we discuss our guidelines to maximize power efficiency with software-level designs.
  119. \subsection{Impact on Predicting Power Failures}
  120. \label{sec:predicting_power_failures}
  121. According to the traditional model, system states should be saved to NVM before reaching power-off threshold, as the system halts at this point.
  122. On the other hand, our model shows that the system may continue operating using the energy stored in the decoupling capacitors (\textbf{O2}).
  123. Since modern MCUs can operate across a wide range of supply voltages (e.g., from 1.7V to 3.6V in STM32L5 and MSP430), the computing system is executed until the voltage of decoupling capacitors drops to the minimum operating level.
  124. % Modern MCUs can operate on a range of supply voltages (e.g., from 1.7V to 3.6V for STM32L5 and MSP430).
  125. % Since the voltage of decoupling capacitors decreases as the discharge, the computing system is executed until the voltage reaches the minimum operating voltage.
  126. % While the voltage of decoupling capacitors decreases as they discharge, the computing system operates since modern MCUs can operate on a range of supply voltages (e.g., from 1.7V to 3.6V for STM32L5 and MSP430).
  127. This makes the energy storage voltage not a reliable estimate of the remaining execution time.
  128. \begin{figure}
  129. \centering
  130. \begin{subfigure}{\linewidth}
  131. \includegraphics[width=\textwidth]{figs/plot_expr_6a_cropped.pdf}
  132. \caption{Input current = 1mA.}
  133. \label{fig:sub_voltage_execution_1mA}
  134. \vspace{5pt}
  135. \end{subfigure}
  136. \begin{subfigure}{\linewidth}
  137. \includegraphics[width=\textwidth]{figs/plot_expr_6b_cropped.pdf}
  138. \caption{Input current = 3mA.}
  139. \label{fig:sub_voltage_execution_3mA}
  140. \end{subfigure}
  141. \caption{Ratio of sub-voltage operations in total execution time.}
  142. \label{fig:sub_voltage_execution}
  143. \end{figure}
  144. % Modern MCUs can operate on wide range of operating voltages (e.g., from 1.7V to 3.6V for STM32L5 and MSP430).
  145. Fig.~\ref{fig:sub_voltage_execution} presents the ratio of the times executed under sub-voltage to the total execution times, averaged over 30 measurements.
  146. The x-axis represents different capacitor sizes and the colors indicate the voltage levels at which the system stops operation.
  147. We evaluate a range of stop voltages from 1.7V to 2.5V since not all components in the computing system may function at the lowest voltage (Sec.~\ref{sec:sub_normal_execution}).
  148. Also, we examine two cases with different input currents of 1mA (Fig.~\ref{fig:sub_voltage_execution_1mA}) and 3mA (Fig.~\ref{fig:sub_voltage_execution_3mA}), to assess the impact of varying input power.
  149. The figure shows that a significant portion of MCU operation occurs at sub-normal voltage.
  150. For example, when 470uF capacitor is used at 1mA input current (Fig.~\ref{fig:sub_voltage_execution_1mA}), 82.8\% of computation takes place \emph{after} the power-off threshold.
  151. This ratio decreases as the system powers off earlier (reducing sub-voltage operation time) or the input current increases (extending operation time at normal voltage).
  152. Under 1000uF is the major focus of this paper.
  153. These values can be directly translated to the inefficiencies of the system based on the traditional model.
  154. For example, in the case of 470uF with 1mA input current, systems executing checkpoint at power-off threshold may operate 16.3ms.
  155. However, the system could operate for an additional 29.4ms if the checkpoint is executed at 2.5V.
  156. At the next power-on, the decoupling capacitors discharge to similar voltage levels in both cases, as their discharge behavior follows an exponential curve (Sec.~\ref{sec:power_efficiency}).
  157. As a result, failing to utilize the available energy at sub-normal voltage introduces significant power efficiency overhead.
  158. % Although early checkpoint execution may save some energy in decoupling capacitors, the saved energy is not preserved as discussed in Sec.~\ref{sec:power_efficiency}.
  159. In Sec.~\ref{sec:design_guidelines}, we validate this aspect and propose methods to predict the power-off time more accurately.
  160. \subsection{Impact of Sub-normal Voltage Execution}
  161. \label{sec:sub_normal_execution}
  162. The traditional model leads the software designers to assume that the system is executed under a stable voltage.
  163. However, a significant portion of execution may happen after the power-off threshold at sub-normal voltage (\textbf{O3}), as discussed in Sec.~\ref{sec:predicting_power_failures}.
  164. Being aware of this is crucial to software designers since the peripherals and analog components may function differently at sub-normal voltage.
  165. Two of the most relevant examples are Analog-Digital Converters (ADCs) and external NVMs.
  166. They play an important role in checkpointing, since ADCs are often used to estimate power-off time by reading the capacitor voltage and NVM serves as the storage for checkpoints.
  167. At the same time, they are likely to operate at sub-normal voltages, as it is most efficient to execute checkpoint just before power-off.
  168. % Incorrect execution of these components may lead to unsafe or incomplete checkpoint executions.
  169. \begin{figure}
  170. \centering
  171. \begin{subfigure}{0.45\linewidth}
  172. \includegraphics[width=\textwidth]{figs/plot_expr_2_cropped.pdf}
  173. \caption{Analog-Digital Converter.}
  174. \label{fig:adc_error}
  175. \end{subfigure}
  176. \hfill
  177. \begin{subfigure}{0.52\linewidth}
  178. \includegraphics[width=\textwidth]{figs/plot_expr_3_cropped.pdf}
  179. \caption{External FRAM.}
  180. \label{fig:fram_drror}
  181. \end{subfigure}
  182. \caption{Incorrectly functioning components at sub-normal voltage.}
  183. \label{fig:adc_and_fram_error}
  184. \end{figure}
  185. Fig.~\ref{fig:adc_error} shows the behavior of ADCs in sub-normal voltage.
  186. ADC quantizes the input analog voltage into the range of discrete $2^n$ values from 0 to $V_{ref}$, where $n$ is a resolution and $V_{ref}$ is a reference voltage, and cannot read the input voltage larger than $V_{ref}$.
  187. As STM32L5 is designed to use Vdd as reference voltage, accessing the ADC during sub-normal voltage operation leads to inconsistent results.
  188. As shown in the figure, the ADC returns values higher than the measurements since ADC representation range is decreased as Vdd drops.
  189. As a result, during sub-normal voltage operation, the system may incorrectly interpret ADC results as there is sufficient energy and decide not to execute a checkpoint.
  190. Also, intermittent systems typically designed with the use of peripherals, including sensors~\cite{yildizAdaptable2024,dangIoTree2022,afanasovBatteryless2020,maengAdaptive2020}, wireless communication modules~\cite{katanbafMultiScatter2021,dewinkelIntermittentlypowered2022,babatundeGreentooth2024} or external NVMs~\cite{dewinkelIntermittentlypowered2022,kimLACT2024,kimLivenessAware2023,akhunovEnabling2023}, which have their own minimum operating voltage requirements.
  191. % Also, some peripherals may not work below certain voltage.
  192. Fig.~\ref{fig:fram_drror} illustrates the error rate of FRAM in the reference system at different voltages, showing FRAM cannot operate reliably below 2.4V.
  193. Since the system continues operating until it reaches the lowest MCU operation voltage (e.g., 1.7V), software designers must ensure that peripherals are accessed only at safe voltage levels.
  194. Failing to this can result in corrupted data or incomplete checkpointing.
  195. In Sec.~\ref{sec:design_guidelines}, we propose two techniques that can safely estimate the power-off time under sub-normal voltage conditions.
  196. \subsection{Sensitivity to Architectural Designs}
  197. \label{sec:other_architectures}
  198. % Please add the following required packages to your document preamble:
  199. % \usepackage{booktabs}
  200. % \usepackage{multirow}
  201. % \usepackage{graphicx}
  202. \begin{table}[]
  203. \centering
  204. \caption{Architectures for generality evaluation}
  205. \label{tab:architectures}
  206. \renewcommand{\arraystretch}{0.9} % Reduce vertical spacing
  207. \setlength{\tabcolsep}{3pt} % Reduce horizontal spacing
  208. \resizebox{0.95\columnwidth}{!}{%
  209. \begin{tabular}{@{}cccccccc@{}}
  210. \toprule
  211. \multirow{2}{*}{} & \multirow{2.5}{*}{Core} & \multirow{2.5}{*}{\begin{tabular}[c]{@{}c@{}}Core\\ Freq.\end{tabular}} & \multicolumn{3}{c}{Capacitance (uF)} & \multirow{2.5}{*}{Current} & \multirow{2.5}{*}{Memory} \\ \cmidrule(lr){4-6}
  212. & & & C1 & C2 & Storage & & \\ \midrule
  213. A1 & STM32L5 & 16MHz & 22 & 220 & 1,320 & 3mA & \begin{tabular}[c]{@{}c@{}}MRAM\\ (off-chip)\end{tabular} \\
  214. A2 & MSP430FR5994 & 8MHz & 22 & 10 & 40 & 100uA & \begin{tabular}[c]{@{}c@{}}FRAM\\ (on-chip)\end{tabular} \\ \bottomrule
  215. \end{tabular}%
  216. }
  217. \end{table}
  218. To verify generality of our model, we evaluate it using two additional architectural setups.
  219. Table~\ref{tab:architectures} shows the detailed parameters of the target architectures.
  220. A1 shares the same configuration as the reference system but equips MRAM (Everspin MR5A16ACYS35) instead of FRAM.
  221. This setup is included since MRAM is also gaining attention as a next generation NVM~\cite{akhunovEnabling2023,bakarProtean2023a,dewinkelIntermittentlypowered2022,wuIntOS2024}.
  222. Second target is the MSP430, which has been the mostly adopted 16-bit platform in intermittent system research.
  223. For both systems, the architectural parameters are set to achieve an operation time of approximately 50 ms.
  224. \begin{figure}
  225. \centering
  226. \includegraphics[width=\linewidth]{figs/plot_expr_9_cropped.pdf}
  227. \caption{Energy breakdown and the ratio of sub-voltage operations in different architectures.}
  228. \label{fig:other_architectures}
  229. \end{figure}
  230. Fig.~\ref{fig:other_architectures} shows the results for different power-off voltages.
  231. The bars on the left illustrate the energy breakdown in a single power cycle, and the bars on the right represent the ratio of the execution time operated at sub-voltage.
  232. The most noticeable difference is ratio of energy consumed during the ramp-up and init stage.
  233. While A1 consumes 63.4\% power at this stage on average, only 5.6\% of energy is consumed in A2.
  234. This is because A1 is configured to use external MRAM, which exhibits significantly higher leakage current than FRAM used in the reference system.
  235. In contrast, MSP430 (A2) is equipped with on-chip FRAM, which has much lower leakage.
  236. Despite these differences, both architectures exhibit high sub-voltage execution rates, up to 55.5\% in A1 and 70.1\% in A2.
  237. In addition, discharged energy takes considerable portion in both A1 (31.4\%) and A2 (52.0\%) at 3.3V power-off voltage configuration, which represents the techniques based on the traditional model that halt immediately at power-off threshold.
  238. In summary, the evaluation demonstrates that the modeled buffering effects are general and their impacts are significant across different system architectures.
  239. % In summary, the evaluation reveals that the buffering effect of system's capacitance and its implications are general in other systems.