fix rtl gpr zero

This commit is contained in:
Blaise Tine
2020-05-06 05:25:20 -04:00
parent 7e748e4e38
commit b1fdf0a947
16 changed files with 34529 additions and 78542 deletions

View File

@@ -274,14 +274,6 @@ void * _sbrk (int nbytes)
// }
} /* _sbrk () */
void _exit(int val)
{
// vx_print_str("Hello from exit\n");
vx_tmc(0);
}
int _open(const char *name, int flags, int mode)
{
// char * write_buffer = (char *) FILE_IO_WRITE;

View File

@@ -4,27 +4,35 @@
.global _start
.type _start, @function
_start:
la a1, vx_set_sp
li a0, NUM_WARPS # activate all warps
.word 0x00b5106b # wspawn a0(numWarps), a1(PC SPAWN)
jal vx_set_sp
li a0, 1
.word 0x0005006b # back to single thread
# Initialize global pointerp
# call __cxx_global_var_init
# Clear the bss segment
la a0, _edata
la a2, _end
sub a2, a2, a0
li a1, 0
call memset
la a0, __libc_fini_array # Register global termination functions
call atexit # to be called upon exit
call __libc_init_array # Run global initialization functions
call main
tail exit
la a1, vx_set_sp
li a0, NUM_WARPS # activate all warps
.word 0x00b5106b # wspawn a0(numWarps), a1(PC SPAWN)
jal vx_set_sp
li a0, 1
.word 0x0005006b # back to single thread
# Initialize global pointerp
# call __cxx_global_var_init
# Clear the bss segment
la a0, _edata
la a2, _end
sub a2, a2, a0
li a1, 0
call memset
la a0, __libc_fini_array # Register global termination functions
call atexit # to be called upon exit
call __libc_init_array # Run global initialization functions
call main
tail exit
.size _start, .-_start
.section .text
.type _exit, @function
.global _exit
_exit:
li a0, 0
.word 0x0005006b # disable all threads
.section .text
.type vx_set_sp, @function
.global vx_set_sp

View File

@@ -1,8 +1,8 @@
COMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-g++
#COMP = /opt/riscv-new/drops/bin/riscv32-unknown-elf-g++
CC_FLAGS = -march=rv32im -mabi=ilp32 -O3 -Wl,-Bstatic,-T,../../startup/vx_link.ld -ffreestanding -nostdlib
CC_FLAGS = -march=rv32im -mabi=ilp32 -O3 -Wl,-Bstatic,-T,../../startup/vx_link.ld
CC_FLAGS += -nostartfiles -ffreestanding -fno-rtti -fno-exceptions -Wl,--gc-sections
DMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objdump
CPY = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objcopy
@@ -17,8 +17,9 @@ VX_FIO = ../../fileio/fileio.S
VX_MAIN = vx_simple_main
LIBS = ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libc.a ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
#LIBS = /opt/riscv-new/drops/riscv32-unknown-elf/lib/libc.a /opt/riscv-new/drops/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
#LIBS += ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libc.a
#LIBS += ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libstdc++.a
#LIBS += -static-libgcc -lgcc
VX_SRCS = vx_simple_main.c tests.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff