Overview
The Morpher Hardware Logic Block is the morpher component described in the MorFuzz implementation. The paper states that the morpher is implemented as software logic embedded in hardware and is used for instruction morphing in a RISC-V 64-bit MorFuzz prototype. It interacts with the hardware through the Verilog DPI interface to monitor processor internal state, hijack fetched instructions, and return morphed instructions. [C1]
Placement in the processor pipeline
The morpher performs field-aware mutation on fetched instructions. Rather than modifying the whole processor pipeline, it replaces only the wires between the fetch unit and the decode unit. This placement is intended to keep the morphed instruction's fetch-offset behavior consistent with the pipeline front-end and avoid requiring changes to the pipeline back-end. The authors state that this design avoids unwanted effects introduced by the morpher. [C2]
Deterministic morphing for co-simulation
To keep the DUT and reference model aligned, the morpher maintains a morphing map. The map uses the original instruction and its address as the key and the morphed instruction as the value. This allows the reference model to perform the same morphing as the DUT, so both models execute deterministic and identical morphed instructions. The paper states that this prevents instruction morphing from introducing false positives. [C3]
Pipeline-hazard-aware generation
The morpher also records the destination register field rd of instructions still executing in the pipeline using a sliding window. It can reuse registers from this window as later rs and rd fields, producing instruction streams with hazards such as read-after-write and write-after-write. The authors state that this lets MorFuzz generate inputs that spontaneously match microarchitectural details of the DUT. [C4]
Role in MorFuzz
Within MorFuzz, the morpher helps transform stimulus-template instructions into diverse and meaningful instruction streams while the DUT executes. MorFuzz also uses online co-simulation with an ISA simulator running in parallel with the DUT, comparing states after instruction execution; deterministic morphing is therefore important for keeping the DUT and reference model on the same input stream. [C3] [C5]