Skip to content

Rename map

gem5 only, with cpu_model: DerivO3CPU. Fault models: any; the injector ignores the model and the bit. fault: rename_map.

An out-of-order processor has more physical registers than the instruction set has architectural ones. A table called the rename map records which physical register holds each architectural register at each moment, so a0 might live in physical register 174 now and in another one a few instructions later. This target rewrites one entry of that table: one integer register, x1 to x31, is made to point at a different physical register. As in every HFIM campaign, each run applies one fault, and HFIM compares the result with a fault-free golden run of the same program.

The fault does not change any value. The right value is still in the old physical register; the register name now leads somewhere else.

The committed rename map sends a0 to physical register p174, which holds a0's value. HFIM rewrites the entry to p126, so reads of a0 through this map now return p126's contents while p174 keeps the right value. The committed rename map sends a0 to physical register p174, which holds a0's value. HFIM rewrites the entry to p126, so reads of a0 through this map now return p126's contents while p174 keeps the right value.

The a0 entry (x10, physical register 174 rewritten as 126) is the pair a real gem5 injection recorded; the other entries and the values are schematic.

How HFIM applies the fault

gem5's out-of-order CPU model, DerivO3CPU, keeps two rename maps. The pipeline renames instructions with a speculative map. A second map, the committed map, follows only the instructions that have retired, and it is the one this target rewrites.

At the injection instant, a committed-instruction count drawn from the campaign seed, the gem5 controller picks one architectural integer register from x1 to x31 (never x0, which RISC-V hardwires to zero). It then picks a physical integer register other than the current one, anywhere in the physical register file (256 integer registers, gem5's default for DerivO3CPU), and writes that index into the committed map entry. Both picks come from gem5's own random generator, not from the campaign seed.

Which reads see the wrong register:

Who reads the register Through which map Sees the fault
ordinary instructions in the pipeline speculative no
a system call reading its arguments or writing its result committed yes
the registers HFIM writes to state_dump.json when the run ends committed yes

When an instruction that writes the same architectural register retires, gem5 sets the committed entry to that instruction's physical register, and the fault is gone.

The new physical register can be one that backs another architectural register, so two names share one register, or a free one. The injector does not touch the free list, so renaming can later hand a free register to a new instruction, and what the faulted name reads changes again without the program touching it.

A campaign

The gem5 template does not ship a rename-map campaign. This one is its campaigns/fibonacci/cache_tag.yaml with the target, the name and the CPU model changed. It applies one fault in each of 10 runs of the Fibonacci benchmark, whose 64-number result array is the output HFIM compares:

include: fibonacci.yaml

campaign_name: fibonacci-rename_map

simulator_backend: gem5
cpu_model: DerivO3CPU

seed: 7
num_injections: 10
num_workers: 1

target_types: [rename_map]
fault_model: single_bit_flip

timeout: 120
output_dir: results

Save it as campaigns/fibonacci/rename_map.yaml and run it from the template folder:

hfim run campaigns/fibonacci/rename_map.yaml

The cpu_model line is required. The template's board is a MinorCPU, an in-order model with no rename map.

What you see in the results

Each run writes one row of injections.csv, the comma-separated values (CSV) file of the campaign, and one folder, injection_NNNN/. In the row, target_type and target_name both read rename_map. original_value and faulty_value are not register contents: they are the old and new physical register indices, in hex. bit_position is the bit the faultlist drew, which this injector does not use.

The architectural register is only in the run's injection_report.json, in its target field. This excerpt comes from a gem5 run of a matrix-multiplication benchmark:

  "target": "rename_map[x10]",
  "original_value": "0x00000000000000ae",
  "faulty_value": "0x000000000000007e",

x10 is a0; 0xae and 0x7e are physical registers 174 and 126. The program in that run still passed its own result check.

The outcome follows from who reads the register before the program writes it again. The row is masked (the observables equal the golden run) when the program overwrites the register first, which ends the fault, or when nothing outside the pipeline reads it. A system call is the usual way the fault escapes: it reads an argument such as a buffer address or a length from the wrong physical register, or writes its return value into the wrong one, so the program never sees it. That can give an sdc (silent data corruption: a wrong result with no error reported) or a crash. Every outcome: Fault classification.

Keys

Key Values Default
fault (or target_types) rename_map required
cpu_model DerivO3CPU the board's cpu.model
fault_model any accepted value; ignored required
multi_bit_count accepted; ignored 1
fault_persistence accepted; ignored transient

Limits

  • DerivO3CPU only. On any other CPU model, gem5 stops at the injection instant with rename_map injection requires DerivO3CPU, writes no injection report, and the row is infrastructure_failure. HFIM does not check the CPU model before the campaign starts, so every row of such a campaign ends this way.
  • Only the committed map. Instructions in flight and the ones renamed next use the speculative map, which the fault leaves alone. The fault reaches the program only through system calls, and it ends at the next retired write of the register.
  • Not drawn from the campaign seed. The instant comes from the seed. The register and the wrong physical register come from gem5's random generator, which starts from the same seed in every gem5 run, so a campaign cannot choose them and a faultlist replay reproduces only the instant.
  • A new index, not a flipped bit. A real upset in the rename table flips one bit of the stored index, so the wrong register differs from the right one in one bit. HFIM picks any other physical register with equal chance.
  • The model is ignored. single_bit_flip, stuck_at_0 and stuck_at_1 all give the same fault, and multi_bit_count and fault_persistence: permanent have no effect.
  • Integer registers of thread 0 only. Floating-point registers and other hardware threads are never targeted.
  • The free list is not updated. The new physical register stays on the free list, so renaming can give it to another instruction while the faulted entry still points at it. The fault is a structural corruption, not a consistent remapping.

See also: gem5 backend · Physical registers · Reorder buffer · Configuration keys