trafgen
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
xtrafgen_master_streaming_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 Streaming mode in Axi Traffic Generator When Configured in Master only mode.In this mode the core generates Streaming Traffic based on the transfer length and transfer count configured. To test this example hardware Must contain a Streaming FIFO and the Connections To Axi TrafficGen needs to made As shown below


____________ _________|AXI_STR_RXD | | | | | | | |_____| | | | axi_master| |________________| |____________|

Axi TrafficGen Axi Stream FIFO

 MODIFICATION HISTORY:
 Ver   Who  Date     Changes
 ----- ---- -------- -------------------------------------------------------
 1.01a adk  03/09/13 First release
 2.00a adk  16/09/13 Fixed CR:737291
 2.01a adk  15/11/13 Fixed CR:760808
 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 and also
                     modified filename tag to include the file in doxygen
                     examples.
 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 XTrafGenStremingModeMasterExample (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 XTrafGenStremingModeMasterExample().

int XTrafGenStremingModeMasterExample ( 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
  - Initialize the Streaming FIFO device
  - Set the Desired Transfer Count and Transfer Length
  - Enable the Traffic Generation on the Core
  - Check for the Streaming data on the FIFO
  - 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_STREAMING, XTrafGen_CfgInitialize(), XTrafGen_GetStreamingTransCnt, XTrafGen_GetStreamingTransLen, XTrafGen_LookupConfig(), XTrafGen_ResetStreamingRandomLen, XTrafGen_SetStreamingTransCnt, XTrafGen_SetStreamingTransLen, and XTrafGen_StreamEnable.

Referenced by main().