| srio Vitis Drivers API Documentation

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

Functions
xsrio_dma_loopback_example.c File Reference

## Overview

This file demonstrates how to use xsrio driver on the Xilinx SRIO Gen2 Core.

The SRIO Gen2 comprised of phy, logical and transport and buffer layers. Using this IP We can generate both messaging and read/write semantics.

This example demonstartes how to generate SWRITE(Streaming Write) transactions on the core.

Inorder to test this example external loopback is required at the boardlevel Between the SRIO Tx and Rx pins.

H/W Requirments: Inorder to test this example at the h/w level the the SRIO Initiator Request is connected to the AXI DMA MM2S Channel and SRIO Target Request is connected to the AXI DMA S2MM Channel.

S/W Flow: 1) The system consists of two different memories.Processor runs this example Code in one memory and the SRIO packet is formed in another memory. 2) The SRIO Packet is framed in the Memory 3) Configure the AXI DMA MM2S source address and S2MM for Destiantion address and specify the byte count for both the channels and then start the dma. 4) Compare the Data.

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes
    ----- ---- -------- -------------------------------------------------------
    1.0   adk  16/04/14     Initial release
    1.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.
    1.6   adk  06/02/24     Added support for system device-tree flow.

## Functions
int | XSrioDmaLoopbackExample (XSrio *InstancePtr, u16 DeviceId)
| XSrioDmaLoopbackExample This function does a minimal test on the XSrio device and driver as a design example. More...
int | main ()
| Main function. More...

## Function Documentation

int main | ( |  | ) |

Main function.

This function is the main entry of the SRIO DMA Loopback test.

Parameters

  None |

Returns
  - XST_SUCCESS if tests pass
    - XST_FAILURE if fails.

Note
  None

References XSrioDmaLoopbackExample().

int XSrioDmaLoopbackExample | ( | XSrio * | InstancePtr,
|  | u16 | DeviceId
| ) |  |

XSrioDmaLoopbackExample This function does a minimal test on the XSrio device and driver as a design example.

The purpose of this function is to illustrate how to use the XSrio Component.

This function does the following:

- Initialize the SRIO device
  - Initialize the DMA engine
- Clearing the Memory
  - Framing the SRIO Packet in the Memory
- Configuring the SRIO
  - Configuring the DMA
- Verifying the Data

Parameters

  InstancePtr | is a pointer to the instance of the XSrio driver.
  DeviceId | is Device ID of the SRIO Gen2 Device.

Returns
  -XST_SUCCESS to indicate success -XST_FAILURE to indicate failure

References XSrio_Config::BaseAddress, XSrio_CfgInitialize(), XSRIO_DIR_RX, XSRIO_DIR_TX, XSrio_GetPEType(), XSRIO_IS_MEMORY, XSrio_IsOperationSupported(), XSrio_LookupConfig(), XSRIO_OP_MODE_SWRITE, XSrio_SetLCSBA, XSrio_SetPortRespTimeOutValue, and XSrio_SetWaterMark().

Referenced by main().