aiengine: xsock.c File Reference

| aiengine Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

xsock.c File Reference

## Overview

This file contains the routines for client side socket creation and management.

Applicable only for the AIE simulation environment execution on linux.

    MODIFICATION HISTORY:

    Ver   Who     Date     Changes

    1.0  Naresh  03/27/2018  Initial creation
    1.1  Naresh  06/13/2018  Fixed CR#1003905
    1.2  Naresh  07/11/2018  Updated copyright info
    1.3  Nishad  12/05/2018  Renamed ME attributes to AIE

XSockStr | GblSockStr
| < Handle to store the client socket instance pointer More...
sint32 | XSock_CliCreate (XSockCli *SockPtr, uint8 *Host, uint32 PortNum)
| This is the API to create the client socket connection to the specified host. More...
sint32 | XSock_CliWrite (XSockCli *SockPtr, uint8 *Buffer, uint32 Size)
| This API is to write specified number of bytes to the client socket. More...
sint32 | XSock_CliRead (XSockCli *SockPtr, uint8 *Buffer, uint32 Size)
| This API is to read specified number of bytes from the client socket. More...
sint32 | XSock_CliClose (XSockCli *SockPtr)
| This API is to close the client socket connection. More...
uint32 | XSock_Read32 (uint64_t Addr)
| This is the memory IO function to read 32bit data from the specified address. More...
void | XSock_Read128 (uint64_t Addr, uint32 *Data)
| This is the memory IO function to read 128b data from the specified address. More...
void | XSock_Write32 (uint64_t Addr, uint32 Data)
| This is the memory IO function to write 32bit data to the specified address. More...
void | XSock_Write128 (uint64_t Addr, uint32 *Data)
| This is the memory IO function to write 128bit data to the specified address. More...
void | XSock_WriteCmd (uint8 Command, uint8 ColId, uint8 RowId, uint32 CmdWd0, uint32 CmdWd1, uint8 *CmdStr)
| This is the memory IO function to write 128bit data to the specified address. More...

## Function Documentation

sint32 XSock_CliClose | ( | XSockCli * | SockPtr | ) |

This API is to close the client socket connection.

Parameters

  SockPtr,: | Pointer to the client socket data structure.

Returns
  XAIESIM_SUCCESS on success, else XAIESIM_FAILURE.

Note
  None.

References XSockCli::SockId.

Referenced by main().

sint32 XSock_CliCreate | ( | XSockCli * | SockPtr,
|  | uint8 * | Host,
|  | uint32 | PortNum
| ) |  |

This is the API to create the client socket connection to the specified host.

Parameters

  SockPtr,: | Pointer to the client socket data structure.
  Host,: | Pointer to the host name string.
  PortNum,: | Port number to which the socket needs to connect to.

Returns
  XAIESIM_SUCCESS on success, else XAIESIM_FAILURE.

Note
  None.

References XSockStr::CliSockPtr, XSockCli::Serv, XSockCli::ServAddr, and XSockCli::SockId.

Referenced by main().

sint32 XSock_CliRead | ( | XSockCli * | SockPtr,
|  | uint8 * | Buffer,
|  | uint32 | Size
| ) |  |

This API is to read specified number of bytes from the client socket.

Parameters

  SockPtr,: | Pointer to the client socket data structure.
  Buffer,: | Pointer to the data buffer.
  Size,: | Maximum number of bytes to read.

Returns
  XAIESIM_SUCCESS on success, else XAIESIM_FAILURE.

Note
  None.

References XSockCli::SockId.

Referenced by main(), and XSock_Read32().

sint32 XSock_CliWrite | ( | XSockCli * | SockPtr,
|  | uint8 * | Buffer,
|  | uint32 | Size
| ) |  |

This API is to write specified number of bytes to the client socket.

Parameters

  SockPtr,: | Pointer to the client socket data structure.
  Buffer,: | Pointer to the data buffer.
  Size,: | Number of bytes to be written.

Returns
  XAIESIM_SUCCESS on success, else XAIESIM_FAILURE.

Note
  None.

References XSockCli::SockId.

Referenced by main(), XSock_Read32(), XSock_Write128(), XSock_Write32(), and XSock_WriteCmd().

void XSock_Read128 | ( | uint64_t | Addr,
|  | uint32 * | Data
| ) |  |

This is the memory IO function to read 128b data from the specified address.

Parameters

  Addr,: | Address to read from.
  Data,: | Pointer to the 128-bit buffer to store the read data.

Returns
  None.

Note
  None.

uint32 XSock_Read32 | ( | uint64_t | Addr | ) |

This is the memory IO function to read 32bit data from the specified address.

Parameters

  Addr,: | Address to read from.

Returns
  32-bit read value.

Note
  None.

References XSockStr::CliSockPtr, XSock_CliRead(), and XSock_CliWrite().

void XSock_Write128 | ( | uint64_t | Addr,
|  | uint32 * | Data
| ) |  |

This is the memory IO function to write 128bit data to the specified address.

Parameters

  Addr,: | Address to write to.
  Data,: | Pointer to the 128-bit data buffer.

Returns
  None.

Note
  None.

References XSockStr::CliSockPtr, and XSock_CliWrite().

void XSock_Write32 | ( | uint64_t | Addr,
|  | uint32 | Data
| ) |  |

This is the memory IO function to write 32bit data to the specified address.

Parameters

  Addr,: | Address to write to.
  Data,: | 32-bit data to be written.

Returns
  None.

Note
  None.

References XSockStr::CliSockPtr, and XSock_CliWrite().

void XSock_WriteCmd | ( | uint8 | Command,
|  | uint8 | ColId,
|  | uint8 | RowId,
|  | uint32 | CmdWd0,
|  | uint32 | CmdWd1,
|  | uint8 * | CmdStr
| ) |  |

This is the memory IO function to write 128bit data to the specified address.

Parameters

  Addr,: | Address to write to.
  Data,: | Pointer to the 128-bit data buffer.

Returns
  None.

Note
  None.

References XSockStr::CliSockPtr, and XSock_CliWrite().

## Variable Documentation

XSockStr GblSockStr

< Handle to store the client socket instance pointer