Initializing the SEU Mitigation - 2021.2 English

Xilinx Standalone Library Documentation: OS and Libraries Document Collection

Document ID
UG643
Release Date
2021-10-27
Version
2021.2 English

To initialize the SEU mitigation, it is first necessary to successfully initialize the inter-processor interrupt (IPI). The following reference code, which can be part of an RPU or APU application, illustrates how to initialize the IPI:

#define TARGET_IPI_INT_DEVICE_ID	
					(XPAR_XIPIPSU_0_DEVICE_ID)

/* Load Config for Processor IPI Channel */
IpiCfgPtr = XIpiPsu_LookupConfig(TARGET_IPI_INT_DEVICE_ID);
if (NULL == IpiCfgPtr) {
	xil_printf("[%s] ERROR: IPI LookupConfig failed\n\r", \
			__func__, Status);
	goto END;
}

/* Initialize the IPI Instance pointer */
Status = XIpiPsu_CfgInitialize(&IpiInst, IpiCfgPtr,
		IpiCfgPtr->BaseAddress);
if (XST_SUCCESS != Status) {
	xil_printf("[%s] ERROR: IPI instance initialize failed\n\r", \
			__func__, Status);
	goto END;
}

Although Configuration RAM scan can be configured to begin automatically, in XilSEM library configurations where this option is not selected (deferred start-up), you are responsible for manually starting the Configuration RAM scan. The following reference code, which can be part of an RPU or APU application, illustrates how to accomplish Configuration RAM scan start-up.

Note: When you choose the "Deferred start-up" option, do not perform error injection or partial bit stream loading without this initialization.
XStatus Status = XST_FAILURE;
XSemIpiResp IpiResp={0};
Status = XSem_CmdCfrInit(&IpiInst, &IpiResp);
if ((XST_SUCCESS == Status) && (CMD_ACK_CFR_INIT == IpiResp.RespMsg1) && (XST_SUCCESS == IpiResp.RespMsg2)) {
       xil_printf("Success: CRAM Initialization Successful\n\r");
} else {
xil_printf("Failure: CRAM Initialization Failed\n\r");       
Status = XST_FAILURE;
}

Similarly, NPI Register scan can be configured to begin automatically, and in XilSEM library configurations where this option is not selected, you are responsible for manually starting the NPI Register scan. The following reference code, which can be part of an RPU or APU application, illustrates how to accomplish NPI Register scan start-up.

Note: An NPI scan cannot be performed in SHA3 disabled devices. If SHA3 is not present, XilSEM updates the status in NPI scan status register. You can use the XSem_CmdNpiGetStatus API to know NPI scan status.
XStatus Status = XST_FAILURE;
XSemIpiResp IpiResp={0};
Status = XSem_CmdNpiStartScan(&IpiInst, &IpiResp);
if ((XST_SUCCESS == Status) && (CMD_ACK_NPI_STARTSCAN == IpiResp.RespMsg1) && (XST_SUCCESS == IpiResp.RespMsg2)) {
       xil_printf("Success: NPI Initialization Successful\n\r");
} else {
       xil_printf("Failure: NPI Initialization Failed\n\r");
       Status = XST_FAILURE;
}