diff --git a/testbench/tests/csr_misa/csr_misa.c b/testbench/tests/csr_misa/csr_misa.c index c8bffb42d6e..8fd66d4f360 100644 --- a/testbench/tests/csr_misa/csr_misa.c +++ b/testbench/tests/csr_misa/csr_misa.c @@ -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