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

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc/] [tests/] [riscv-compliance/] [riscv-test-suite/] [rv32ui/] [rv64ui/] [sb.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
# sb.S
5
#-----------------------------------------------------------------------------
6
#
7
# Test sb instruction.
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
 
16
RVTEST_RV64U
17
RVTEST_CODE_BEGIN
18
 
19
  #-------------------------------------------------------------
20
  # Basic tests
21
  #-------------------------------------------------------------
22
 
23
  TEST_ST_OP( 2, lb, sb, 0xffffffffffffffaa, 0, tdat );
24
  TEST_ST_OP( 3, lb, sb, 0x0000000000000000, 1, tdat );
25
  TEST_ST_OP( 4, lh, sb, 0xffffffffffffefa0, 2, tdat );
26
  TEST_ST_OP( 5, lb, sb, 0x000000000000000a, 3, tdat );
27
 
28
  # Test with negative offset
29
 
30
  TEST_ST_OP( 6, lb, sb, 0xffffffffffffffaa, -3, tdat8 );
31
  TEST_ST_OP( 7, lb, sb, 0x0000000000000000, -2, tdat8 );
32
  TEST_ST_OP( 8, lb, sb, 0xffffffffffffffa0, -1, tdat8 );
33
  TEST_ST_OP( 9, lb, sb, 0x000000000000000a, 0,  tdat8 );
34
 
35
  # Test with a negative base
36
 
37
  TEST_CASE( 10, x5, 0x78, \
38
    la  x1, tdat9; \
39
    li  x2, 0x12345678; \
40
    addi x4, x1, -32; \
41
    sb x2, 32(x4); \
42
    lb x5, 0(x1); \
43
  )
44
 
45
  # Test with unaligned base
46
 
47
  TEST_CASE( 11, x5, 0xffffffffffffff98, \
48
    la  x1, tdat9; \
49
    li  x2, 0x00003098; \
50
    addi x1, x1, -6; \
51
    sb x2, 7(x1); \
52
    la  x4, tdat10; \
53
    lb x5, 0(x4); \
54
  )
55
 
56
  #-------------------------------------------------------------
57
  # Bypassing tests
58
  #-------------------------------------------------------------
59
 
60
  TEST_ST_SRC12_BYPASS( 12, 0, 0, lb, sb, 0xffffffffffffffdd, 0, tdat );
61
  TEST_ST_SRC12_BYPASS( 13, 0, 1, lb, sb, 0xffffffffffffffcd, 1, tdat );
62
  TEST_ST_SRC12_BYPASS( 14, 0, 2, lb, sb, 0xffffffffffffffcc, 2, tdat );
63
  TEST_ST_SRC12_BYPASS( 15, 1, 0, lb, sb, 0xffffffffffffffbc, 3, tdat );
64
  TEST_ST_SRC12_BYPASS( 16, 1, 1, lb, sb, 0xffffffffffffffbb, 4, tdat );
65
  TEST_ST_SRC12_BYPASS( 17, 2, 0, lb, sb, 0xffffffffffffffab, 5, tdat );
66
 
67
  TEST_ST_SRC21_BYPASS( 18, 0, 0, lb, sb, 0x33, 0, tdat );
68
  TEST_ST_SRC21_BYPASS( 19, 0, 1, lb, sb, 0x23, 1, tdat );
69
  TEST_ST_SRC21_BYPASS( 20, 0, 2, lb, sb, 0x22, 2, tdat );
70
  TEST_ST_SRC21_BYPASS( 21, 1, 0, lb, sb, 0x12, 3, tdat );
71
  TEST_ST_SRC21_BYPASS( 22, 1, 1, lb, sb, 0x11, 4, tdat );
72
  TEST_ST_SRC21_BYPASS( 23, 2, 0, lb, sb, 0x01, 5, tdat );
73
 
74
  li a0, 0xef
75
  la a1, tdat
76
  sb a0, 3(a1)
77
 
78
  TEST_PASSFAIL
79
 
80
RVTEST_CODE_END
81
 
82
  .data
83
tdat:
84
tdat1:  .byte 0xef
85
tdat2:  .byte 0xef
86
tdat3:  .byte 0xef
87
tdat4:  .byte 0xef
88
tdat5:  .byte 0xef
89
tdat6:  .byte 0xef
90
tdat7:  .byte 0xef
91
tdat8:  .byte 0xef
92
tdat9:  .byte 0xef
93
tdat10: .byte 0xef
94
 
95
RV_COMPLIANCE_DATA_BEGIN
96
test_res:
97
    .fill 40, 4, -1
98
RV_COMPLIANCE_DATA_END

powered by: WebSVN 2.1.0

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