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

Subversion Repositories potato

[/] [potato/] [trunk/] [benchmarks/] [start.S] - Diff between revs 20 and 58

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 20 Rev 58
Line 8... Line 8...
#include "platform.h"
#include "platform.h"
#include "potato.h"
#include "potato.h"
 
 
.section .init
.section .init
 
 
 
.align 6
 
tvec_user: // User mode is not supported by Potato
 
        j tvec_machine
 
.align 6
 
tvec_supervisor: // Supervisor mode is not supported by Potato
 
        j tvec_machine
 
.align 6
 
tvec_hypervisor: // Hypervisor mode is not supported by Potato
 
        j tvec_machine
 
.align 6
 
tvec_machine:
 
        j exception_handler_wrapper
 
 
 
.align 6
.global _start
.global _start
_start:
_start:
 
 
// Copies the .data section into the data memory section:
// Copies the .data section into the data memory section:
.hidden copy_data
.hidden copy_data
Line 42... Line 56...
        addi x1, x1, 4
        addi x1, x1, 4
        bne x1, x2, 1b
        bne x1, x2, 1b
 
 
2:
2:
 
 
.hidden set_evec
 
set_evec:
 
        // Set up an exception handler:
 
        la x1, exception_handler_wrapper
 
        csrw evec, x1
 
 
 
.hidden call_main
.hidden call_main
call_main:
call_main:
        la sp, __stack_top
        la sp, __stack_top
        jal main
        jal main
        csrw tohost, a0
        csrw mtohost, a0
1:
1:
        j 1b
        j 1b
 
 
.section .text
.section .text
 
 
Line 95... Line 103...
        sw x28, 108(sp)
        sw x28, 108(sp)
        sw x29, 112(sp)
        sw x29, 112(sp)
        sw x30, 116(sp)
        sw x30, 116(sp)
        sw x31, 120(sp)
        sw x31, 120(sp)
 
 
        csrr a0, cause
        csrr a0, mcause
        csrr a1, epc
        csrr a1, mepc
        mv a2, sp
        mv a2, sp
        jal exception_handler
        jal exception_handler
 
 
.hidden exception_return
.hidden exception_return
exception_return:
exception_return:
Line 136... Line 144...
        lw x29, 112(sp)
        lw x29, 112(sp)
        lw x30, 116(sp)
        lw x30, 116(sp)
        lw x31, 120(sp)
        lw x31, 120(sp)
        addi sp, sp, 124
        addi sp, sp, 124
 
 
        sret
        eret
 
 

powered by: WebSVN 2.1.0

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