1 Introduction
The recent advancements in microelectronics led to the emergence of batteryless sensors that operate relying only on ambient energy [
40]. This sensing technology opens up new application spaces where small devices should have eternal lifetimes, autonomous operation, and massive deployments in inaccessible locations [
14]. Batteryless sensors comprise energy-harvesting circuits that use several sources such as solar, thermal, and radio waves to accumulate the environmental energy into a small energy buffer, typically a tiny capacitor. When the stored harvested energy is above an operating threshold, the microcontroller reboots to compute, sense, and communicate. When the energy drains out of the capacitor, the microcontroller and peripherals turn off due to a power failure. Today’s batteryless sensors are composed of ultra-low-power microcontrollers whose main architectural components are
volatile. When the batteryless sensor turns off due to a power failure, the volatile processor state (e.g., the contents of the stack, program counter, registers) is lost. This operation leads to the loss of all computational states and intermediate results [
38].
The software on batteryless platforms runs
intermittently due to frequent charge-discharge cycles. As a consequence of the intermittent execution, the computation might not
progress forward and
memory consistency might be violated [
37]. To store information that will persist despite power failures, microcontrollers in batteryless sensors comprise embedded non-volatile secondary memory components, e.g.,
Ferroelectric Random Access Memory (FeRAM) [
7,
8], that exhibits low-power characteristics, faster write performance, and greater maximum read/write endurance compared to Flash memories, even if they pay lower memory density than other recent NVM technologies. Using software-based techniques (e.g., [
2,
18,
62]), programmers back up the volatile state of the microcontroller into non-volatile memory to recover computation from where it left upon a power failure. As an alternative to software-based solutions, leveraging non-volatile logic and building
non-volatile processors (NVPs) is another approach to ensure forward progress of computation and keep memory consistent during intermittent execution. NVPs integrate built-in non-volatile memory in their architecture. They automatically back up the computation state into their internal non-volatile registers upon a power failure and restore the state upon recovery [
24]. All these operations are transparent to the programmer.
The architectural design space of intermittent computing systems that exploit non-volatile logic is broad and includes several design options with different pros and cons. As an example, a crucial design decision is to identify which state elements will be non-volatile. Systems designers can keep all registers non-volatile, which is slower and more energy-consuming. Alternatively, the designers can keep all registers as volatile, but they can maintain additional non-volatile registers to back up the volatile state (i.e., volatile registers) at specific points in time. Another crucial issue is to decide the backup frequency of the volatile state components. For instance, a computing system can back up its state at every clock cycle, or it can back up on demand [
24,
25] to decrease the backup frequency and save energy. However, the lack of design tools makes fast prototyping and functional verification of computing systems with non-volatile logic difficult.
Field-programmable gate arrays (FPGAs) are useful for fast prototyping and verification of digital logic. As of now, FPGA fabrics include logic elements that are implemented using either volatile memory or non-volatile memory [
47], but not both. Therefore, existing
hardware description languages (HDLs) (such as VHDL or Verilog) do not provide specific keywords to make a differentiation between a volatile state element and a non-volatile state element. This situation prevents hardware designers from using FPGAs to fast-prototype their logic designs targeting intermittent computing, which include both volatile and non-volatile logic. To the best of our knowledge, the state of the art does not propose a solution to emulate transiently powered intermittently operating hardware architectures using off-the-shelf FPGAs.
In this article, we introduce a new FPGA-based framework, named NORM (
Non-volatile mem
ORy e
Mulator), that can be used to emulate any intermittent computing system with fast non-volatile memory. NORM can be used to debug and perform functional verification of non-volatile computing logic. Moreover, NORM can be integrated into a working intermittent computing system in place of a yet-to-be-built non-volatile computing logic so the whole system can be tested. NORM comprises auxiliary blocks that
(1)
simulate the behavior of irregular power supply typical to energy-harvesting intermittent systems;
(2)
simulate the persistence of the non-volatile micro-architectural elements as well as the long delay of reading/write operations (as compared to those of volatile memory); and
(3)
approximate the power consumption of the emulated technology.
Our simulations showed that NORM can be used to emulate and validate FeRAM-based transiently powered hardware architectures successfully. We release the source code of NORM (implemented in VHDL) in a public repository [
32] to increase the impact of this work and enable the community to fast-prototype and validate transiently powered non-volatile hardware architectures.
The rest of this article is organized as follows. In Section
2, we provide the related work on intermittent computing and NVPs. We present the general description of NORM in Section
3. Section
4 presents the implementation details of NORM, and Section
5 presents our evaluation based on simulations. Finally, Section
6 concludes our article and proposes future work.
2 Background and Related Work
A new class of embedded devices that can sense, compute, and communicate without batteries has emerged. As an example, RF-powered batteryless sensors [
11,
51] solely rely on the harvested energy of ambient radio-frequency waves in the air (see Figure
1). These batteryless devices, which can feature even more complex sensors such as cameras [
31], comprise ultra-low-power microcontrollers (e.g., MSP430FR5969 [
49]) whose main architectural components, e.g., registers and main memory, are volatile. These volatile processors include also a non-volatile secondary memory, e.g., FeRAM [
50], to store information that will persist upon power failures. Despite several ultra-low-power operation modes of these microcontrollers (e.g., sleep mode requires current on the order of a few
\(\mu\)A), batteryless sensors cannot be available continuously using unreliable and sporadic energy sources [
1,
41]. Frequent and unpredictable power failures reset the volatile state of the device, prevent the forward progress of computation, and hinder its memory consistency. Therefore, programs and libraries designed for continuously powered computers cannot run on batteryless sensors correctly due to the frequent loss of volatile state and, in turn, failed computation.
2.1 Intermittent Computing with Volatile Processors
Volatile microcontrollers employ
software-aided solutions to mitigate the effects of unpredictable power failures. Generally speaking, these solutions back up the volatile state of the processor into non-volatile memory to recover computation from where it left upon a power failure. Moreover, they ensure memory consistency so that the backed-up state in the non-volatile memory will not be different than the volatile state, or vice versa. Current literature proposed mainly two software-based approaches. One approach is to store the computation state in non-volatile memory via
checkpoints paired with C programs [
2,
3,
16,
17,
18,
23,
27,
38,
52]. Upon recovery from a power failure, the computation continues from the consistent volatile state stored in the latest successful checkpoint. Another approach is to use a custom
task-based programming model to develop intermittent applications, which eliminates the high cost of checkpointing [
4,
15,
26,
28,
29,
39,
62]. In this model, programmers implement the applications as a collection of idempotent and atomic tasks by employing an explicit task-based control flow. Individual task sizes should not exceed the capacity of the capacitor to ensure forward progress. However, software-aided recovery solutions require transmitting data from built-in volatile components of the processor, e.g., registers, to non-volatile memory. This operation suffers from low speed, e.g., 200
\(\mu\)s [
42], and a large energy penalty that grows with the size of volatile elements [
42,
45]. Moreover, these solutions require programmers to structure their software by considering programming models designed for intermittent systems, e.g, task-based programming [
4,
62].
2.2 Non-volatile Logic and Processors
NVPs bring non-volatile memory into the micro-architecture of the processor. Non-volatile logic enables the backup and recovery operations from a power failure to be transparent to the programmer. Moreover, backup and recovery introduce less overhead than software-aided solutions, e.g., only on the order of a few
\(\mu\)s [
20,
57]. Since backup and retention operations are fast as compared to the software-aided solutions, NVPs reduce leakage power by shutting down the system when the device is idle [
1].
Due to the higher power required for non-volatile memory read/write operations, NVPs might also consume more power as compared to volatile processors [
25]. Therefore, there is room for micro-architecture-level optimizations to reduce their energy consumption. To decrease the energy requirements of NVPs, recent works proposed
(1)
using more efficient memory technologies, e.g.,
Resistive RAM (ReRAM) [
22] and hybrid CMOS/ferroelectric non-volatile flipflop [
44];
(2)
embedding non-volatility into the computing logic, e.g., transistor level, using NCFET [
20] so that logic gates could also store their states intrinsically in a non-volatile fashion; and
(3)
using new backup strategies, e.g., backup at every processor cycle or on-demand backup [
24,
25], to decrease backup frequency to save energy.
These efforts provide implementation technology-level energy optimizations. However, as of now, we do not have tools to fast-prototype non-volatile logic and observe optimization strategies targeting different non-volatile intermittent computing architectures and processors.
2.3 Non-volatile Memory Simulation/Emulation Frameworks
There are studies, e.g., [
9,
19,
34,
63], that provide the emulation of different non-volatile main memory technologies. These studies present techniques to assess the system’s performance concerning different non-volatile memory technologies. Unfortunately, they do not apply to intermittent computing systems. There are studies, e.g., [
12,
36], that proposed simulators for non-volatile memory and logic. As an example, NVPSim [
12] can simulate the architectural components forming a non-volatile processor by allowing users to select only different configurations (e.g., cache size and organization) for the main high-level components in a processor. Fused [
43] is designed to assess the performance of intermittent systems by providing simulations only at a high level of abstraction. The authors in [
58] describe a system-level simulator supporting flexible energy behavior configuration for both the processor and peripherals.
Contrarily to the mentioned studies, this work enables the assessment of non-volatile features in any digital hardware design that includes a combination of volatile and non-volatile logic. We provide full flexibility for the users to evaluate, validate, and fast-prototype any HDL design targeting intermittent computing systems.
2.4 Field-programmable Gate Arrays (FPGAs)
FPGAs are used in many applications due to the increased cost and time associated with the custom
application-specific integrated circuit (ASIC) design. FPGAs are useful for fast-prototyping custom processor architectures and their behavioral verification. Several popular volatile processor architectures, such as RISC-V, have implementations using popular HDLs (e.g., Verilog) that can run on FPGAs. The OpenFPGA framework [
46] opened the door for automating the design, verification, and layout of different FPGA architectures. OpenFPGA enabled end-users to port their designs to any FPGAs that OpenFPGA can support. Some recent studies target reducing the energy consumption of FPGAs. As an example, the authors in [
47] proposed an ReRAM-based FPGA architecture, which is inherently fully non-volatile. They replaced the SRAM-based circuits in FPGA architectures with
Resistive random-access memory (ReRAM)-based implementations. ReRAM-based FPGAs can be powered off during sleep mode and instantly powered on when needed. This strategy reduces the energy requirements.
Using FPGAs to prototype intermittent computing architectures is an open issue. Hardware designs that operate intermittently are composed of volatile and non-volatile logic elements. Current FPGAs provide either volatile or non-volatile state elements, but not both. We do not have mixed memory volatility in the fabric of FPGA architectures. Hence, there are no specific HDL keywords to differentiate a non-volatile register from a volatile one. As of now, hardware designers cannot represent hardware that operates intermittently by using existing HDLs. They cannot validate their designs through simulations. This work focuses on these deficiencies and fills the existing gap in the literature by proposing a novel framework that facilitates the design and validation of intermittently operating hardware.
6 Conclusions and Future Work
In this article, we introduced NORM, which is an FPGA-based emulation framework. NORM can emulate any intermittent computing system that exploits fast non-volatile memories to store temporary status in case of supply failures. NORM comprises auxiliary blocks that simulate the behavior of an unregular power supply, which is typical to any batteryless transient computing system powered by energy harvesters. NORM takes into account the delay of the NVMs and approximates the energy consumption of the emulated technology. Our evaluation showed that NORM can be used to emulate and validate an FeRAM-based custom non-volatile digital logic successfully. We conclude that NORM is appropriate for verifying the behavior of such new types of systems over long time scales, typical of duty-cycling energy-neutral Internet of Things (IoT) applications.
Future studies can target the emulation of a more sophisticated non-volatile logic, such as a non-volatile processor architecture. The RISC-V processor family is freely available and a good candidate for IoT computing applications. A non-volatile RISC-V can be implemented, and its behavioral verification can be done using the proposed FPGA architecture. Moreover, the accuracy of the energy approximation block can be observed by comparing the actual ASIC implementation of the processor concerning its implementation in the proposed emulation architecture.