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

Subversion Repositories neorv32

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /neorv32/trunk/sw/common
    from Rev 22 to Rev 23
    Reverse comparison

Rev 22 → Rev 23

/crt0.S
41,11 → 41,7
// IO region
.equ IO_BEGIN, 0xFFFFFF80 // start of processor-internal IO region
 
// SYSINFO
.equ SYSINFO_DSPACE_BASE, 0xFFFFFFF4
.equ SYSINFO_DSPACE_SIZE, 0xFFFFFFFC
 
 
_start:
.cfi_startproc
.cfi_undefined ra
68,29 → 64,30
//addi x10, x0, 0
//addi x11, x0, 0
//addi x12, x0, 0
addi x13, x0, 0
//addi x13, x0, 0
addi x14, x0, 0
addi x15, x0, 0
 
 
// *********************************************************
// Setup stack pointer
// No interrupts, thanks
// *********************************************************
__crt0_stack_pointer_init:
lw x11, SYSINFO_DSPACE_BASE(zero) // data memory space base address
lw x12, SYSINFO_DSPACE_SIZE(zero) // data memory space size
add sp, x11, x12
addi sp, sp, -4 // stack pointer = last entry
addi fp, sp, 0 // frame pointer = stack pointer
__crt0_status_init:
li x10, 0x00001800 // clear mstatus and set mpp(1:0)
csrrw zero, mstatus, x10
csrrw zero, mie, zero // clear mie
 
 
// *********************************************************
// Setup global pointer
// Setup pointers using linker script symbol
// *********************************************************
__crt0_global_pointer_init:
__crt0_pointer_init:
.option push
.option norelax
la gp, __global_pointer$
la sp, __crt0_stack_begin
andi sp, sp, 0xfffffffc // make sure this is aligned
addi fp, sp, 0 // frame pointer = stack pointer
la gp, __global_pointer$ // global pointer
.option pop
 
 
117,7 → 114,7
 
 
// *********************************************************
// Clear .bss section (byte-wise)
// Clear .bss section (byte-wise) using linker script symbols
// *********************************************************
__crt0_clear_bss:
la x11, __crt0_bss_start
133,7 → 130,7
 
 
// *********************************************************
// Copy initialized .data section from ROM to RAM (byte-wise)
// Copy initialized .data section from ROM to RAM (byte-wise) using linker script symbols
// *********************************************************
__crt0_copy_data:
la x11, __crt0_copy_data_src_begin // start of data area (copy source)
189,6 → 186,7
csrr x8, mepc
 
// is compressed instruction?
__crt0_dummy_trap_handler_exc_c_check:
lh x9, 0(x8) // get compressed instruction or lower 16 bits of uncompressed instruction that caused exception
andi x9, x9, 3 // mask: isolate lowest 2 opcode bits (= 11 for uncompressed instructions)
 
199,6 → 197,7
bne x8, x9, __crt0_dummy_trap_handler_irq // jump if compressed instruction
// is uncompressed instruction
__crt0_dummy_trap_handler_exc_uncrompressed:
csrr x8, mepc
addi x8, x8, +2 // add another 2 (making +4) for uncompressed instructions
csrw mepc, x8
205,9 → 204,9
 
__crt0_dummy_trap_handler_irq:
 
lw x9, 0(sp)
lw x8, 4(sp)
addi sp, sp, +8
lw x9, 0(sp)
lw x8, 4(sp)
addi sp, sp, +8
 
mret
 
/neorv32.ld
46,21 → 46,23
ENTRY(_start)
SEARCH_DIR("=/opt/riscv/riscv64-unknown-linux-gnu/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
 
/* ************************************************* */
/* NEORV32 memory configuration. */
/* Make sure this is sync with your processor/ */
/* memory hardware configuration. */
/* ************************************************* */
/* ************************************************************************* */
/* NEORV32 memory configuration. */
/* Make sure this is sync with your processor/memory hardware configuration. */
/* ************************************************************************* */
MEMORY
{
/* rom section: first value of ORIGIN/LENGHT: bootloader ROM; second value of ORIGIN/LENGHT: IMEM */
/* "rom" section: first value of ORIGIN/LENGHT => bootloader ROM; second value of ORIGIN/LENGHT => instruction memory */
 
rom (rx) : ORIGIN = DEFINED(make_bootloader) ? 0xFFFF0000 : 0x00000000, LENGTH = DEFINED(make_bootloader) ? 4*1024 : 16*1024
ram (rwx) : ORIGIN = 0x80000000, LENGTH = 8*1024
}
/* ************************************************* */
/* ************************************************************************* */
 
SECTIONS
{
/* stack pointer init: last 32-bit entry in data memory */
__crt0_stack_begin = (ORIGIN(ram) + LENGTH(ram)) - 4;
 
/* start section on WORD boundary */
. = ALIGN(4);
284,8 → 286,8
 
 
/* Provide further symbols for neorv32 crt0.elf */
PROVIDE(__crt0_bss_start = __bss_start);
PROVIDE(__crt0_bss_end = __BSS_END__);
PROVIDE(__crt0_bss_start = __bss_start);
PROVIDE(__crt0_bss_end = __BSS_END__);
PROVIDE(__crt0_copy_data_src_begin = __etext + SIZEOF(.rodata));
PROVIDE(__crt0_copy_data_dst_begin = __DATA_BEGIN__);
PROVIDE(__crt0_copy_data_dst_end = __DATA_BEGIN__ + SIZEOF(.data));

powered by: WebSVN 2.1.0

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