Skip to content

Commit

Permalink
Modified bootrom after debugging to fetch address at scratch register 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosHirsl authored and fischeti committed Jul 17, 2024
1 parent bf5228b commit cb8b02e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 33 deletions.
6 changes: 4 additions & 2 deletions target/snitch_cluster/test/bootrom.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file modified target/snitch_cluster/test/bootrom.bin
Binary file not shown.
11 changes: 7 additions & 4 deletions target/snitch_cluster/test/bootrom.dump
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ Disassembly of section .text:
1c: 10500073 wfi

00000020 <_snitch_resume>:
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>
Binary file modified target/snitch_cluster/test/bootrom.elf
Binary file not shown.
52 changes: 26 additions & 26 deletions target/snitch_cluster/test/bootrom.sv
Original file line number Diff line number Diff line change
Expand Up @@ -65497,34 +65497,34 @@
{8'h00}, /* 0x003e */
{8'h00}, /* 0x003d */
{8'h00}, /* 0x003c */
{8'h00}, /* 0x003b */
{8'h00}, /* 0x003a */
{8'h00}, /* 0x0039 */
{8'h00}, /* 0x0038 */
{8'hfc}, /* 0x003b */
{8'h9f}, /* 0x003a */
{8'hf0}, /* 0x0039 */
{8'h6f}, /* 0x0038 */
{8'h00}, /* 0x0037 */
{8'h00}, /* 0x0036 */
{8'h00}, /* 0x0035 */
{8'h00}, /* 0x0034 */
{8'h02}, /* 0x0036 */
{8'h80}, /* 0x0035 */
{8'he7}, /* 0x0034 */
{8'h00}, /* 0x0033 */
{8'h00}, /* 0x0032 */
{8'h00}, /* 0x0031 */
{8'h00}, /* 0x0030 */
{8'hfd}, /* 0x002f */
{8'h5f}, /* 0x002e */
{8'hf0}, /* 0x002d */
{8'h6f}, /* 0x002c */
{8'h00}, /* 0x002b */
{8'h02}, /* 0x002a */
{8'h80}, /* 0x0029 */
{8'he7}, /* 0x0028 */
{8'h15}, /* 0x0027 */
{8'hc2}, /* 0x0026 */
{8'h82}, /* 0x0025 */
{8'h93}, /* 0x0024 */
{8'hff}, /* 0x0023 */
{8'hff}, /* 0x0022 */
{8'hf2}, /* 0x0021 */
{8'hb7}, /* 0x0020 */
{8'h02}, /* 0x0032 */
{8'ha2}, /* 0x0031 */
{8'h83}, /* 0x0030 */
{8'h00}, /* 0x002f */
{8'h62}, /* 0x002e */
{8'h82}, /* 0x002d */
{8'hb3}, /* 0x002c */
{8'h16}, /* 0x002b */
{8'h83}, /* 0x002a */
{8'h03}, /* 0x0029 */
{8'h13}, /* 0x0028 */
{8'hff}, /* 0x0027 */
{8'hff}, /* 0x0026 */
{8'hf3}, /* 0x0025 */
{8'h37}, /* 0x0024 */
{8'h00}, /* 0x0023 */
{8'h00}, /* 0x0022 */
{8'h02}, /* 0x0021 */
{8'h97}, /* 0x0020 */
{8'h10}, /* 0x001f */
{8'h50}, /* 0x001e */
{8'h00}, /* 0x001d */
Expand Down
2 changes: 1 addition & 1 deletion target/snitch_cluster/test/gen_bootrom_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from struct import *

# Parse arguments.
parser = argparse.ArgumentParser(description="Generate thestral_bootrom.sv")
parser = argparse.ArgumentParser(description="Generate bootrom.sv")
parser.add_argument("BINARY",
help="Binary image for which to create a bootrom")
parser.add_argument(
Expand Down

0 comments on commit cb8b02e

Please sign in to comment.