OpenCores
URL https://opencores.org/ocsvn/fwrisc/fwrisc/trunk

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc/] [tests/] [riscv-compliance/] [riscv-test-suite/] [rv32mi/] [rv64mi/] [mcsr.S] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mballance
# 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 "compliance_test.h"
12
#include "compliance_io.h"
13
#include "aw_test_macros.h"
14
 
15
#RVTEST_RV64S
16
RVTEST_RV64M
17
 
18
RVTEST_CODE_BEGIN
19
  # Check that mcpuid reports the correct XLEN
20
#if __riscv_xlen == 64
21
  TEST_CASE(2, a0, 0x2, csrr a0, misa; srl a0, a0, 62)
22
#else
23
  TEST_CASE(2, a0, 0x1, csrr a0, misa; srl a0, a0, 30)
24
#endif
25
 
26
  # Check that mhartid reports 0
27
  TEST_CASE(3, a0, 0x0, csrr a0, mhartid)
28
 
29
  # Check that reading the following CSRs doesn't cause an exception
30
  csrr a0, mimpid
31
  csrr a0, marchid
32
  csrr a0, mvendorid
33
 
34
  # Check that writing hte following CSRs doesn't cause an exception
35
  li t0, 0
36
  csrs mtvec, t0
37
  csrs mepc, t0
38
 
39
  TEST_PASSFAIL
40
 
41
RVTEST_CODE_END
42
 
43
  .data
44
RV_COMPLIANCE_DATA_BEGIN
45
test_res:
46
    .fill 40, 4, -1
47
RV_COMPLIANCE_DATA_END

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.