Line 136... |
Line 136... |
|
|
// compute return address
|
// compute return address
|
if (((int32_t)rte_mcause) >= 0) { // modify pc only if not interrupt (MSB cleared)
|
if (((int32_t)rte_mcause) >= 0) { // modify pc only if not interrupt (MSB cleared)
|
|
|
// get low half word of faulting instruction
|
// get low half word of faulting instruction
|
register uint32_t rte_trap_inst;
|
register uint32_t rte_trap_inst = neorv32_cpu_load_unsigned_half(rte_mepc);
|
asm volatile ("lh %[result], 0(%[input_i])" : [result] "=r" (rte_trap_inst) : [input_i] "r" (rte_mepc));
|
|
|
|
if ((rte_trap_inst & 3) == 3) { // faulting instruction is uncompressed instruction
|
if ((rte_trap_inst & 3) == 3) { // faulting instruction is uncompressed instruction
|
rte_mepc += 4;
|
rte_mepc += 4;
|
}
|
}
|
else { // faulting instruction is compressed instruction
|
else { // faulting instruction is compressed instruction
|
Line 376... |
Line 375... |
|
|
// check physical memory protection
|
// check physical memory protection
|
neorv32_uart0_printf("\nPMP: ");
|
neorv32_uart0_printf("\nPMP: ");
|
uint32_t pmp_num_regions = neorv32_cpu_pmp_get_num_regions();
|
uint32_t pmp_num_regions = neorv32_cpu_pmp_get_num_regions();
|
if (pmp_num_regions != 0) {
|
if (pmp_num_regions != 0) {
|
neorv32_uart0_printf("%u regions, %u bytes minimal granularity\n", pmp_num_regions, neorv32_cpu_pmp_get_granularity());
|
neorv32_uart0_printf("%u regions, %u bytes minimal granularity, OFF/TOR modes only\n", pmp_num_regions, neorv32_cpu_pmp_get_granularity());
|
}
|
}
|
else {
|
else {
|
neorv32_uart0_printf("not implemented\n");
|
neorv32_uart0_printf("not implemented\n");
|
}
|
}
|
|
|
|
|
// Memory configuration
|
// Memory configuration
|
neorv32_uart0_printf("\n=== << Memory System >> ===\n");
|
neorv32_uart0_printf("\n=== << Memory System >> ===\n");
|
|
|
neorv32_uart0_printf("Boot Config.: Boot ");
|
neorv32_uart0_printf("Boot configuration: Boot ");
|
if (NEORV32_SYSINFO.SOC & (1 << SYSINFO_SOC_BOOTLOADER)) {
|
if (NEORV32_SYSINFO.SOC & (1 << SYSINFO_SOC_BOOTLOADER)) {
|
neorv32_uart0_printf("via Bootloader\n");
|
neorv32_uart0_printf("via Bootloader\n");
|
}
|
}
|
else {
|
else {
|
neorv32_uart0_printf("from memory (@ 0x%x)\n", NEORV32_SYSINFO.ISPACE_BASE);
|
neorv32_uart0_printf("from memory (@ 0x%x)\n", NEORV32_SYSINFO.ISPACE_BASE);
|
Line 456... |
Line 455... |
neorv32_uart0_printf("no\n");
|
neorv32_uart0_printf("no\n");
|
}
|
}
|
|
|
neorv32_uart0_printf("Ext. bus interface: ");
|
neorv32_uart0_printf("Ext. bus interface: ");
|
__neorv32_rte_print_true_false(NEORV32_SYSINFO.SOC & (1 << SYSINFO_SOC_MEM_EXT));
|
__neorv32_rte_print_true_false(NEORV32_SYSINFO.SOC & (1 << SYSINFO_SOC_MEM_EXT));
|
neorv32_uart0_printf("Ext. bus Endianness: ");
|
neorv32_uart0_printf("Ext. bus endianness: ");
|
if (NEORV32_SYSINFO.SOC & (1 << SYSINFO_SOC_MEM_EXT_ENDIAN)) {
|
if (NEORV32_SYSINFO.SOC & (1 << SYSINFO_SOC_MEM_EXT_ENDIAN)) {
|
neorv32_uart0_printf("big\n");
|
neorv32_uart0_printf("big\n");
|
}
|
}
|
else {
|
else {
|
neorv32_uart0_printf("little\n");
|
neorv32_uart0_printf("little\n");
|