Instruction fetch error execution
Hi all,
Above is a snippet of disassembled code I was running on Ibex, and the associated section in the core tracer. At PC=0x8000087c, there should be a nop instruction, but Ibex shows execution of lui x19, 0xabd6c000 at this PC.
At the location in the waves where the cursor is, the active instr_grant and instr_rvalid are responding to the request corresponding to the address 0x8000087c. At the same time, the testbench randomly asserts an instr_error during the instruction fetch response, and randomizes the returned instr_rdata, as the request has returned with an error response. The random data here happens to be the value 0xabd6c9b7, which Ibex decodes as the same exact lui instruction from above. We should expect that this should not be executed then, since an error was returned to the core, but we can see that at time 4,113,000ns, Ibex raises the register file we_a_i write enable signal, and writes the data 0xabd6c000 to register 0x13, effectively completing execution of this random instruction data even though there was an instruction fetch error associated with this response. Immediately after completing execution of the randomly generated data at PC=0x8000087c, the core jumps to the instruction fetch exception handler at PC=80014000, and runs the handler code.
This issue only exists for the instruction fetch interface; for similar situations involving load/store errors that the testbench generates, Ibex will not commit load data to the regfile, or write store data to our memory model, and will only run the faulty memory instruction to completion once it has finished executing the associated exception handler code.
Thanks @udinator - I'll look into it