trafgen
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
xtrafgen_static_mode_example.c File Reference

Overview

This file demonstrates how to use the xtrafgen driver on the Xilinx AXI Traffic Generator core.

The AXI Traffic Generator IP is designed to generate AXI4 traffic which can be used to stress different modules/ interconnect connected in the system.

This example demonstrates how to use the Static mode in the Axi Traffic Generator.In Static mode the core continuously generates fixed address and fixed INCR type read and write transfers based on the burst length configured.

MODIFICATION HISTORY:
Ver   Who  Date     Changes
----- ---- -------- -------------------------------------------------------
1.01a adk  03/09/13 First release
2.00a adk  16/09/13 Fixed CR:737291
4.1   ms   01/23/17 Modified xil_printf statement in main function to
                    ensure that "Successfully ran" and "Failed" strings
                    are available in all examples. This is a fix for
                    CR-965028.
      ms   04/05/17 Added tabspace for return statements in functions for
                    proper documentation while generating doxygen.
4.9  vlt  12/18/25 Update Doxygen comments to include SDT flow details.
     vlt  01/27/26 Fixed codespell issues.

#include "xtrafgen.h"
#include "xparameters.h"
#include "xil_exception.h"

Functions

int XTrafGenStaticModeExample (XTrafGen *InstancePtr, UINTPTR BaseAddress)
 This function demonstrates the usage Traffic Generator It does the following: More...
 
int main ()
 Main function. More...
 

Function Documentation

int main ( )

Main function.

This function is the main entry of the traffic generator test.

Parameters
None
Returns
  • XST_SUCCESS if tests pass
  • XST_FAILURE if fails.
Note
None.

References XTrafGenStaticModeExample().

int XTrafGenStaticModeExample ( XTrafGen InstancePtr,
UINTPTR  BaseAddress 
)

This function demonstrates the usage Traffic Generator It does the following:

  - Set up the output terminal if UART16550 is in the hardware build
  - Initialize the AXI Traffic Generator device
  - Fill's the Target memory with required data
  - Enable the Traffic generation
  - Disable the Traffic generation
  - Return test status and exit
Parameters
InstancePtris a pointer to the instance of the XTrafGen component.
DeviceIdis Device ID of the Axi Traffic Generator Device,
InstancePtris a pointer to the instance of the XTrafGen component.
BaseAddresscontains the base address of the device
Returns
-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XTrafGen_Config::BaseAddress, XTrafGen::OperatingMode, XTG_MODE_STATIC, XTG_STREAM_CNTL_TD_MASK, XTrafGen_CfgInitialize(), XTrafGen_GetStaticTransferDone, XTrafGen_IsStaticTransferDone, XTrafGen_LookupConfig(), XTrafGen_SetStaticBurstLen, XTrafGen_SetStaticTransferDone, XTrafGen_StaticDisable, and XTrafGen_StaticEnable.

Referenced by main().