![]() |
xilsem
Vitis Drivers API Documentation
|
This file demonstrates on how to use XilSEM NPI client interface on PL Microblaze to send commands to PLM firmware and read responses from PLM.
Following is the procedure to provide shared memory region which can be accessed by server
In linker script(lscript.ld) user can add new memory section in source tab as shown below
.sem_decdata : {
KEEP (*(.sem_decdata))
} > axi_noc_0_C0_DDR_LOW0
MODIFICATION HISTORY:
Ver Who Date Changes
0.1 gupta 11/16/2022 Initial Creation 0.2 anv 10/18/2023 Added macro to Enable Error Injection Feature usage and Updated Xilsem prints to get Npi status information and Added Test print summary 0.3 gam 01/02/2023 Fixed IPI interrupt ID for PL MB Versal Net, Removed false else condition in main function for XSem_CmdNpiGetStatus API as this is not a valid case for deferred start-up.
Macros | |
| #define | INTC_DEVICE_IPI_INT_ID XPAR_AXI_INTC_0_VERSAL_CIPS_0_PSPMC_0_PS_PL_IRQ_LPD_IPI_IPI1_INTR |
| Interrupt Number of IPI whose interrupt output is connected to the input of the Interrupt Controller. More... | |
Functions | |
| XStatus | XSem_ApiCheckScanCount (XSemNpiStatus *NpiStatus) |
| XStatus | XSem_ApiCheckHbtCount (XSemNpiStatus *NpiStatus) |
| int | XSem_NpiEventRegisterNotifier (u32 Enable) |
| int | SetUpInterruptSystem (XIntc *XIntcInstancePtr) |
| This function connects the IPI interrupts to the interrupt controller and to the processor. More... | |
| int | IntcAndIpiInit (void) |
| This function initializes Interrupt Controller and IPI drivers. More... | |
| int | main (void) |
| The purpose of this function is to illustrate the usage of client APIs for NPI scan over IPI. More... | |
| #define INTC_DEVICE_IPI_INT_ID XPAR_AXI_INTC_0_VERSAL_CIPS_0_PSPMC_0_PS_PL_IRQ_LPD_IPI_IPI1_INTR |
Interrupt Number of IPI whose interrupt output is connected to the input of the Interrupt Controller.
Referenced by SetUpInterruptSystem().
| int IntcAndIpiInit | ( | void | ) |
This function initializes Interrupt Controller and IPI drivers.
Initialize the interrupt controller driver so that it is ready to use.
Perform a self-test to ensure that the hardware was built correctly.
References SetUpInterruptSystem().
| int main | ( | void | ) |
The purpose of this function is to illustrate the usage of client APIs for NPI scan over IPI.
Disable cache to get the shared buffer data from physical memory which is updated by PLM in response to NPI commands
Initialize IPI Driver This initialization is required to get XilSEM event notifications from PLM
The following sequence demonstrates how to inject errors in NPI
References CMD_ACK_NPI_ERRINJECT, CMD_ACK_NPI_GET_GLDN_SHA, CMD_ACK_NPI_STARTSCAN, CMD_ACK_NPI_STOPSCAN, XSem_DescriptorData::DescriptorCount, XSemNpiStatus::ErrInfo, XSemNpiStatus::HbCnt, IntcAndIpiInit(), MAX_NPI_ERR_INFO_CNT, MAX_NPI_SLV_SKIP_CNT, XSemIpiResp::RespMsg1, XSemIpiResp::RespMsg2, XSemNpiStatus::ScanCnt, XSemNpiStatus::SlvSkipCnt, XSemNpiStatus::Status, XSem_ApiCheckScanCount(), XSem_CmdNpiGetGldnSha(), XSem_CmdNpiGetStatus(), XSem_CmdNpiInjectError(), XSem_CmdNpiStartScan(), XSem_CmdNpiStopScan(), and XSem_NpiEventRegisterNotifier().
| int SetUpInterruptSystem | ( | XIntc * | XIntcInstancePtr | ) |
This function connects the IPI interrupts to the interrupt controller and to the processor.
| Intc | instance pointer. |
Connect IPI interrupt handler that will be called when an interrupt for the IPI occurs, the IPI interrupt handler performs the specific interrupt processing for IPI.
Start the interrupt controller such that interrupts are enabled for all devices that cause interrupts.
References INTC_DEVICE_IPI_INT_ID.
| XStatus XSem_ApiCheckHbtCount | ( | XSemNpiStatus * | NpiStatus | ) |
Small delay to ensure NPI scan progresses before second read. The delay value assumes 100ms as NPI scan interval
References XSemNpiStatus::HbCnt, and XSem_CmdNpiGetStatus().
| XStatus XSem_ApiCheckScanCount | ( | XSemNpiStatus * | NpiStatus | ) |
Small delay to ensure NPI scan progresses before second read. The delay value assumes 100ms as NPI scan interval
References XSemNpiStatus::ScanCnt, and XSem_CmdNpiGetStatus().
Referenced by main().
| int XSem_NpiEventRegisterNotifier | ( | u32 | Enable | ) |
In this example all NPI events are enabled If you want to enable particular event set the Event member in Notifier structure with corresponding event.
References XSem_Notifier::Flag, and XSem_RegisterEvent().
Referenced by main().