Skip to content

Commit 4efc4bd

Browse files
committed
Zero registers on boot
1 parent b81040b commit 4efc4bd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cpu/controller.mlog.jinja

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ end_slow_init:
157157

158158
# reset additional (unspecified) hart state
159159

160+
# clear registers
161+
#% for _ in range(32)
162+
write 0 {{REGISTERS}} {{loop.index0}}
163+
#% endfor
164+
160165
# clear timers
161166
set csr_mtime 0
162167
set csr_mtimeh 0
@@ -345,6 +350,7 @@ set {{RAM_PROC_BYTES}} null
345350
set {{RAM_START}} null
346351
set {{SYSCON}} null
347352
# local preprocessor constants
353+
set {{REGISTERS}} null
348354
set {{LABELS}} null
349355
set {{CSRS}} null
350356
set {{INCR}} null
@@ -355,6 +361,7 @@ set {{POWER_SWITCH}} null
355361
set {{PAUSE_SWITCH}} null
356362
set {{labels[instruction.label]}} null
357363
set {{labels.END_BREAKPOINT}} null
364+
set {{loop.index0}} null
358365
set {{ns.i}} null
359366
# unused variables
360367
set _ UART_FIFO_MODULO

0 commit comments

Comments
 (0)