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

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc/] [tests/] [riscv-compliance/] [riscv-test-suite/] [rv32i/] [src/] [I-RF_size-01.S] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mballance
# RISC-V Compliance Test I-RF_size-01
2
#
3
# Copyright (c) 2017, Codasip Ltd.
4
# Copyright (c) 2018, Imperas Software Ltd. Additions
5
# All rights reserved.
6
#
7
# Redistribution and use in source and binary forms, with or without
8
# modification, are permitted provided that the following conditions are met:
9
#      * Redistributions of source code must retain the above copyright
10
#        notice, this list of conditions and the following disclaimer.
11
#      * Redistributions in binary form must reproduce the above copyright
12
#        notice, this list of conditions and the following disclaimer in the
13
#        documentation and/or other materials provided with the distribution.
14
#      * Neither the name of the Codasip Ltd., Imperas Software Ltd. nor the
15
#        names of its contributors may be used to endorse or promote products
16
#        derived from this software without specific prior written permission.
17
#
18
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Codasip Ltd., Imperas Software Ltd.
22
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
#
29
# Specification: RV32I Base Integer Instruction Set, Version 2.0
30
# Description: Testing size of register file.
31
 
32
#include "compliance_test.h"
33
#include "compliance_io.h"
34
#include "test_macros.h"
35
 
36
# Test Virtual Machine (TVM) used by program.
37
RV_COMPLIANCE_RV32M
38
 
39
# Test code region
40
RV_COMPLIANCE_CODE_BEGIN
41
 
42
    RVTEST_IO_INIT
43
    RVTEST_IO_ASSERT_GPR_EQ(x0, 0x00000000)
44
    #RVTEST_IO_WRITE_STR("# Test Begin Reserved regs ra(x1) a0(x10) t0(x5)\n")
45
 
46
    # ---------------------------------------------------------------------------------------------
47
    #RVTEST_IO_WRITE_STR("# Test part A1 - test registers x0 - x15\n");
48
 
49
    # Address for test results
50
    la      x16, test_A1_res
51
 
52
    # Test
53
    li      x0, 0x42726e6f
54
    li      x1, 0x56333249
55
    li      x2, 0x2d562052
56
    li      x3, 0x52697363
57
    li      x4, 0x736b7920
58
    li      x5, 0x73746572
59
    li      x6, 0x6e204e6f
60
    li      x7, 0x4d696c61
61
    li      x8, 0x6f646173
62
    li      x9, 0x6b794063
63
    li      x10, 0x74657273
64
    li      x11, 0x286e6f73
65
    li      x12, 0x656b2048
66
    li      x13, 0x20526164
67
    li      x14, 0x6f6d292c
68
    li      x15, 0x69702e63
69
 
70
    # Store results
71
    sw      x0, 0(x16)
72
    sw      x1, 4(x16)
73
    sw      x2, 8(x16)
74
    sw      x3, 12(x16)
75
    sw      x4, 16(x16)
76
    sw      x5, 20(x16)
77
    sw      x6, 24(x16)
78
    sw      x7, 28(x16)
79
    sw      x8, 32(x16)
80
    sw      x9, 36(x16)
81
    sw      x10, 40(x16)
82
    sw      x11, 44(x16)
83
    sw      x12, 48(x16)
84
    sw      x13, 52(x16)
85
    sw      x14, 56(x16)
86
    sw      x15, 60(x16)
87
 
88
    //
89
    // Assert
90
    //
91
    RVTEST_IO_CHECK()
92
    RVTEST_IO_ASSERT_GPR_EQ(x0, 0x00000000)
93
    #RVTEST_IO_ASSERT_GPR_EQ(x1, 0x80000370)
94
    RVTEST_IO_ASSERT_GPR_EQ(x2, 0x2D562052)
95
    RVTEST_IO_ASSERT_GPR_EQ(x3, 0x52697363)
96
    RVTEST_IO_ASSERT_GPR_EQ(x4, 0x736B7920)
97
    RVTEST_IO_ASSERT_GPR_EQ(x5, 0x6E204E6F)
98
    RVTEST_IO_ASSERT_GPR_EQ(x6, 0x6E204E6F)
99
    RVTEST_IO_ASSERT_GPR_EQ(x7, 0x4D696C61)
100
    RVTEST_IO_ASSERT_GPR_EQ(x8, 0x6F646173)
101
    RVTEST_IO_ASSERT_GPR_EQ(x9, 0x6B794063)
102
    #RVTEST_IO_ASSERT_GPR_EQ(x10, 0x00000000)
103
    RVTEST_IO_ASSERT_GPR_EQ(x11, 0x286E6F73)
104
    RVTEST_IO_ASSERT_GPR_EQ(x12, 0x656B2048)
105
    RVTEST_IO_ASSERT_GPR_EQ(x13, 0x20526164)
