Update to privileged architecture version 1.7
[riscv-tests.git] / isa / rv64mi / mcsr.S
1 # See LICENSE for license details.
2
3 #*****************************************************************************
4 # mcsr.S
5 #-----------------------------------------------------------------------------
6 #
7 # Test various M-mode CSRs.
8 #
9
10 #include "riscv_test.h"
11 #include "test_macros.h"
12
13 RVTEST_RV64M
14 RVTEST_CODE_BEGIN
15
16 # Check that mcpuid reports RV64
17 TEST_CASE(2, a0, 0x2, csrr a0, mcpuid; srl a0, a0, 62)
18
19 # Check that mhartid reports 0
20 TEST_CASE(3, a0, 0x0, csrr a0, mhartid)
21
22 # Check that mimpid reports UC Berkeley
23 TEST_CASE(4, a0, 0x1, csrr a0, mimpid; sll a0, a0, 48; srl a0, a0, 48)
24
25 # Check that mtvec reports DEFAULT_MTVEC
26 TEST_CASE(5, a0, DEFAULT_MTVEC, csrr a0, mtvec)
27
28 TEST_PASSFAIL
29
30 RVTEST_CODE_END