Added CSR TID/WID reads

This commit is contained in:
felsabbagh3
2019-10-21 02:10:05 -04:00
parent 405926f66f
commit 84f5ccb484
25 changed files with 2339 additions and 2241 deletions

View File

@@ -6,20 +6,21 @@
.type _start, @function
.global _start
_start:
# li a0, 7
# sw a0, 0(zero)
# lw a1, 0(zero)
# ecall
li a0, 8 # Num Warps
csrw 0x20, a0 # Setting the number of available warps
li a0, 4 # Num Threads
csrw 0x21, a0 # Setting the number of available threads
csrw mhartid,zero
csrw misa,zero
lui sp, 0x7ffff
# jal vx_before_main
jal main
li a0, 4
.word 0x0005006b # tmc a0
csrr a1, 0x20 # read thread IDs
csrr a2, 0x21 # read warp IDs
ecall
# li a0, 8 # Num Warps
# csrw 0x20, a0 # Setting the number of available warps
# li a0, 4 # Num Threads
# csrw 0x21, a0 # Setting the number of available threads
# csrw mhartid,zero
# csrw misa,zero
# lui sp, 0x7ffff
# # jal vx_before_main
# jal main
# ecall
# Hi:
# li a2, 7