|
|
@ -559,7 +559,10 @@ static void cpu_execute(rv32_cpu_t* cpu, instruction_t* instruction) |
|
|
|
fprintf(stderr, "CSRRC\n"); |
|
|
|
fprintf(stderr, "CSRRC\n"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case FUNC3_CSRRWI: |
|
|
|
case FUNC3_CSRRWI: |
|
|
|
fprintf(stderr, "CSRRWI\n"); |
|
|
|
// CSR atomic Read/Write Immediate (immediate in rs1)
|
|
|
|
|
|
|
|
uint32_t csrrwi_old_value = cpu->csr[instruction->immediate]; |
|
|
|
|
|
|
|
cpu->csr[instruction->immediate] = instruction->rs1; |
|
|
|
|
|
|
|
cpu->regs.x[instruction->rd] = csrrwi_old_value; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case FUNC3_CSRRSI: |
|
|
|
case FUNC3_CSRRSI: |
|
|
|
fprintf(stderr, "CSRRSI\n"); |
|
|
|
fprintf(stderr, "CSRRSI\n"); |
|
|
|