static void cesaTestTraceAdd(int type) { cesaTestTrace[cesaTestTraceIdx].type = type; cesaTestTrace[cesaTestTraceIdx].realCause = MV_REG_READ(MV_CESA_ISR_CAUSE_REG); //cesaTestTrace[cesaTestTraceIdx].idmaCause = MV_REG_READ(IDMA_CAUSE_REG); cesaTestTrace[cesaTestTraceIdx].resources = cesaReqResources; cesaTestTrace[cesaTestTraceIdx].pReqReady = pCesaReqReady; cesaTestTrace[cesaTestTraceIdx].pReqEmpty = pCesaReqEmpty; cesaTestTrace[cesaTestTraceIdx].pReqProcess = pCesaReqProcess; cesaTestTrace[cesaTestTraceIdx].timeStamp = mvCntmrRead(MV_CESA_USE_TIMER_ID); cesaTestTraceIdx++; if(cesaTestTraceIdx == MV_CESA_TEST_TRACE_SIZE) cesaTestTraceIdx = 0; }
/******************************************************************************* * cvPlatformMiliSecDelay - halts the system for a desired mili - seconds. * * DESCRIPTION: * This function halts the system for a desired mili-seconds delivered * by the parameter ‘miliSec’.It uses one of the 8 counter/timers within * the MV by loading it with the ‘miliSec’ parameter multiplied * with 1 mili-second ( 1 mili-second is calculated by dividing the ‘ * Tclock’ parameter by 1000) and waiting in a loop for it to end the * count. * INPUT: * miliSec - The desirable time ( in mili -seconds) to halt the system. * Tclock - The MV core clock . * countNum - The desired counter/timer (one out of possible 8 * counter/timers within the MV). * OUTPUT: * None. * * RETURN: * None. * *******************************************************************************/ MV_VOID cvPlatformMiliSecDelay(MV_U32 miliSec,MV_U32 Tclock, MV_U32 countNum) { MV_U32 oneMiliSec; MV_CNTMR_CTRL counterCnrl; counterCnrl.enable = MV_TRUE; counterCnrl.autoEnable = MV_FALSE; oneMiliSec = Tclock/1000; mvCntmrDisable(countNum); mvCntmrCtrlSet(countNum,&counterCnrl); mvCntmrLoad(countNum,miliSec * oneMiliSec); mvCntmrEnable(countNum); while(mvCntmrRead(countNum)); }