OurModel.tex 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. In Sec.~\ref{sec:system_description}, we introduce target architecture and the reference system used for evaluations.
  5. Sec.~\ref{sec:execution_model} presents the proposed execution model, designed based on the key observations from 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 placed at the power management system as voltage regulators require a capacitor larger than the device-specific minimum capacitance for stable operation.
  21. Also, the computing system has its own decoupling capacitor (C2) to stabilize operating voltage.
  22. Recent studies increasingly explore 32-bit architectures for the computing system~\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. % Emerging intermittent applications demand increasing computing capability~\cite{bakarProtean2023a} due to computat
  24. In this context, we employ a custom-built board featuring a 32-bit ARM Cortex-M33 processor (operating at 16Mhz) with 512KB of Ferroelectric RAM (FRAM) as a reference system.
  25. A TI BQ25570 based board is used for the power management system.
  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 generality of our model in 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 generate 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} shows the traces of the energy storage voltage and the MCU operating voltage (Vdd) for one 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 ranges 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 designer's decision.
  59. \begin{itemize}
  60. \item \textbf{O1}: The capacitor voltage drops quickly to charge decoupling capacitor when the system wakes-up ($t1$--$t2$).
  61. \item \textbf{O2}: The system executes 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} shows our detailed execution model, which reflects all the key observations.
  73. When the capacitor voltage reaches the power-on threshold, the voltage experience quick drop due to the buffering effects (\circled{1}), instead of gradual reduction.
  74. After initialization (\circled{2}), the system starts to execute at normal 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 execute using the buffered energy (\circled{4}).
  76. Since 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., 1.7V).
  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, the remaining energy in decoupling capacitors continues to discharge (\circled{5}).
  79. When designing intermittent systems, especially targeting small capacitors, it is important for software designers to understand this model.
  80. In the following sections, we discuss the impact of this 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 for 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 implies 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 consumed for each stage of operation within one power cycle, averaged over 50 executions.
  93. An 1mA of input current is provided at 1.9V.
  94. The x-axis represents different capacitor sizes and the line in the secondary axis represents the average operation times for application code.
  95. 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).
  96. Note that this is the most efficient point for checkpoint execution according to the traditional model.
  97. The results shows that significant energy is wasted in the decoupling capacitors.
  98. For example, 60.7\% of power is wasted during the power-off duration (denoted as \emph{Dischrged}) in 470uF case.
  99. The discharging behavior can be modeled as RC-discharging circuits (i.e., $q=CVe^{-\frac{1}{RC}t}$), which show exponential discharge rate.
  100. As a result, the cost from discharging is more expensive when the capacitor size is small;
  101. in our case, 50\% of energy is discharged at the first 161 ms.
  102. The discharge rate decreases as the capacitor size increases, down to 28.5\% in 1320uF case, which is still not negligible.
  103. % The cost is more expensive when the capacitor size is small since the discharge rate follows the RC-discharging circuits.
  104. % 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).
  105. % 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.
  106. Another important observation is the error introduced by the traditional model.
  107. The traditional model expects both the energies, \emph{Execution} and \emph{Discharged}, are used for computation.
  108. This introduces significant errors, up to 5.62x in 470uF setup.
  109. In the same context, the traditional model expects using 470uF capacitor instead of 1320uF results in merely 1.22x overhead in energy efficiency, but the actual energy efficiency differs by 4.71x.
  110. % However, our model shows that the actual energy efficiency differs by xx\% in reality, brining xx\% error in the traditional model.
  111. This can significantly mislead the system designers when they decide the capacitor size by considering tradeoffs between overall efficiency and reactiveness.
  112. In Sec.~\ref{sec:design_guidelines}, we discuss our guidelines to minimize overhead from discharging when designing software techniques.
  113. % 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.
  114. % It brings significant errors between the two models in available energy for the execution.
  115. % In 470uF case, the actual energy efficiency (Execution) and the expectation from the traditional model (Execution and Discharged) differs by 4.99 times.
  116. % (Limitations of power failure injection and simulation based evaluations).
  117. % In Sec.~\ref{sec:design_guidelines}, we discuss our guidelines to maximize power efficiency with software-level designs.
  118. \subsection{Impact on Predicting Power Failures}
  119. According to the traditional model, the system states should be saved to NVM before power-off threshold, as the system halts at this point.
  120. On the other hand, our model shows that the system may operate afterward using the energy stored in the decoupling capacitors (\textbf{O2}).
  121. Modern MCUs can operate on a range of supply voltages (e.g., from 1.7V to 3.6V for STM32L5 and MSP430).
  122. Since the voltage of decoupling capacitors decreases as the discharge, the computing system is executed until the voltage reaches the minimum operating voltage.
  123. % 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).
  124. This makes the energy storage voltage not a good estimate of the remaining time that system can execute.
  125. \begin{figure}
  126. \centering
  127. \begin{subfigure}{\linewidth}
  128. \includegraphics[width=\textwidth]{figs/plot_expr_6a_cropped.pdf}
  129. \caption{Input current = 1mA.}
  130. \label{fig:sub_voltage_execution_1mA}
  131. \vspace{5pt}
  132. \end{subfigure}
  133. \begin{subfigure}{\linewidth}
  134. \includegraphics[width=\textwidth]{figs/plot_expr_6b_cropped.pdf}
  135. \caption{Input current = 3mA.}
  136. \label{fig:sub_voltage_execution_3mA}
  137. \end{subfigure}
  138. \caption{Ratio of sub-voltage operations in total execution time.}
  139. \label{fig:sub_voltage_execution}
  140. \end{figure}
  141. % Modern MCUs can operate on wide range of operating voltages (e.g., from 1.7V to 3.6V for STM32L5 and MSP430).
  142. Fig.~\ref{fig:sub_voltage_execution} shows the ratio of the times executed under sub-voltage over the total execution times, averaged over 30 measurements.
  143. The x-axis shows the different capacitor sizes and the colors represent the voltages that system enters sleep state.
  144. We evaluate various voltages ranging from 1.7V to 2.5V since not all components in the computing system may operate at the lowest voltage (Sec.~\ref{sec:sub_normal_execution}).
  145. Also, we present two different cases with input current of 1mA (Fig.~\ref{fig:sub_voltage_execution_1mA}) and 3mA (Fig.~\ref{fig:sub_voltage_execution_3mA}) to evaluate the impact of input power.
  146. The figure shows that significant MCU operation is executed under sub-normal voltage.
  147. For example, when 470uF capacitor is used at 1mA input current (Fig.~\ref{fig:sub_voltage_execution_1mA}), 82.8\% of computation is executed \emph{after} power-off threshold.
  148. The ratio decreases as the system powers-off early (reduced sub-voltage operation time) or the input current increases (longer operation time at normal voltage).
  149. Under 1000uF is the major focus of this paper.
  150. These values can be directly translated to the inefficiency of the system based on the traditional model.
  151. For example, in 470uF with 1mA input current case, systems executing checkpoint at power-off threshold execute 16.3 ms while it can operate 29.4 ms more if it execute checkpoint at 2.5V.
  152. Although executing checkpoint early may save some energy in decoupling capacitors, the saved energy is not preserved as discussed in Sec.~\ref{sec:power_efficiency}.
  153. In Sec.~\ref{sec:design_guidelines}, we validate this aspect and propose a method to execute checkpoint truly just before the poweroff.
  154. \subsection{Impact of Sub-normal Voltage Execution}
  155. \label{sec:sub_normal_execution}
  156. The traditional model makes the software designers assume the system is executed under stable voltage.
  157. However, the execution after the power-off threshold (\textbf{O3}) happens in sub-normal voltage.
  158. Being aware of this is important to the software designers since the peripherals and analog components may function differently.
  159. The two most critical examples are Analog-Digital Converter (ADC) and external memory.
  160. \begin{figure}
  161. \centering
  162. \begin{subfigure}{0.45\linewidth}
  163. \includegraphics[width=\textwidth]{figs/plot_expr_2_cropped.pdf}
  164. \caption{Trace of one power cycle.}
  165. \label{fig:adc_error}
  166. \end{subfigure}
  167. \hfill
  168. \begin{subfigure}{0.52\linewidth}
  169. \includegraphics[width=\textwidth]{figs/plot_expr_3_cropped.pdf}
  170. \caption{Detailed trace.}
  171. \label{fig:fram_drror}
  172. \end{subfigure}
  173. \caption{Voltage of the capacitor and Vdd, sampled 470uF and 1.5mA.}
  174. \label{fig:adc_and_fram_error}
  175. \end{figure}
  176. Fig.~\ref{fig:adc_error}: ADC error.
  177. Fig.~\ref{fig:fram_drror}: FRAM error.
  178. \subsection{Sensitivity to Architectural Designs}
  179. \label{sec:other_architectures}
  180. Finally, we evaluate our model against two different architectural setups: MSP430 and Cortex-M33 with MRAM.
  181. MSP430 has less computational capability than Cortex-M33 cores.
  182. But it is a most popular platform for intermittent system researches, since it is a low-power system having on-chip FRAM.
  183. We used MSP430FR5994 evaluation board, having 10uF of onboard decap.
  184. For the second setup, we put MRAM to our evaluation platform instead of FRAM.
  185. Core frequencies, capacitance of power management system, input power targeting about 50 ms execution.
  186. \begin{figure}
  187. \centering
  188. \includegraphics[width=\linewidth]{figs/plot_expr_9_cropped.pdf}
  189. \caption{Energy breakdown and the ratio of sub-voltage operations in different architectures.}
  190. \label{fig:other_architectures}
  191. \end{figure}
  192. Fig.~\ref{fig:other_architectures} shows the results in different power-off voltage.
  193. The bar in the left shows the energy breakdown in one power cycle, and the one in the right represents the ratio of the execution time operated in sub-voltage.