| trafgen Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
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 Genrator.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.

## Functions
int | XTrafGenStaticModeExample (XTrafGen *InstancePtr, u16 DeviceId)
| 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,
|  | u16 | DeviceId
| ) |  |

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

  InstancePtr | is a pointer to the instance of the XTrafGen component.
  DeviceId | is Device ID of the Axi Traffic Generator Device,
  InstancePtr | is a pointer to the instance of the XTrafGen component.
  DeviceId | is Device ID of the Axi Traffic Generator Device, typically XPAR_<TRAFGEN_instance>_DEVICE_ID value from xparameters.h.

Returns
  -XST_SUCCESS to indicate success -XST_FAILURE to indicate failure

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().