The invention belongs to the technical field of
chip testing, and discloses a testing device and method for an RISC-V
chip instruction cache, and the device comprises a CPU core, a
cache controller, a user-defined instruction execution module, and an instruction cache. The CPU core is used for receiving a test starting address and a test ending address; sending a clearing instruction to the
instruction buffer; and executing a test step: generating an instruction reading address according to the test starting address, sending the instruction reading address to the
cache controller until a test ending address, receiving a test instruction of the
cache controller, judging whether the test instruction is a self-defined instruction, and if so, sending the test instruction to a self-defined instruction execution module to obtain an instruction execution result; and executing the test step again, and obtaining an instruction cache test result according to an obtained instruction execution result. The RISC-V
chip instruction buffer test method and the RISC-V chip
instruction buffer test device can realize comprehensive test of the RISC-V chip instruction buffer under the condition of avoiding increasing a large amount of chip cost area.