Skip to content

Commit

Permalink
[sw] minor edits and cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Jan 7, 2025
1 parent 044acc0 commit f5e4546
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sw/example/processor_check/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2141,10 +2141,10 @@ int main() {


// ----------------------------------------------------------
// Dual-core test
// SMP dual-core test
// ----------------------------------------------------------
neorv32_cpu_csr_write(CSR_MCAUSE, mcause_never_c);
PRINT_STANDARD("[%i] Dual-core ", cnt_test);
PRINT_STANDARD("[%i] SMP dual-core boot ", cnt_test);

if ((NEORV32_SYSINFO->MISC[SYSINFO_MISC_HART] > 1) && // we need at least two cores
(neorv32_clint_available() != 0)) { // we need the CLINT
Expand Down
8 changes: 4 additions & 4 deletions sw/lib/source/neorv32_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void neorv32_aux_print_hw_config(void) {
if (neorv32_cpu_csr_read(CSR_MXISA) & (1 << CSR_MXISA_IS_SIM)) { neorv32_uart0_printf("yes\n"); }
else { neorv32_uart0_printf("no\n"); }

neorv32_uart0_printf("CPU cores (harts): %u\n", (uint32_t)NEORV32_SYSINFO->MISC[SYSINFO_MISC_HART]);
neorv32_uart0_printf("CPU cores (harts): %u\n", neorv32_sysinfo_get_numcores());

neorv32_uart0_printf("Clock speed: %u Hz\n", neorv32_sysinfo_get_clk());

Expand Down Expand Up @@ -399,7 +399,7 @@ void neorv32_aux_print_hw_config(void) {
}

neorv32_uart0_printf("\nBoot configuration: ");
int boot_config = (int)(NEORV32_SYSINFO->MISC[SYSINFO_MISC_BOOT]);
int boot_config = neorv32_sysinfo_get_bootmode();
switch (boot_config) {
case 0: neorv32_uart0_printf("boot via bootloader (0)\n"); break;
case 1: neorv32_uart0_printf("boot from custom address (1)\n"); break;
Expand All @@ -410,7 +410,7 @@ void neorv32_aux_print_hw_config(void) {
// internal IMEM
neorv32_uart0_printf("Internal IMEM: ");
if (NEORV32_SYSINFO->SOC & (1 << SYSINFO_SOC_MEM_INT_IMEM)) {
neorv32_uart0_printf("%u bytes\n", (uint32_t)(1 << NEORV32_SYSINFO->MISC[SYSINFO_MISC_IMEM]) & 0xFFFFFFFCUL);
neorv32_uart0_printf("%u bytes\n", neorv32_sysinfo_get_imemsize());
}
else {
neorv32_uart0_printf("none\n");
Expand All @@ -419,7 +419,7 @@ void neorv32_aux_print_hw_config(void) {
// internal DMEM
neorv32_uart0_printf("Internal DMEM: ");
if (NEORV32_SYSINFO->SOC & (1 << SYSINFO_SOC_MEM_INT_DMEM)) {
neorv32_uart0_printf("%u bytes\n", (uint32_t)(1 << NEORV32_SYSINFO->MISC[SYSINFO_MISC_DMEM]) & 0xFFFFFFFCUL);
neorv32_uart0_printf("%u bytes\n", neorv32_sysinfo_get_dmemsize());
}
else {
neorv32_uart0_printf("none\n");
Expand Down

0 comments on commit f5e4546

Please sign in to comment.