Modify kernel entry since CSR_KNL is ready in spike
This commit is contained in:
parent
625746818d
commit
530939a01b
|
@ -1,5 +1,4 @@
|
||||||
typedef uint cl_mem_fence_flags;
|
typedef uint cl_mem_fence_flags;
|
||||||
typedef uint memory_scope;
|
|
||||||
#define CLK_LOCAL_MEM_FENCE 1
|
#define CLK_LOCAL_MEM_FENCE 1
|
||||||
#define CLK_GLOBAL_MEM_FENCE 2
|
#define CLK_GLOBAL_MEM_FENCE 2
|
||||||
#define CLK_IMAGE_MEM_FENCE 4
|
#define CLK_IMAGE_MEM_FENCE 4
|
||||||
|
|
|
@ -28,7 +28,6 @@ _start:
|
||||||
|
|
||||||
# allocate warp and per-thread level stack pointers, both
|
# allocate warp and per-thread level stack pointers, both
|
||||||
# stacks grows upwards
|
# stacks grows upwards
|
||||||
vsetvli x0,x0,e32,m1,ta,ma
|
|
||||||
csrr sp, CSR_LDS # sp points to baseaddr of local memory of each SM
|
csrr sp, CSR_LDS # sp points to baseaddr of local memory of each SM
|
||||||
csrr tp, CSR_PDS # tp points to baseaddr for lower bound of private memory(1K) of each thread
|
csrr tp, CSR_PDS # tp points to baseaddr for lower bound of private memory(1K) of each thread
|
||||||
|
|
||||||
|
@ -43,10 +42,8 @@ _start:
|
||||||
|
|
||||||
2:
|
2:
|
||||||
csrr t0, CSR_KNL # get addr of kernel metadata
|
csrr t0, CSR_KNL # get addr of kernel metadata
|
||||||
la t1, test # all the tested function is named to be test
|
lw t1, KNL_ENTRY(t0) # get kernel program address
|
||||||
# lw t1, KNL_ENTRY(t0) # get kernel program address
|
lw a0, KNL_ARG_BASE(t0) # get kernel arg buffer base address
|
||||||
# lw a0, KNL_ARG_BASE(t0) # get kernel arg buffer base address
|
|
||||||
# WORKAROUND: when buffer is ready, restore lines above
|
|
||||||
jalr t1 # call kernel program
|
jalr t1 # call kernel program
|
||||||
|
|
||||||
# call exit routine
|
# call exit routine
|
||||||
|
@ -55,3 +52,19 @@ _start:
|
||||||
# End of warp execution
|
# End of warp execution
|
||||||
endprg x0, x0, x0
|
endprg x0, x0, x0
|
||||||
.size _start, .-_start
|
.size _start, .-_start
|
||||||
|
|
||||||
|
|
||||||
|
.section ".tohost","aw",@progbits
|
||||||
|
.align 6
|
||||||
|
.globl tohost
|
||||||
|
tohost: .dword 0
|
||||||
|
.align 6
|
||||||
|
.globl fromhost
|
||||||
|
fromhost: .dword 0
|
||||||
|
|
||||||
|
.global spike_end
|
||||||
|
.type spike_end,function
|
||||||
|
spike_end:
|
||||||
|
li t1,1
|
||||||
|
la t0,tohost
|
||||||
|
sw t1,0(t0)
|
||||||
|
|
Loading…
Reference in New Issue