The invention discloses a
hardware Trojan horse design method based on an RISC-V architecture processor
branch predictor, and relates to the field of processors and
hardware Trojan horses. The
hardware Trojan horse designed by the invention is divided into three parts: an interference triggering module, an interference
signal generator and a
control signal generator, and can implement hidden
attack on a
branch predictor in a processor. The hardware Trojan is based on a condition triggering mechanism, and allows an attacker to set a specific triggering condition according to the actual operation state and environment of the
system, so that the interference behavior is accurately controlled. When the interference triggering module detects a predefined triggering instruction, the interference
signal generator generates a specific interference
signal and injects the specific interference signal into the
branch predictor, so that normal work of the
branch predictor is interfered, and the performance of the processor is reduced. Aiming at the working principle of the
branch predictor, a targeted interference mode and a non-targeted interference mode are designed and can be flexibly selected according to requirements. The purposeless interference mode comprises a random interference mode and a branch historical interference mode, and disordered interference is carried out on a processor branch prediction mechanism. The purposeful interference mode directly interferes the normal operation process of the processor by modifying the content of the branch target buffer in a targeted manner. The hardware Trojan can effectively interfere the normal operation of the
branch predictor, so that the overall performance of the processor is remarkably reduced.