Skip to content

Commit

Permalink
[rte] minor console output edits
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Nov 25, 2023
1 parent bfbb0c9 commit 75a2d6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions docs/datasheet/software_rte.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ cannot be resolved by the default debug trap handlers and will halt the CPU (see
.RTE Default Trap Handler Output Examples
[source]
----
<RTE> [M] Illegal instruction @ PC=0x000002d6, MTINST=0x000000FF, MTVAL=0x00000000 </RTE> <1>
<RTE> [U] Illegal instruction @ PC=0x00000302, MTINST=0x00000000, MTVAL=0x00000000 </RTE> <2>
<RTE> [U] Load address misaligned @ PC=0x00000440, MTINST=0x01052603, MTVAL=0x80000101 </RTE> <3>
<RTE> [M] Fast IRQ 0x00000003 @ PC=0x00000820, MTINST=0x00000000, MTVAL=0x00000000 </RTE> <4>
<RTE> [M] Instruction access fault @ PC=0x90000000, MTINST=0x42078b63, MTVAL=0x00000000 [FATAL EXCEPTION] Halting CPU. </RTE>\n <5>
<NEORV32-RTE> [M] Illegal instruction @ PC=0x000002d6, MTINST=0x000000FF, MTVAL=0x00000000 </NEORV32-RTE> <1>
<NEORV32-RTE> [U] Illegal instruction @ PC=0x00000302, MTINST=0x00000000, MTVAL=0x00000000 </NEORV32-RTE> <2>
<NEORV32-RTE> [U] Load address misaligned @ PC=0x00000440, MTINST=0x01052603, MTVAL=0x80000101 </NEORV32-RTE> <3>
<NEORV32-RTE> [M] Fast IRQ 0x00000003 @ PC=0x00000820, MTINST=0x00000000, MTVAL=0x00000000 </NEORV32-RTE> <4>
<NEORV32-RTE> [M] Instruction access fault @ PC=0x90000000, MTINST=0x42078b63, MTVAL=0x00000000 !!FATAL EXCEPTION!! Halting CPU. </NEORV32-RTE>\n <5>
----
<1> Illegal 32-bit instruction `MTINST=0x000000FF` at address `PC=0x000002d6` while the CPU was in machine-mode (`[M]`).
<2> Illegal 16-bit instruction `MTINST=0x00000000` at address `PC=0x00000302` while the CPU was in user-mode (`[U]`).
Expand Down
6 changes: 3 additions & 3 deletions sw/lib/source/neorv32_rte.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static void __neorv32_rte_debug_handler(void) {
}

// intro
neorv32_uart0_puts("<RTE> ");
neorv32_uart0_puts("<NEORV32-RTE> ");

// privilege level of the CPU when the trap occurred
if (neorv32_cpu_csr_read(CSR_MSTATUS) & (3 << CSR_MSTATUS_MPP_L)) {
Expand Down Expand Up @@ -391,15 +391,15 @@ static void __neorv32_rte_debug_handler(void) {

// halt if fatal exception
if ((trap_cause == TRAP_CODE_I_ACCESS) || (trap_cause == TRAP_CODE_I_MISALIGNED)) {
neorv32_uart0_puts(" [FATAL EXCEPTION!] Halting CPU. </RTE>\n");
neorv32_uart0_puts(" !!FATAL EXCEPTION!! Halting CPU. </NEORV32-RTE>\n");
neorv32_cpu_csr_write(CSR_MIE, 0);
while(1) {
asm volatile ("wfi");
}
}

// outro
neorv32_uart0_puts(" </RTE>\n");
neorv32_uart0_puts(" </NEORV32-RTE>\n");
}


Expand Down

0 comments on commit 75a2d6a

Please sign in to comment.