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

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc/] [tests/] [riscv-compliance/] [riscv-test-suite/] [rv32ui/] [rv64ui/] [lw.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
# lw.S
5
#-----------------------------------------------------------------------------
6
#
7
# Test lw 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_LD_OP( 2, lw, 0x0000000000ff00ff, 0,  tdat );
24
  TEST_LD_OP( 3, lw, 0xffffffffff00ff00, 4,  tdat );
25
  TEST_LD_OP( 4, lw, 0x000000000ff00ff0, 8,  tdat );
26
  TEST_LD_OP( 5, lw, 0xfffffffff00ff00f, 12, tdat );
27
 
28
  # Test with negative offset
29
 
30
  TEST_LD_OP( 6, lw, 0x0000000000ff00ff, -12, tdat4 );
31
  TEST_LD_OP( 7, lw, 0xffffffffff00ff00, -8,  tdat4 );
32
  TEST_LD_OP( 8, lw, 0x000000000ff00ff0, -4,  tdat4 );
33
  TEST_LD_OP( 9, lw, 0xfffffffff00ff00f, 0,   tdat4 );
34
 
35
  # Test with a negative base
36
 
37
  TEST_CASE( 10, x5, 0x0000000000ff00ff, \
38
    la  x1, tdat; \
39
    addi x1, x1, -32; \
40
    lw x5, 32(x1); \
41
  )
42
 
43
  # Test with unaligned base
44
 
45
  TEST_CASE( 11, x5, 0xffffffffff00ff00, \
46
    la  x1, tdat; \
47
    addi x1, x1, -3; \
48
    lw x5, 7(x1); \
49
  )
50
 
51
  #-------------------------------------------------------------
52
  # Bypassing tests
53
  #-------------------------------------------------------------
54
 
55
  TEST_LD_DEST_BYPASS( 12, 0, lw, 0x000000000ff00ff0, 4, tdat2 );
56
  TEST_LD_DEST_BYPASS( 13, 1, lw, 0xfffffffff00ff00f, 4, tdat3 );
57
  TEST_LD_DEST_BYPASS( 14, 2, lw, 0xffffffffff00ff00, 4, tdat1 );
58
 
59
  TEST_LD_SRC1_BYPASS( 15, 0, lw, 0x000000000ff00ff0, 4, tdat2 );
60
  TEST_LD_SRC1_BYPASS( 16, 1, lw, 0xfffffffff00ff00f, 4, tdat3 );
61
  TEST_LD_SRC1_BYPASS( 17, 2, lw, 0xffffffffff00ff00, 4, tdat1 );
62
 
63
  #-------------------------------------------------------------
64
  # Test write-after-write hazard
65
  #-------------------------------------------------------------
66
 
67
  TEST_CASE( 18, x2, 2, \
68
    la  x5, tdat; \
69
    lw  x2, 0(x5); \
70
    li  x2, 2; \
71
  )
72
 
73
  TEST_CASE( 19, x2, 2, \
74
    la  x5, tdat; \
75
    lw  x2, 0(x5); \
76
    nop; \
77
    li  x2, 2; \
78
  )
79
 
80
  TEST_PASSFAIL
81
 
82
RVTEST_CODE_END
83
 
84
  .data
85
tdat:
86
tdat1:  .word 0x00ff00ff
87
tdat2:  .word 0xff00ff00
88
tdat3:  .word 0x0ff00ff0
89
tdat4:  .word 0xf00ff00f
90
 
91
RV_COMPLIANCE_DATA_BEGIN
92
test_res:
93
    .fill 40, 4, -1
94
RV_COMPLIANCE_DATA_END
95
 
96
 

powered by: WebSVN 2.1.0

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