Fix for Single-Threaded

This commit is contained in:
felsabbagh3
2020-03-22 14:44:46 -07:00
parent 10ebfd7e24
commit 82ea79c680
16 changed files with 46894 additions and 46887 deletions

View File

@@ -1,9 +1,9 @@
COMP = riscv32-unknown-elf-gcc
COMP = /opt/riscv-new/drops/bin/riscv32-unknown-elf-gcc
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,../vortex_link.ld -ffreestanding -nostdlib
DMP = riscv32-unknown-elf-objdump
CPY = riscv32-unknown-elf-objcopy
DMP = /opt/riscv-new/drops/bin/riscv32-unknown-elf-objdump
CPY = /opt/riscv-new/drops/bin/riscv32-unknown-elf-objcopy
NEWLIB = ../../newlib/newlib.c
@@ -13,7 +13,7 @@ VX_IO = ../../io/vx_io.s ../../io/vx_io.c
VX_API = ../../vx_api/vx_api.c
VX_TEST = ../../tests/tests.c
VX_FIO = ../../fileio/fileio.s
LIBS = ../../../../riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libc.a ../../../../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
VX_MAIN = vx_simple_main

View File

@@ -52,6 +52,18 @@ int main()
// Main is called with all threads active of warp 0
vx_tmc(1);
vx_print_str("Let's start...\n");
unsigned what[36];
for (int i = 0; i < 36; i++)
{
what[i] = i;
}
for (int i = 0; i < 36; i++)
{
vx_printf("Value: ", what[i]);
}
vx_print_str("Simple Main\n");

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -20,22 +20,22 @@ _start:
# Initialize SP
# la sp, __stack_top
la a1, vx_set_sp
li a0, 32
li a0, 4
.word 0x00b5106b # wspawn a0(numWarps), a1(PC SPAWN)
jal vx_set_sp
li a0, 1
.word 0x0005006b # tmc 1
# li a0, 1
# .word 0x0005006b # tmc 1
# 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
# 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
# li a0, 4
# .word 0x0005006b # tmc 4
call main
@@ -46,7 +46,7 @@ _start:
.type vx_set_sp, @function
.global vx_set_sp
vx_set_sp:
li a0, 32
li a0, 4
.word 0x0005006b # tmc 4
.option push
@@ -55,7 +55,7 @@ vx_set_sp:
addi gp, gp, %pcrel_lo(1b)
.option pop
csrr a3, 0x21 # get wid
csrr a3, 0x22 # get wid
slli a3, a3, 0x1a # shift by wid
csrr a2, 0x20 # get tid
slli a1, a2, 10 # multiply tid by 1024

View File

@@ -13,6 +13,7 @@ void test_tmc()
vx_tmc(4);
unsigned tid = vx_threadID(); // Get TID
tmc_array[tid] = tid;
vx_tmc(1);
@@ -85,6 +86,7 @@ void simple_kernel()
wsapwn_arr[wid] = wid;
wid = vx_warpID();
if (wid != 0)
{
vx_tmc(0);