From cb8b02ea40419625c36c62a252a179ed93d28280 Mon Sep 17 00:00:00 2001 From: Milos Hirsl Date: Fri, 24 May 2024 10:34:02 +0200 Subject: [PATCH] Modified bootrom after debugging to fetch address at scratch register 1. --- target/snitch_cluster/test/bootrom.S | 6 +- target/snitch_cluster/test/bootrom.bin | Bin 48 -> 60 bytes target/snitch_cluster/test/bootrom.dump | 11 ++-- target/snitch_cluster/test/bootrom.elf | Bin 4624 -> 4636 bytes target/snitch_cluster/test/bootrom.sv | 52 +++++++++--------- .../snitch_cluster/test/gen_bootrom_param.py | 2 +- 6 files changed, 38 insertions(+), 33 deletions(-) diff --git a/target/snitch_cluster/test/bootrom.S b/target/snitch_cluster/test/bootrom.S index 9ef465e06c..69b3bd00e0 100644 --- a/target/snitch_cluster/test/bootrom.S +++ b/target/snitch_cluster/test/bootrom.S @@ -13,7 +13,9 @@ _snitch_park: wfi _snitch_resume: - lui t0, 0xfffff # Peripheral start is 0x1000 before bootrom start. - addi t0, t0, 0x15c # This is the 0x2c instruction and we want to jump to scratch_1 (0x188). + auipc t0, 0 + li t1, -3736 # Jump to scratch register 1 at offset 0x188 + add t0, t0, t1 + lw t0, 0(t0) jalr ra, 0(t0) j _snitch_park \ No newline at end of file diff --git a/target/snitch_cluster/test/bootrom.bin b/target/snitch_cluster/test/bootrom.bin index 1570feb53f1f41a3d0d4c8864c56b025d3dbff47..b10f89a03f4cf7f389d51ccbed9c2bf270597328 100755 GIT binary patch delta 33 pcmXr8nV=vuor!_L{PX|+!pzNLo12mtninxKJa1rP$p0|^4*: - 20: fffff2b7 lui t0,0xfffff - 24: 15c28293 addi t0,t0,348 # fffff15c <_snitch_resume+0xfffff13c> - 28: 000280e7 jalr t0 - 2c: fd5ff06f j 0 <_snitch_park> + 20: 00000297 auipc t0,0x0 + 24: fffff337 lui t1,0xfffff + 28: 16830313 addi t1,t1,360 # fffff168 <_snitch_resume+0xfffff148> + 2c: 006282b3 add t0,t0,t1 + 30: 0002a283 lw t0,0(t0) # 20 <_snitch_resume> + 34: 000280e7 jalr t0 + 38: fc9ff06f j 0 <_snitch_park> diff --git a/target/snitch_cluster/test/bootrom.elf b/target/snitch_cluster/test/bootrom.elf index 29c82e1ecd4d276e419ac7948ca2ede739223cdf..07a241da2ec9fb0e82fc457e9987595e1db89e79 100755 GIT binary patch delta 114 zcmbQBGDl^C0;A4EMP*hS1_lP3jh@%}Wu`MRFqnV-|6iE7S!{Dt5<~MMCWhw?Obq!S z=Kq;&ATWb1#4pg@J!|qgfj&l?$+3dUK(bL#oiS(fN+5Y=@stW^2II*S1%&}*k{(