lib/sw_services/xilsem/examples/xsem_cram_example.c
XStatus ApiChkErrorCount(u32 IntialCorErrCnt, u32 ExpectedCount)
{
	XStatus Status = XST_SUCCESS;
	XSemCfrStatus CfrStatusInfo = {0};
	u32 TotalCorErrCnt = 0U;

	(void)XSem_CmdCfrGetStatus(&CfrStatusInfo);
	TotalCorErrCnt = CfrStatusInfo.ErrCorCnt - IntialCorErrCnt;
	if(TotalCorErrCnt != ExpectedCount){
		Status = XST_FAILURE;
	}

	return Status;
}
/******************************************************************************
 * @brief	This function checks if correctable error counter is incremented
 * 	        after error injection is successful
 *
 * @param[in]	IntialCorErrCnt : Error count before error injection
 * @param[out]	ExpectedCount : Expected error count after injection
 *
 * @return	Status : Success or Failure
 *
 *****************************************************************************/
@brief       This function checks if correctable error counter is incremented
after error injection is successful

@param[in]   IntialCorErrCnt : Error count before error injection
@param[out]  ExpectedCount : Expected error count after injection

@return      Status : Success or Failure
@brief This function checks if correctable error counter is incremented after error injection is successful @param [ in ] IntialCorErrCnt : Error count before error injection @param [ out ] ExpectedCount : Expected error count after injection @return Status : Success or Failure
XStatus ApiChkErrorCount(u32 IntialCorErrCnt, u32 ExpectedCount)
{
	XStatus Status = XST_SUCCESS;
	XSemCfrStatus CfrStatusInfo = {0};
	u32 TotalCorErrCnt = 0U;
	(void)XSem_CmdCfrGetStatus(&CfrStatusInfo);
	TotalCorErrCnt = CfrStatusInfo.ErrCorCnt - IntialCorErrCnt;
	if(TotalCorErrCnt != ExpectedCount){
		Status = XST_FAILURE;
	}
	return Status;
}
XStatus ApiChkErrorCount ( u32 IntialCorErrCnt , u32 ExpectedCount ) { XStatus Status = XST_SUCCESS ; XSemCfrStatus CfrStatusInfo = { 0 } ; u32 TotalCorErrCnt = 0U ; ( void ) XSem_CmdCfrGetStatus ( & CfrStatusInfo ) ; TotalCorErrCnt = CfrStatusInfo . ErrCorCnt - IntialCorErrCnt ; if ( TotalCorErrCnt != ExpectedCount ) { Status = XST_FAILURE ; } return Status ; }
@brief       This function checks if correctable error counter is incremented
              after error injection is successful
@brief This function checks if correctable error counter is incremented after error injection is successful