Control Example - 2025.1 English - UG1308

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Release Date
2025-05-29
Version
2025.1 English

The example summarizes Target and Control API functions to set the packet rate limit margin, and injecting ECC errors. This example C program is provided at the following location: <project_name>/<project_name>.gen/sources_1/ip/<inst_name>/src/sw/drivers/target/example/ctrl_example.c

This program demonstrates target driver function calls to achieve the following functionality:

  • Initialize the driver using XilVitisNetP4TargetInit()
  • Obtain a context for the control driver using XilVitisNetP4TargetGetCtrlDrv()
  • Reset all of the Vitis Networking P4 engines using XilVitisNetP4TargetCtrlSoftResetEngine()
  • Set the packet rate limit margin using XilVitisNetP4TargetCtrlSetPacketRateLimitMargin()
  • Enable and Disable ECC error injection for a single Vitis Networking P4 Component using XilVitisNetP4TargetCtrlIpComponentEnableInjectEccError() and XilVitisNetP4TargetCtrlIpComponentDisableInjectEccError()
  • Enable and Disable ECC error injection for a single P4 Element using XilVitisNetP4TargetCtrlP4ElementEnableInjectEccError() and XilVitisNetP4TargetCtrlP4ElementDisableInjectEccError()