aboutsummaryrefslogtreecommitdiff
path: root/isa/rv64mi/mcsr.S
blob: c1e2cd3402946630dd3dcbe5c2d6f196e6678a72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# See LICENSE for license details.

#*****************************************************************************
# mcsr.S
#-----------------------------------------------------------------------------
#
# Test various M-mode CSRs.
#

#include "riscv_test.h"
#include "test_macros.h"

RVTEST_RV64M
RVTEST_CODE_BEGIN

  # Check that mcpuid reports RV64
  TEST_CASE(2, a0, 0x2, csrr a0, mcpuid; srl a0, a0, 62)

  # Check that mhartid reports 0
  TEST_CASE(3, a0, 0x0, csrr a0, mhartid)

  # Check that mimpid reports UC Berkeley
  TEST_CASE(4, a0, 0x1, csrr a0, mimpid; sll a0, a0, 48; srl a0, a0, 48)

  # Check that mtvec reports DEFAULT_MTVEC
  TEST_CASE(5, a0, DEFAULT_MTVEC, csrr a0, mtvec)

  TEST_PASSFAIL

RVTEST_CODE_END