OpenCores
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 58 to Rev 59
    Reverse comparison

Rev 58 → Rev 59

/neorv32_mtime.c
119,16 → 119,22
* Set compare time register (MTIMECMP) for generating interrupts.
*
* @note The interrupt is triggered when MTIME >= MTIMECMP.
* @note The interrupt is acknwoledged by writing to the MTIMECMP.HI register.
* @note The timer interrupt is enabled via neorv32_cpu_mti_enable(void) and disabled via neorv32_cpu_mti_disable(void).
* @note Global interrupts have to be enabled via neorv32_cpu_eint(void).
* @note Global interrupts and the timer interrupt source have to be enabled .
*
* @param[in] timecmp System time for interrupt (uint64_t)
**************************************************************************/
void neorv32_mtime_set_timecmp(uint64_t timecmp) {
 
MTIMECMP_LO = -1; // prevent mtimecmp from temporarily becoming smaller than the lesser of the old and new values
MTIMECMP = timecmp;
union {
uint64_t uint64;
uint32_t uint32[sizeof(uint64_t)/2];
} cycles;
 
cycles.uint64 = timecmp;
 
MTIMECMP_LO = -1; // prevent MTIMECMP from temporarily becoming smaller than the lesser of the old and new values
MTIMECMP_HI = cycles.uint32[1];
MTIMECMP_LO = cycles.uint32[0];
}
 
 
/neorv32_rte.c
277,6 → 277,7
neorv32_uart_printf("Clock: %u Hz\n", SYSINFO_CLK);
neorv32_uart_printf("User ID: 0x%x\n", SYSINFO_USER_CODE);
neorv32_uart_printf("Full HW reset: "); __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_HW_RESET));
neorv32_uart_printf("On-chip debug: "); __neorv32_rte_print_true_false(SYSINFO_FEATURES & (1 << SYSINFO_FEATURES_OCD));
 
 
// CPU configuration
360,6 → 361,9
if (tmp & (1<<CSR_MZEXT_ZXSCNT)) {
neorv32_uart_printf("Zxscnt(!) ");
}
if (tmp & (1<<CSR_MZEXT_DEBUGMODE)) {
neorv32_uart_printf("Debug-Mode ");
}
 
// check physical memory protection
neorv32_uart_printf("\nPMP: ");

powered by: WebSVN 2.1.0

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