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

Subversion Repositories potato

[/] [potato/] [tags/] [v0.1/] [tests/] [scall.S] - Blame information for rev 53

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 skordal
# The Potato Processor - A simple RISC-V based processor for FPGAs
2
# (c) Kristian Klomsten Skordal 2014 - 2015 
3 3 skordal
# Report bugs and issues on 
4 2 skordal
 
5
#include "riscv_test.h"
6
#include "test_macros.h"
7
 
8
.section .text
9
RVTEST_RV32U
10
RVTEST_CODE_BEGIN
11
 
12
test_1:
13
        la x1, handle_exception
14
        csrw evec, x1
15
 
16
        li TESTNUM, 1
17
        scall
18
 
19
        j fail
20
        j pass
21
 
22
TEST_PASSFAIL
23
 
24
RVTEST_CODE_END
25
 
26
test_failed:
27
        RVTEST_FAIL
28
 
29
# Exception handlers:
30
handle_exception:
31
        li x1, 6 # Cause value for syscall exceptions
32
        csrr x2, cause
33
        bne x1, x2, test_failed
34
 
35
        csrr x1, epc
36
        addi x1, x1, 8
37
        csrw epc, x1
38
        sret
39
 

powered by: WebSVN 2.1.0

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