Added 'trace' option

This commit is contained in:
2023-10-08 22:54:09 +02:00
parent e7b521c589
commit c3fa088a38
3 changed files with 18 additions and 2 deletions

View File

@@ -676,8 +676,11 @@ void cpu_loop(rv32_cpu_t* cpu)
instruction_t instruction;
cpu_decode(raw_instruction, &instruction);
printf("0x%x: ", cpu->pc);
cpu_print_instruction(&instruction);
if(trace)
{
printf("0x%x: ", cpu->pc);
cpu_print_instruction(&instruction);
}
// Execute
cpu_execute(cpu, &instruction);