upgrade to latest rocket-chip

This commit is contained in:
Howard Mao
2017-05-25 10:42:19 -07:00
parent a123d82677
commit 062d443863
15 changed files with 112 additions and 100 deletions

View File

@@ -2,7 +2,7 @@
#include "encoding.h"
#ifdef __riscv64
#if __riscv_xlen == 64
# define LREG ld
# define SREG sd
# define REGBYTES 8
@@ -12,12 +12,9 @@
# define REGBYTES 4
#endif
.text
.section ".text.init"
.globl _start
_start:
la t0, trap_entry
csrw mtvec, t0
li x1, 0
li x2, 0
li x3, 0
@@ -55,20 +52,23 @@ _start:
csrs mstatus, t0
# make sure XLEN agrees with compilation choice
csrr t0, misa
#ifdef __riscv64
bltz t0, 1f
#else
li t0, 1
slli t0, t0, 31
#if __riscv_xlen == 64
bgez t0, 1f
#else
bltz t0, 1f
#endif
li a0, 1234
j tohost_exit
2:
li a0, 1
sw a0, tohost, t0
j 2b
1:
#ifdef __riscv_hard_float
#ifdef __riscv_flen
# initialize FPU if we have one
andi t0, t0, 1 << ('f' - 'a')
beqz t0, 1f
la t0, 1f
csrw mtvec, t0
fssr x0
fmv.s.x f0, x0
@@ -103,12 +103,18 @@ _start:
fmv.s.x f29,x0
fmv.s.x f30,x0
fmv.s.x f31,x0
1:
#endif
1:
# initialize trap vector
la t0, trap_entry
csrw mtvec, t0
# initialize global pointer
la gp, _gp
.option push
.option norelax
la gp, __global_pointer$
.option pop
la tp, _end + 63
and tp, tp, -64