![]() |
prc
Xilinx SDK Drivers API Documentation
|
This file contains an example using the XPrc driver to test the registers on the device.
MODIFICATION HISTORY:
Ver Who Date Changes
1.0 ms 07/18/2016 First Release ms 04/05/2017 Modified comment lines notation in functions to avoid unnecessary description displayed while generating doxygen.
Macros | |
| #define | XPRC_DEVICE_ID XPAR_PRC_0_DEVICE_ID |
| The following constants map to the XPAR parameters created in the xparameters.h file. More... | |
Functions | |
| u32 | XPrc_Example (u16 DeviceId) |
| This function does a minimal test on the PRC device and driver as a design example. More... | |
| u32 | Xprc_Check_User_Command (u16 VsmId, XGpio ShiftVsmGpio, XGpio CountVsmGpio) |
| This function is used to test the User Command. More... | |
| u32 | Xprc_Check_RestartWithStatus_Command (u16 VsmId) |
| This function is used to test the Restart with Status Command. More... | |
| u32 | Xprc_Check_TriggerRmMapping (u16 VsmId) |
| This function is used to test that we can set/get the Trigger to RM mapping registers. More... | |
| u32 | Xprc_Check_BsIndex_Reg (u16 VsmId) |
| This function is used to test that we can set/get the BS Index registers. More... | |
| u32 | Xprc_Check_RmControl_Reg (u16 VsmId) |
| This function is used to test that we can set/get the RM Control registers. More... | |
| u32 | Xprc_Check_BsSize_Reg (u16 VsmId) |
| This function is used to test that we can set/get the BS Size registers. More... | |
| u32 | Xprc_Check_BsAddress_Reg (u16 VsmId) |
| This function is used to test that we can set/get the BS Address registers. More... | |
| u32 | Xprc_Program_PRC (u16 VsmId) |
| This function is used to Program the PRC. More... | |
| void | Xprc_Restart_VSMs (u16 VsmId) |
| This function is used to Restart the VSMs. More... | |
| int | main (void) |
| This is the main function to call the example. More... | |
| #define XPRC_DEVICE_ID XPAR_PRC_0_DEVICE_ID |
The following constants map to the XPAR parameters created in the xparameters.h file.
They are defined here such that a user can easily change all the needed parameters in one place.
Referenced by main().
| int main | ( | void | ) |
This is the main function to call the example.
| None. |
References XPRC_DEVICE_ID, and XPrc_Example().
| u32 Xprc_Check_BsAddress_Reg | ( | u16 | VsmId | ) |
This function is used to test that we can set/get the BS Address registers.
| VsmId | is the identifier of the VSM to access. |
References XPrc_GetBsAddress(), XPrc_GetNumberOfVsms, XPrc_GetNumRmsAllocated, and XPrc_SetBsAddress().
| u32 Xprc_Check_BsIndex_Reg | ( | u16 | VsmId | ) |
This function is used to test that we can set/get the BS Index registers.
| VsmId | is the identifier of the VSM to access. |
References XPrc_GetNumberOfVsms, XPrc_GetNumRmsAllocated, XPrc_GetRmBsIndex(), and XPrc_SetRmBsIndex().
| u32 Xprc_Check_BsSize_Reg | ( | u16 | VsmId | ) |
This function is used to test that we can set/get the BS Size registers.
| VsmId | is the identifier of the VSM to access. |
References XPrc_GetBsSize(), XPrc_GetNumberOfVsms, XPrc_GetNumRmsAllocated, and XPrc_SetBsSize().
| u32 Xprc_Check_RestartWithStatus_Command | ( | u16 | VsmId | ) |
This function is used to test the Restart with Status Command.
Flip the VSM state and set a new RM. Check the status is as expected. Flip the VSM state back to what it was and set the original RM. Check the status is as expected
| VsmId | is the identifier of the VSM to access. |
References XPRC_CR_VS_EMPTY, XPRC_CR_VS_FULL, XPrc_GetNumberOfVsms, XPrc_GetNumRms, XPrc_GetRmIdFromStatus(), XPrc_GetVsmState(), XPrc_IsVsmInShutdown(), XPrc_ReadStatusReg(), XPrc_SendRestartWithNoStatusCommand(), XPrc_SendRestartWithStatusCommand(), XPrc_SendShutdownCommand(), XPRC_SR_STATE_EMPTY, and XPRC_SR_STATE_FULL.
| u32 Xprc_Check_RmControl_Reg | ( | u16 | VsmId | ) |
This function is used to test that we can set/get the RM Control registers.
| VsmId | is the identifier of the VSM to access. |
References XPrc_GetNumberOfVsms, XPrc_GetNumRmsAllocated, XPrc_GetRmControl(), and XPrc_SetRmControl().
| u32 Xprc_Check_TriggerRmMapping | ( | u16 | VsmId | ) |
This function is used to test that we can set/get the Trigger to RM mapping registers.
For each trigger allocated, set the value of the RM it will load.
| VsmId | is the identifier of the VSM to access. |
References XPrc_GetNumberOfVsms, XPrc_GetNumRmsAllocated, XPrc_GetNumTriggersAllocated, XPrc_GetTriggerToRmMapping(), and XPrc_SetTriggerToRmMapping().
| u32 Xprc_Check_User_Command | ( | u16 | VsmId, |
| XGpio | ShiftVsmGpio, | ||
| XGpio | CountVsmGpio | ||
| ) |
This function is used to test the User Command.
| VsmId | is the identifier of the VSM to access. |
| ShiftVsmGpio | is Instance of the GPIO attached to the PRC's Shift VSM. |
| CountVsmGpio | is Instance of the GPIO attached to the PRC's Count VSM. |
References XPRC_CR_USER_CONTROL_RM_DECOUPLE_BIT, XPRC_CR_USER_CONTROL_RM_RESET_BIT, XPRC_CR_USER_CONTROL_RM_SHUTDOWN_REQ_BIT, XPRC_CR_USER_CONTROL_SW_SHUTDOWN_REQ_BIT, XPRC_CR_USER_CONTROL_SW_STARTUP_REQ_BIT, XPrc_GetNumberOfVsms, and XPrc_SendUserControlCommand().
| u32 XPrc_Example | ( | u16 | DeviceId | ) |
This function does a minimal test on the PRC device and driver as a design example.
| DeviceId | is the XPAR_<prc_instance>_DEVICE_ID value from xparameters.h. |
References XPrc_CfgInitialize(), XPrc_LookupConfig(), and XPrc_SelfTest().
Referenced by main().
| u32 Xprc_Program_PRC | ( | u16 | VsmId | ) |
This function is used to Program the PRC.
| VsmId | is the identifier of the VSM to access. |
References XPrc_GetNumberOfVsms, XPrc_GetNumRms, XPrc_SetBsAddress(), XPrc_SetBsSize(), XPrc_SetRmBsIndex(), and XPrc_SetRmControl().
| void Xprc_Restart_VSMs | ( | u16 | VsmId | ) |
This function is used to Restart the VSMs.
| VsmId | is the identifier of the VSM to access. |
References XPrc_GetNumberOfVsms, XPrc_IsVsmInShutdown(), and XPrc_SendRestartWithNoStatusCommand().