fix aluipc

This commit is contained in:
inixyz
2023-10-15 21:15:42 +03:00
parent a0c07323e8
commit 1ef81063a0
3 changed files with 2 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ int main(int argc, char** argv){
}
tinyriscv_hart hart;
hart.mem = malloc(hart.mem_size = mem_size);
hart.mem = calloc(hart.mem_size = mem_size, 1);
//file handling
FILE* file = fopen(file_path, "rb");

View File

@@ -154,7 +154,7 @@ void tinyriscv_step(tinyriscv_hart* hart){
switch(opcode){
case /*LUI*/ 0x37: hart->x[rd] = inst & 0xfffff000; break;
case /*AUIPC*/ 0x17: hart->x[rd] = hart->pc + (inst & 0xfffff000); break;
case /*AUIPC*/ 0x17: hart->x[rd] = hart->pc - 4 + (inst & 0xfffff000); break;
case /*JAL*/ 0x6f: hart->x[rd] = hart->pc; hart->pc += imm_j - 4; break;
case /*JALR*/ 0x67:
const u32 last_pc = hart->pc;

Binary file not shown.