[Paper Review] Optimizing the flash-RAM energy trade-off in deeply embedded systems
This paper proposes a compiler optimization that reduces energy consumption in deeply embedded systems by statically relocating selected basic blocks from flash to RAM using integer linear programming and an energy cost model. The technique reduces average power by up to 41% and total energy by up to 22%, extending battery life by up to 32% in sleep-heavy workloads, despite increased execution time.
Deeply embedded systems often have the tightest constraints on energy consumption, requiring that they consume tiny amounts of current and run on batteries for years. However, they typically execute code directly from flash, instead of the more energy efficient RAM. We implement a novel compiler optimization1 that exploits the relative efficiency of RAM by statically moving carefully selected basic blocks from flash to RAM. Our technique uses integer linear programming, with an energy cost model to select a good set of basic blocks to place into RAM, without impacting stack or data storage. We evaluate our optimization on a common ARM microcontroller and succeed in reducing the average power consumption by up to 41% and reducing energy consumption by up to 22%, while increasing execution time. A case study is presented, where an application executes code then sleeps for a period of time. For this example we show that our optimization could allow the application to run on battery for up to 32% longer. We also show that for this scenario the total application energy can be reduced, even if the optimization increases the execution time of the code.
Motivation & Objective
- To address the high energy consumption of flash memory in deeply embedded systems constrained by long battery life.
- To reduce system-wide energy usage without increasing stack or data storage requirements.
- To explore whether moving code from flash to RAM can reduce total energy, even if execution time increases.
- To develop a compiler optimization that intelligently selects basic blocks for RAM placement based on energy efficiency.
Proposed method
- The method uses integer linear programming to model the energy cost of placing basic blocks in flash versus RAM.
- An energy cost model quantifies the relative energy efficiency of flash and RAM access for each basic block.
- The optimization selects a subset of basic blocks to move to RAM to minimize total energy consumption.
- The technique preserves stack and data storage requirements by not altering data layout or stack usage.
- The solution is implemented as a compiler pass that transforms code before deployment on ARM microcontrollers.
Experimental results
Research questions
- RQ1Can relocating selected code blocks from flash to RAM reduce total system energy consumption in deeply embedded systems?
- RQ2How much energy reduction is achievable through static code placement in RAM, given the trade-off with increased execution time?
- RQ3What is the maximum battery life extension possible when applying this optimization to sleep-intensive embedded workloads?
- RQ4Does the energy savings from RAM access outweigh the increased execution time in real-world embedded applications?
Key findings
- The optimization reduces average power consumption by up to 41% on a common ARM microcontroller.
- Total energy consumption is reduced by up to 22% across evaluated workloads.
- For a sleep-heavy application, battery life can be extended by up to 32% due to reduced energy usage.
- Energy savings are achieved even when execution time increases, demonstrating that total energy is the dominant metric.
- The method successfully avoids increasing stack or data storage requirements during code relocation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.