Fault targets¶
The fault target is the piece of machine state a fault corrupts: a register, a byte of memory, a cache line, an entry of a pipeline structure. The campaign key fault selects it. An HFIM campaign applies one fault per run, at an instant drawn from the campaign seed, and compares each run with a fault-free golden run of the same program to decide its outcome.
fault: register
target_registers: [a0, a1, a2, a3]
fault_model: single_bit_flip
This campaign flips one bit of one of four registers in every run. Changing fault to another value from the table below, with that target's keys, points the same campaign at other state.
Choosing a target¶
Each page covers one target, or a group of values that share one mechanism. The pages run from the outside of the machine inward: architectural state first, then caches, main memory, the pipeline and coherence.
| Page | What it corrupts | fault values |
Backends |
|---|---|---|---|
| Registers | one integer or floating-point register, or the program counter | register |
QEMU, gem5, OVP, hardware |
| Control and status registers | one bit of a named CSR (control and status register), from a replayed fault list | csr |
OVP |
| Memory | bits of a byte or word of program memory: a variable, a section, an address range or the stack | memory |
QEMU, gem5, OVP, hardware |
| Cache data | one byte of a valid line in the L1 data, L1 instruction or L2 cache | cache_l1d, cache_l1i, cache_l2 |
gem5 |
| Cache tags | the tag of a valid L1D line, so the line answers for the wrong address, or a shadow copy of that tag that logs false hits and misses | cache_tag, cache_tag_parity |
gem5 |
| Cache ECC check bits | the check bits that guard one byte of a cache line, so the error-correcting code (ECC) decoder miscorrects or flags the next read | ecc_parity_l1d, ecc_parity_l1i, ecc_parity_l2 |
gem5 |
| DRAM | one byte, or a row, of main memory below the caches, under a DRAM error model | dram |
gem5 |
| NVM tag store and endurance | a lost writeback or a toggled line state in non-volatile main memory (NVM) | nvm_tags |
gem5 on Ruby with NVMain |
| Physical registers | the 64-bit value of a physical register that a rename map names | phys_reg |
gem5, DerivO3CPU |
| Rename map | the committed mapping from an architectural register to a physical register | rename_map |
gem5, DerivO3CPU |
| Reorder buffer | the ready-operand counter of one reorder buffer (ROB) entry | rob |
gem5, DerivO3CPU |
| Load/store queue | the data register of the oldest store in the store queue | lsq |
gem5, DerivO3CPU |
| Branch predictor | the return address stack, by popping one to three entries | branch_pred |
gem5, DerivO3CPU |
| TLB | one bit of the physical page of a translation lookaside buffer (TLB) entry; injects nothing in syscall-emulation mode | tlb |
gem5 |
| Coherence state | one of the three coherence state bits of a line in a classic cache | coherence |
gem5, classic caches |
| Ruby controllers | the data of one line as a Ruby cache controller, the directory or a message buffer holds it | ruby_tbe, ruby_mshr, ruby_directory, ruby_message_buffer |
gem5 on Ruby |
Every target except registers, memory and CSRs exists only in gem5: set simulator_backend: gem5, or gem5-ruby for nvm_tags and the ruby_* targets. On QEMU, a cache data target stops at setup with Set simulator_backend: gem5 to use cache injection. Backend setup and every gem5 parameter: gem5 backend.
One campaign, one target family¶
Some keys belong to one family of targets. A campaign that sets a key of another family is rejected before anything runs, with an error that names the key:
fault: memory does not use these keys: target_registers. One campaign = one fault type; for several, use a batch campaign file with one entry each, submitted to a Server.
| Family | fault values |
Keys of the family |
|---|---|---|
| register | register |
target_registers |
| memory | memory |
memory_start, memory_end, section |
| cache | cache_*, ecc_parity_* |
cache_set, cache_way, cache_level_sweep, cache_ecc_enabled, cache_ecc_scope |
Every other target accepts none of these keys. To turn a register campaign into a memory campaign, add the memory window and delete target_registers. A sweep over several targets is a batch with one entry per target.
Bits that can flip¶
The campaign seed draws the bit positions for most targets. A few gem5 targets choose their own cell or bit with gem5's random generator, and some change no bit at all. The table lists the range of each target and who picks inside it.
| Target | Bit positions | Picked by |
|---|---|---|
register |
0 to 63 on a 64-bit hart; 0 to 31 with xlen: 32 on QEMU and hardware; float registers always 0 to 63 |
campaign seed |
csr |
0 to 63 | the fault list row |
memory |
0 to 8 * memory_access_size - 1 on QEMU, OVP and hardware; on gem5, 0 to 7 with the default memory_access_size: 1 |
campaign seed |
cache_l1d, cache_l1i, cache_l2 |
0 to 7 of one byte; the campaign seed also picks the byte, gem5 picks the line | campaign seed |
cache_tag, cache_tag_parity |
tag bits 0 to 7; gem5 picks the line | campaign seed |
ecc_parity_* |
0 to 7 of the check-bit mask of one byte; the campaign seed also picks the byte, gem5 picks the line | campaign seed |
dram |
set by dram_error_model, inside one byte, or one bit in each of several bytes of a row |
gem5, seeded per injection from the campaign seed |
nvm_tags |
no bit; the low bit of fault_mask selects the mode |
campaign file |
phys_reg, lsq |
0 to 63; bit_width narrows the range |
campaign seed |
rename_map |
no bit; a register index is rewritten | gem5 |
rob |
all 8 bits of one counter | gem5 picks the entry |
branch_pred |
no bit; one to three entries are popped | gem5 |
tlb |
one bit of the physical address, from bit 12 to the top bit of the simulated memory | gem5 |
coherence |
one of three state bits | gem5 |
ruby_tbe, ruby_mshr, ruby_directory |
drawn from 0 to 63, then folded to 0 to 7 of one byte | campaign seed |
ruby_message_buffer |
the whole 64-byte data block of each matching message | gem5 |
multi_bit_count flips several distinct bits within these ranges, drawn independently, so they are not adjacent by assumption. What happens to each drawn bit is the fault model: Fault models.
See also: Fault models · gem5 backend · Configuration keys