Skip to content

Commit

Permalink
csr_misa: mask U bit
Browse files Browse the repository at this point in the history
  • Loading branch information
wsipak committed Nov 4, 2024
1 parent 6280a76 commit 441d403
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions testbench/tests/csr_misa/csr_misa.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
})

int main () {
// bit [20] is set to 0 to skip checking U mode, to make this test work both with U mode and without U mode.
const unsigned long check_mask = ~(1 << 20);

const unsigned long golden = 0x40101104;
const unsigned long golden = 0x40101104 & check_mask;

// Read and print misa
unsigned long misa = read_csr(misa);
unsigned long misa = read_csr(misa) & check_mask;

printf("misa = 0x%08X vs. 0x%08X\n", misa, golden);

// Check
Expand Down

0 comments on commit 441d403

Please sign in to comment.