URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
Subversion Repositories neorv32
Compare Revisions
- This comparison shows the changes necessary to convert path
/neorv32/trunk/sw/lib/source
- from Rev 53 to Rev 55
- ↔ Reverse comparison
Rev 53 → Rev 55
/neorv32_cpu.c
683,3 → 683,26
|
return num_hpm_cnts; |
} |
|
|
/**********************************************************************//** |
* Check if certain Z* extension is available |
* |
* @param[in] flag Index of the Z-extension to check from #NEORV32_CSR_MZEXT_enum |
* @return 0 if extension is NOT available, != 0 if extension is available. |
**************************************************************************/ |
int neorv32_check_zextension(uint32_t flag) { |
|
// check if out of range |
if (flag > 31) { |
return 0; |
} |
|
uint32_t tmp = neorv32_cpu_csr_read(CSR_MZEXT); |
if ((tmp & (1 << flag)) == 0) { |
return 0; |
} |
else { |
return 1; |
} |
} |
/neorv32_uart.c
505,8 → 505,10
__neorv32_uart_tohex(va_arg(a, uint32_t), string_buf); |
neorv32_uart0_print(string_buf); |
break; |
default: |
return; |
default: // unsupported format |
neorv32_uart0_putc('%'); |
neorv32_uart0_putc(c); |
break; |
} |
} |
else { |
858,8 → 860,10
__neorv32_uart_tohex(va_arg(a, uint32_t), string_buf); |
neorv32_uart1_print(string_buf); |
break; |
default: |
return; |
default: // unsupported format |
neorv32_uart1_putc('%'); |
neorv32_uart1_putc(c); |
break; |
} |
} |
else { |
964,7 → 968,7
* Private function for 'neorv32_printf' to convert into hexadecimal. |
* |
* @param[in] x Unsigned input number. |
* @param[in,out] res Pointer for storing the reuslting number string (9 chars). |
* @param[in,out] res Pointer for storing the resulting number string (9 chars). |
**************************************************************************/ |
static void __neorv32_uart_tohex(uint32_t x, char *res) { |
|
971,7 → 975,7
static const char symbols[] = "0123456789abcdef"; |
|
int i; |
for (i=0; i<8; i++) { // nibble by bibble |
for (i=0; i<8; i++) { // nibble by nibble |
uint32_t num_tmp = x >> (4*i); |
res[7-i] = (char)symbols[num_tmp & 0x0f]; |
} |