Skip to content

Commit

Permalink
fix(mip): fix rtl guidance for mip.lcofi logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislzh committed Oct 10, 2024
1 parent ffe101a commit e1e4d9c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions include/isa.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ void *isa_difftest_query_br_log(void);
#ifdef CONFIG_MULTICORE_DIFF
void isa_difftest_set_mhartid(int n);
#endif
void isa_update_mip(unsigned lcofip);

#endif
1 change: 1 addition & 0 deletions src/cpu/difftest/ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ void difftest_virtual_interrupt_is_hvictl_inject(bool virtualInterruptIsHvictlIn

void difftest_non_reg_interrupt_pending(void *nonRegInterruptPending) {
memcpy(&cpu.non_reg_interrupt_pending, nonRegInterruptPending, sizeof(struct NonRegInterruptPending));
isa_update_mip(cpu.non_reg_interrupt_pending.lcofi_req);
}

void difftest_enable_debug() {
Expand Down
4 changes: 4 additions & 0 deletions src/isa/riscv64/difftest/ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,7 @@ void isa_difftest_set_mhartid(int n) {
mhartid->val = n;
}
#endif

void isa_update_mip(unsigned lcofip) {
mip->lcofip = lcofip;
}
27 changes: 14 additions & 13 deletions src/isa/riscv64/local-include/csr.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,19 +581,20 @@ CSR_STRUCT_START(mideleg)
CSR_STRUCT_END(mideleg)

CSR_STRUCT_START(mip)
uint64_t usip : 1;
uint64_t ssip : 1;
uint64_t vssip: 1;
uint64_t msip : 1;
uint64_t utip : 1;
uint64_t stip : 1;
uint64_t vstip: 1;
uint64_t mtip : 1;
uint64_t ueip : 1;
uint64_t seip : 1;
uint64_t vseip: 1;
uint64_t meip : 1;
uint64_t sgeip: 1;
uint64_t usip : 1; // [0]
uint64_t ssip : 1; // [1]
uint64_t vssip : 1; // [2]
uint64_t msip : 1; // [3]
uint64_t utip : 1; // [4]
uint64_t stip : 1; // [5]
uint64_t vstip : 1; // [6]
uint64_t mtip : 1; // [7]
uint64_t ueip : 1; // [8]
uint64_t seip : 1; // [9]
uint64_t vseip : 1; // [10]
uint64_t meip : 1; // [11]
uint64_t sgeip : 1; // [12]
uint64_t lcofip: 1; // [13]
CSR_STRUCT_END(mip)

CSR_STRUCT_START(mie)
Expand Down

0 comments on commit e1e4d9c

Please sign in to comment.