Added memory access type for mmu
This commit is contained in:
+3
-6
@@ -682,7 +682,7 @@ __attribute__((noreturn)) void cpu_loop(rv32_cpu_t* cpu)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Aquire CPU and memory mutex
|
||||
// Aquire CPU mutex
|
||||
pthread_mutex_lock(&cpu0_mutex);
|
||||
|
||||
// No simulation ticks left : wakeup people waiting on sim end
|
||||
@@ -692,8 +692,6 @@ __attribute__((noreturn)) void cpu_loop(rv32_cpu_t* cpu)
|
||||
while(!cpu->sim_ticks_left)
|
||||
pthread_cond_wait(&cpu0->sim_condition, &cpu0_mutex);
|
||||
|
||||
// pthread_mutex_lock(&memory_mutex);
|
||||
|
||||
// Fetch
|
||||
raw_instruction_t raw_instruction;
|
||||
if(cpu->pc > memory_size - 4)
|
||||
@@ -701,7 +699,7 @@ __attribute__((noreturn)) void cpu_loop(rv32_cpu_t* cpu)
|
||||
fprintf(stderr, "Error: instruction fetch: pc is out of addressable memory\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
raw_instruction.data = mem_read32(cpu->pc);
|
||||
raw_instruction.data = mem_fetch(cpu->pc);
|
||||
|
||||
// Decode
|
||||
instruction_t instruction;
|
||||
@@ -726,8 +724,7 @@ __attribute__((noreturn)) void cpu_loop(rv32_cpu_t* cpu)
|
||||
if(cpu->sim_ticks_left != (-1))
|
||||
cpu->sim_ticks_left--;
|
||||
|
||||
// Let go of cpu and memory mutex
|
||||
// pthread_mutex_unlock(&memory_mutex);
|
||||
// Let go of cpu mutex
|
||||
pthread_mutex_unlock(&cpu0_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user