106
    RVTEST_IO_ASSERT_GPR_EQ(x14, 0x6F6D292C)
107
    RVTEST_IO_ASSERT_GPR_EQ(x15, 0x69702E63)
108
 
109
    #RVTEST_IO_WRITE_STR("# Test part A1  - Complete\n");
110
 
111
    # ---------------------------------------------------------------------------------------------
112
    #RVTEST_IO_WRITE_STR("# Test part A2 - test registers x16 - x31\n");
113
 
114
    # Address for test results
115
    la      x4, test_A2_res
116
 
117
    # Test
118
    li      x16, 0x636f6461
119
    li      x17, 0x6a656b40
120
    li      x18, 0x20286861
121
    li      x19, 0x616a656b
122
    li      x20, 0x61766520
123
    li      x21, 0x2e204c65
124
    li      x22, 0x636f6d29
125
    li      x23, 0x7369702e
126
    li      x24, 0x6620796f
127
    li      x25, 0x67652069
128
    li      x26, 0x65737361
129
    li      x27, 0x7573206d
130
    li      x28, 0x3a290d0a
131
    li      x29, 0x68697320
132
    li      x30, 0x61642074
133
    li      x31, 0x75207265
134
 
135
    # Store results
136
    sw      x16, 0(x4)
137
    sw      x17, 4(x4)
138
    sw      x18, 8(x4)
139
    sw      x19, 12(x4)
140
    sw      x20, 16(x4)
141
    sw      x21, 20(x4)
142
    sw      x22, 24(x4)
143
    sw      x23, 28(x4)
144
    sw      x24, 32(x4)
145
    sw      x25, 36(x4)
146
    sw      x26, 40(x4)
147
    sw      x27, 44(x4)
148
    sw      x28, 48(x4)
149
    sw      x29, 52(x4)
150
    sw      x30, 56(x4)
151
    sw      x31, 60(x4)
152
 
153
    RVTEST_IO_ASSERT_GPR_EQ(x16, 0x636F6461)
154
    RVTEST_IO_ASSERT_GPR_EQ(x17, 0x6A656B40)
155
    RVTEST_IO_ASSERT_GPR_EQ(x18, 0x20286861)
156
    RVTEST_IO_ASSERT_GPR_EQ(x19, 0x616A656B)
157
    RVTEST_IO_ASSERT_GPR_EQ(x20, 0x61766520)
158
    RVTEST_IO_ASSERT_GPR_EQ(x21, 0x2E204C65)
159
    RVTEST_IO_ASSERT_GPR_EQ(x22, 0x636F6D29)
160
    RVTEST_IO_ASSERT_GPR_EQ(x23, 0x7369702E)
161
    RVTEST_IO_ASSERT_GPR_EQ(x24, 0x6620796F)
162
    RVTEST_IO_ASSERT_GPR_EQ(x25, 0x67652069)
163
    RVTEST_IO_ASSERT_GPR_EQ(x26, 0x65737361)
164
    RVTEST_IO_ASSERT_GPR_EQ(x27, 0x7573206D)
165
    RVTEST_IO_ASSERT_GPR_EQ(x28, 0x3A290D0A)
166
    RVTEST_IO_ASSERT_GPR_EQ(x29, 0x68697320)
167
    RVTEST_IO_ASSERT_GPR_EQ(x30, 0x61642074)
168
    RVTEST_IO_ASSERT_GPR_EQ(x31, 0x75207265)
169
 
170
    #RVTEST_IO_WRITE_STR("# Test part A2  - Complete\n");
171
 
172
    # ---------------------------------------------------------------------------------------------
173
    #RVTEST_IO_WRITE_STR("# Test part A3 - test registers x0 - x3 again (were not overwritten)\n");
174
 
175
    # Address for test results
176
    la      x4, test_A3_res
177
 
178
    # Test
179
    sw      x0, 0(x4)
180
    sw      x1, 4(x4)
181
    sw      x2, 8(x4)
182
    sw      x3, 12(x4)
183
 
184
    #RVTEST_IO_WRITE_STR("# Test part A3  - Complete\n");
185
 
186
    #RVTEST_IO_WRITE_STR("# Test End\n")
187
 
188
 # ---------------------------------------------------------------------------------------------
189
    # HALT
190
    RV_COMPLIANCE_HALT
191
 
192
RV_COMPLIANCE_CODE_END
193
 
194
# Input data section.
195
    .data
196
    .align 4
197
 
198
# Output data section.
199
RV_COMPLIANCE_DATA_BEGIN
200
    .align 4
201
 
202
test_A1_res:
203
    .fill 16, 4, -1
204
test_A2_res:
205
    .fill 16, 4, -1
206
test_A3_res:
207
    .fill 4, 4, -1
208
 
209
RV_COMPLIANCE_DATA_END

powered by: WebSVN 2.1.0

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