Bare-Metal Execution
Definition and Context
In post-silicon hardware validation, bare-metal execution describes a mode in which verification software runs directly on the silicon prototype without the support of an operating system, debuggers, device drivers, or other system software [1]. Because early silicon prototypes are typically unstable and lack a complete software stack, bare-metal execution is often the only option available to bring-up engineers, and tools intended to run in this mode must be deployed "in the very early stages of the post-silicon validation effort when the OS cannot yet be run on the system" [2].
A tool that operates in this mode is called a bare-metal exerciser. Threadmill, developed at IBM Research – Haifa, is one such tool [2].
Characteristics
Bare-metal execution environments used for post-silicon validation exhibit several defining characteristics:
- No operating system services — file systems, device drivers, and standard I/O facilities are unavailable [3].
- No debugging infrastructure — interactive debuggers and on-platform observability mechanisms are typically absent or extremely limited [1].
- Limited memory and state — some platforms (e.g., on-wafer testers) provide very limited memory for programs and data [3].
- High overhead for memory and state operations — loading and offloading memory and state information is expensive because no OS services can mediate the transfers [3].
- Real-time execution speed — once running, bare-metal code executes at full silicon speed without OS-induced jitter [3].
Design Implications for Tools
The constraints of bare-metal execution drive several design decisions for any tool that must run in this mode:
- Simplicity — Because hardware failures are hard to debug without observability tools, the exerciser itself must be simple software [2].
- On-platform self-sufficiency — A bare-metal exerciser, once loaded on silicon, generates, executes, and checks tests "indefinitely" without further interaction with the environment [4].
- Lightweight generation engine — Because silicon time is expensive, the on-platform test generation engine must be fast and light, in contrast to more sophisticated pre-silicon generators [2].
- Pre-computed payloads — Heavy computations such as floating-point operand generation are performed off-platform; only their results are embedded in the exerciser image [3].
- Minimal interaction with environment — The tool should avoid operations such as reading files from I/O devices, which are not supported in bare-metal mode [2].
- Lightweight checking — Reference models and complex checking machinery are less appealing because off-platform usage requires costly result offloading and on-line usage consumes precious execution cycles [2].
Checking Strategies Under Bare-Metal Constraints
Because traditional reference models are impractical, bare-metal exercisers typically rely on lightweight checking methods:
- Multi-pass consistency checking — Each test-case is executed multiple times and the end-of-test values of selected system resources (memory, registers) are compared for consistency [2].
- Injected and natural variability — The effectiveness of consistency checking depends on existing or injected differences between passes, such as variations in thread scheduling or system operation modes [2].
- User-specified self-checking procedures — Verification engineers may supply procedures that verify predictable aspects of an abstract scenario [2].
Host-Side Execution of Bare-Metal Images
Instruction-accurate instruction set simulators also commonly run bare-metal executables compiled for a target ISA, providing a host-side environment with no operating system on the emulated target. ExactStep, for example, supports RISC-V (RV32IMAC, RV64IMAC), MIPS (mips-i), and ARM-v6m targets and "is used to run bare-metal executables compiled for those ISAs" [5]. ExactStep executes one instruction per call to cpu::step(), prioritizing ease of extension for cosimulation, peripheral development, and SystemC bus interfacing over raw execution performance [5].
Related Concepts
For more detail on a concrete realization of a bare-metal exerciser, see the article on Threadmill, the tool used in the verification of the IBM POWER7 processor [1]. For an instruction-accurate simulator that runs bare-metal images on a host, see ExactStep [5].