Skip to content

Fault models

A fault model says how the bits of the target change. The target, chosen with fault, says where the fault lands; the model says what happens there. An HFIM campaign applies one fault per run and compares each run with a fault-free golden run of the same program.

fault: memory
target_symbol: result
fault_model: stuck_at_1
multi_bit_count: 2

Each run of this campaign forces two bits of one byte of result to 1. Three keys set the model: fault_model (what happens to each bit), multi_bit_count (how many bits) and fault_persistence (whether the change is applied once or held). A fault: dram campaign on gem5 uses dram_error_model instead.

Choosing a model

The pages run from the simplest model to the most complex.

Page What it changes Keys
Single-bit flip inverts one bit once: a single event upset (SEU) fault_model: single_bit_flip
Multi-bit applies the fault model to several distinct bits of one value in one write: a multiple-cell upset multi_bit_count
Stuck-at forces one bit to 0 or 1, once or for the rest of the run, plus the OVP inverted cell fault_model: stuck_at_0, stuck_at_1, fault_persistence, ovp_permanent_model
Combined fault models the combinations of the three keys HFIM accepts, and the physical event each one stands for fault_model, multi_bit_count, fault_persistence
DRAM error models device-level errors in main memory: one bit, a burst of neighboring bits, several bytes of a row, or a leaked charge dram_error_model

Bit-level operations

For each drawn bit position b, the backend reads the target, applies one operation and writes the result back:

fault_model Operation The bit afterwards Models
single_bit_flip value XOR (1 << b) the opposite of what it was a single event upset
stuck_at_0 value AND NOT (1 << b) 0, whatever it was a cell held at 0
stuck_at_1 value OR (1 << b) 1, whatever it was a cell held at 1

A stuck-at fault on a bit that already holds the stuck value leaves the target unchanged, so its row in injections.csv has original_value equal to faulty_value. That row is a correct injection, not a failed one.

The campaign seed draws the bits, so the same seed draws the same bits on every rerun. With multi_bit_count: N, HFIM draws N distinct positions independently over the bits the target allows and applies the operation to all of them in one write. Which positions a target allows: Bits that can flip.

Backend support

Model QEMU gem5 OVP Hardware
single_bit_flip yes yes yes yes
stuck_at_0, stuck_at_1 yes, applied once yes yes yes, applied once
multi_bit_count above 1 yes yes yes yes
fault_persistence: permanent rejected at load re-applied after every committed instruction, on register targets only stuck-at, re-applied after every program write to the target rejected at load
ovp_permanent_model: inverted_cell rejected at load rejected at load yes rejected at load
dram_error_model yes, classic memory system

Some gem5 targets do not use the fault model at all, because they change a structure instead of flipping a stored value: rename_map, rob, branch_pred, tlb, coherence, nvm_tags and ruby_message_buffer. Each target page says which models it accepts in its first line.

Keys

Key Values Default
fault_model single_bit_flip, stuck_at_0, stuck_at_1 required
multi_bit_count 1 to the bit width of the target 1
fault_persistence transient, permanent (gem5, OVP) transient
ovp_permanent_model inverted_cell (OVP, with single_bit_flip and permanent) none
bit_width 8, 16, 32, 64 derived from the target
dram_error_model none, single_bit, multi_bit, row, retention (gem5, fault: dram) none

To inject the exact faults of an earlier campaign instead of drawing new ones, see Replaying exact faults.

See also: Fault targets · Fault classification · Configuration keys