/** * \brief The main function. */ int main(void) { /* Initialize the SAM system */ sysclk_init(); board_init(); /* Initialize the console */ configure_console(); /* Output example information */ printf("-- CMCC Example --\r\n"); printf("-- %s\n\r", BOARD_NAME); printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__); /* Enable the CMCC module. */ cmcc_get_config_defaults(&g_cmcc_cfg); cmcc_init(CMCC_BASE, &g_cmcc_cfg); cmcc_enable(CMCC_BASE); /* Do the Fibonacci calculation. */ recfibo(FIBONACCI_NUM); printf("Fibonacci calculation completed \r\n"); printf("Cache Data hit: %ld \r\n", cmcc_get_monitor_cnt(CMCC_BASE)); while (true) { } }
/** * \brief Cache Controller Invalidate by Line Operation. * * \param p_cmcc Pointer to an CMCC instance. * */ void cmcc_invalidate_line(Cmcc *const p_cmcc, uint32_t cmcc_way, uint32_t cmcc_index) { cmcc_disable(p_cmcc); while (cmcc_get_status(p_cmcc) & CMCC_SR_CSTS) { } p_cmcc->CMCC_MAINT1 = (cmcc_way << CMCC_MAINT1_WAY_Pos) | (cmcc_index << CMCC_MAINT1_INDEX_Pos); cmcc_enable(p_cmcc); }