ebreak now generates BREAKPOINT
This commit is contained in:
		@@ -5,6 +5,7 @@
 | 
			
		||||
 | 
			
		||||
#include "memory/memory.h"
 | 
			
		||||
#include "vriscv.h"
 | 
			
		||||
#include "exception.h"
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
@@ -515,10 +516,8 @@ static void cpu_execute(rv32_cpu_t* cpu, instruction_t* instruction)
 | 
			
		||||
							sbi_call(cpu, cpu->regs.a7, cpu->regs.a6);
 | 
			
		||||
							break;
 | 
			
		||||
						case IMM_EBREAK:
 | 
			
		||||
							// EBREAK : on debug, give back hand to debugger ; without debug, end simulation
 | 
			
		||||
							// In any way, we set back simulation ticks to 0
 | 
			
		||||
							cpu->sim_ticks_left = 1;
 | 
			
		||||
							cpu->pc -= 4;
 | 
			
		||||
							// EBREAK : generate a breakpoint exception
 | 
			
		||||
							exception_trigger(cpu, SCAUSE_BREAKPOINT);
 | 
			
		||||
							break;
 | 
			
		||||
						case IMM_SRET:
 | 
			
		||||
							fprintf(stderr, "SRET: We don't support that.\n");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user