OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [lib/] [source/] [neorv32_rte.c] - Diff between revs 40 and 41

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 40 Rev 41
Line 275... Line 275...
  tmp = (tmp >> 30) & 0x03;
  tmp = (tmp >> 30) & 0x03;
  if (tmp == 0) {
  if (tmp == 0) {
    neorv32_uart_printf("unknown");
    neorv32_uart_printf("unknown");
  }
  }
  if (tmp == 1) {
  if (tmp == 1) {
    neorv32_uart_printf("RV32");
    neorv32_uart_printf("rv32");
  }
  }
  if (tmp == 2) {
  if (tmp == 2) {
    neorv32_uart_printf("RV64");
    neorv32_uart_printf("rv64");
  }
  }
  if (tmp == 3) {
  if (tmp == 3) {
    neorv32_uart_printf("RV128");
    neorv32_uart_printf("rv128");
  }
  }
 
 
  // CPU extensions
  // CPU extensions
  neorv32_uart_printf("\nEndianness:        ");
  neorv32_uart_printf("\nEndianness:        ");
  if (neorv32_cpu_csr_read(CSR_MSTATUSH) & (1<<CPU_MSTATUSH_MBE)) {
  if (neorv32_cpu_csr_read(CSR_MSTATUSH) & (1<<CPU_MSTATUSH_MBE)) {
Line 315... Line 315...
    neorv32_uart_printf("Zifencei ");
    neorv32_uart_printf("Zifencei ");
  }
  }
  if (tmp & (1<<CPU_MZEXT_PMP)) {
  if (tmp & (1<<CPU_MZEXT_PMP)) {
    neorv32_uart_printf("PMP ");
    neorv32_uart_printf("PMP ");
  }
  }
  if (tmp & (1<<CPU_MZEXT_ZICNT)) {
 
    neorv32_uart_printf("Zicnt ");
 
  }
 
 
 
 
 
  // check physical memory protection
  // check physical memory protection
  neorv32_uart_printf("\n\nPhysical memory protection: ");
  neorv32_uart_printf("\n\nPhysical memory protection: ");
  if (neorv32_cpu_csr_read(CSR_MZEXT) & (1<<CPU_MZEXT_PMP))  {
  if (neorv32_cpu_csr_read(CSR_MZEXT) & (1<<CPU_MZEXT_PMP))  {
Line 384... Line 381...
  neorv32_uart_printf("\nData base address:    0x%x\n", SYSINFO_DSPACE_BASE);
  neorv32_uart_printf("\nData base address:    0x%x\n", SYSINFO_DSPACE_BASE);
  neorv32_uart_printf("Internal DMEM:        ");
  neorv32_uart_printf("Internal DMEM:        ");
  __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_MEM_INT_DMEM));
  __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_MEM_INT_DMEM));
  neorv32_uart_printf("DMEM size:            %u bytes\n", SYSINFO_DMEM_SIZE);
  neorv32_uart_printf("DMEM size:            %u bytes\n", SYSINFO_DMEM_SIZE);
 
 
  neorv32_uart_printf("Bootloader:           ");
  neorv32_uart_printf("\nInternal i-cache:     ");
 
  __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_ICACHE));
 
  if (SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_ICACHE)) {
 
    neorv32_uart_printf("- ");
 
 
 
    uint32_t ic_block_size = (SYSINFO_CACHE >> SYSINFO_CACHE_IC_BLOCK_SIZE_0) & 0x0F;
 
    if (ic_block_size) {
 
      ic_block_size = 1 << ic_block_size;
 
    }
 
    else {
 
      ic_block_size = 0;
 
    }
 
 
 
    uint32_t ic_num_blocks = (SYSINFO_CACHE >> SYSINFO_CACHE_IC_NUM_BLOCKS_0) & 0x0F;
 
    if (ic_num_blocks) {
 
      ic_num_blocks = 1 << ic_num_blocks;
 
    }
 
    else {
 
      ic_num_blocks = 0;
 
    }
 
 
 
    uint32_t ic_associativity = (SYSINFO_CACHE >> SYSINFO_CACHE_IC_ASSOCIATIVITY_0) & 0x0F;
 
    ic_associativity = 1 << ic_associativity;
 
 
 
    neorv32_uart_printf("%u bytes (%u set(s), %u block(s) per set, %u bytes per block), ", ic_associativity*ic_num_blocks*ic_block_size, ic_associativity, ic_num_blocks, ic_block_size);
 
    if (ic_associativity == 0) {
 
      neorv32_uart_printf("direct-mapped\n");
 
    }
 
    else if (ic_associativity == ic_num_blocks) {
 
      neorv32_uart_printf("%u-way set-associative\n", ic_associativity);
 
    }
 
    else {
 
      neorv32_uart_printf("fully-associative\n");
 
    }
 
  }
 
 
 
  neorv32_uart_printf("\nBootloader:           ");
  __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_BOOTLOADER));
  __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_BOOTLOADER));
 
 
  neorv32_uart_printf("\nExternal memory bus interface:  ");
  neorv32_uart_printf("\nExternal memory bus interface:  ");
  __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_MEM_EXT));
  __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_MEM_EXT));
  neorv32_uart_printf("External memory bus Endianness: ");
  neorv32_uart_printf("External memory bus Endianness: ");
Line 473... Line 506...
}
}
 
 
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
 * NEORV32 runtime environment: Function to show the processor version in human-readable format.
 * NEORV32 runtime environment: Print the processor version in human-readable format.
 **************************************************************************/
 **************************************************************************/
void neorv32_rte_print_hw_version(void) {
void neorv32_rte_print_hw_version(void) {
 
 
  uint32_t i;
  uint32_t i;
  char tmp, cnt;
  char tmp, cnt;
Line 513... Line 546...
                     "https://github.com/stnolting/neorv32\n\n");
                     "https://github.com/stnolting/neorv32\n\n");
}
}
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
 * NEORV32 runtime environment: Print project credits
 * NEORV32 runtime environment: Print project logo
 **************************************************************************/
 **************************************************************************/
void neorv32_rte_print_logo(void) {
void neorv32_rte_print_logo(void) {
 
 
  const uint32_t logo_data_c[11][4] =
  const uint32_t logo_data_c[11][4] =
  {
  {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.