PDK API Guide for J721E
PROXY Functions

Introduction

===========================================================================

Functions

uint32_t CSL_proxyGetRevision (const CSL_ProxyCfg *pProxyCfg)
 Return revision of the Proxy module. More...
 
uint32_t CSL_proxyGetNumThreads (const CSL_ProxyCfg *pProxyCfg)
 Get number of threads supported. More...
 
int32_t CSL_proxyCfgGlobalErrEvtNum (const CSL_ProxyCfg *pProxyCfg, uint32_t globalErrEvtNum)
 Configure the event number used for global errors. More...
 
int32_t CSL_proxyCfgThread (CSL_ProxyCfg *pProxyCfg, uint32_t targetNum, uint32_t threadNum, const CSL_ProxyThreadCfg *pThreadCfg)
 Configure a proxy thread. More...
 
int32_t CSL_proxyCfgThreadErrEvtNum (CSL_ProxyCfg *pProxyCfg, uint32_t targetNum, uint32_t threadNum, uint32_t errEvtNum)
 Configure a proxy thread's error event number. More...
 
uint32_t CSL_proxyGetMaxMsgSize (const CSL_ProxyCfg *pProxyCfg, uint32_t targetNum)
 Get maximim message size. More...
 
uintptr_t CSL_proxyGetDataAddr (const CSL_ProxyCfg *pProxyCfg, uint32_t targetNum, uint32_t threadNum, uint32_t numBytes)
 Get the read/write data address for the specified thread. More...
 
void CSL_proxyAccessTarget (CSL_ProxyCfg *pProxyCfg, uint32_t targetNum, uint32_t threadNum, uint8_t *pData, uint32_t numBytes, CSL_ProxyMemAccessCbFxnPtr fpMemAccess)
 Access (read/write) from/to the specified thread. More...
 
static void CSL_proxySetQueueAccessMode (const CSL_ProxyCfg *pProxyCfg, uint32_t targetNum, uint32_t threadNum, CSL_ProxyQueueAccessMode mode)
 Set the queue access mode. More...
 
static void CSL_proxySetQueueParms (const CSL_ProxyCfg *pProxyCfg, uint32_t targetNum, uint32_t threadNum, uint32_t queueNum, uint32_t elSz, CSL_ProxyQueueAccessMode mode)
 Set the queue parameters. More...
 
static uint32_t CSL_proxyIsThreadError (const CSL_ProxyCfg *pProxyCfg, uint32_t targetNum, uint32_t threadNum)
 Get thread error status. More...
 
static void CSL_proxyClrThreadError (const CSL_ProxyCfg *pProxyCfg, uint32_t targetNum, uint32_t threadNum)
 Clear thread error status. More...
 

Function Documentation

◆ CSL_proxyGetRevision()

uint32_t CSL_proxyGetRevision ( const CSL_ProxyCfg pProxyCfg)

Return revision of the Proxy module.

This function returns the contents of the Proxy revision register. Consult the Proxy module documentation for a description of the contents of the revision register.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
Returns
The 32-bit revision register is returned.

◆ CSL_proxyGetNumThreads()

uint32_t CSL_proxyGetNumThreads ( const CSL_ProxyCfg pProxyCfg)

Get number of threads supported.

This function returns the number of threads supported by the proxy.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
Returns
The number of threads supported by the proxy

◆ CSL_proxyCfgGlobalErrEvtNum()

int32_t CSL_proxyCfgGlobalErrEvtNum ( const CSL_ProxyCfg pProxyCfg,
uint32_t  globalErrEvtNum 
)

Configure the event number used for global errors.

This function is used to configure the event number used for reporting global errors. This feature is available in proxy revisions 1.0.14.0 and later.

Global errors include the following:

  • Attempting to access an illegal proxy thread
  • Attempting to access an illegal offset within a target, such as beyond the target size or buffer size, or if the access spans multiple channels

Global errors do not include the following (there is a separate event number MMR per proxy for these errors):

  • Accessing reserved MMR locations within the proxy thread
  • Host changes the target, resource, or access direction before completing the previous data

Specifying CSL_PROXY_GLOBAL_ERR_EVT_DISABLE (0xFFFFU) for the globalErrEvtNum parameter will disable the error event from being sent.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
globalErrEvtNum[IN] Error event number
Returns
0 = Success -1 = Feature is unavailable

◆ CSL_proxyCfgThread()

int32_t CSL_proxyCfgThread ( CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum,
uint32_t  threadNum,
const CSL_ProxyThreadCfg pThreadCfg 
)

Configure a proxy thread.

This function is used to configure a proxy thread.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
threadNum[IN] Thread number (0..CSL_proxyGetNumThreads()-1)
pThreadCfg[IN] Pointer to a CSL_ProxyThreadCfg structure containing the thread configuration
Returns
0 = Success -1 = Invalid argument (targetNum, threadNum, pProxyCfg->elSz, or pProxyCfg->queueNum out of range)

◆ CSL_proxyCfgThreadErrEvtNum()

int32_t CSL_proxyCfgThreadErrEvtNum ( CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum,
uint32_t  threadNum,
uint32_t  errEvtNum 
)

Configure a proxy thread's error event number.

This function is used to configure a proxy thread's error event number.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
threadNum[IN] Thread number (0..CSL_proxyGetNumThreads()-1)
errEvtNum[IN] Error event number
Returns
0 = Success -1 = Invalid argument (targetNum or threadNum out of range)

◆ CSL_proxyGetMaxMsgSize()

uint32_t CSL_proxyGetMaxMsgSize ( const CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum 
)

Get maximim message size.

This function returns the maximum message size (in bytes) for the specified proxy target. This value is the lesser of the proxy's buffer size and the target's channel size.

Parameters
pProxyCfg[IN] Pointer to a CSL_SecProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
Returns
The maximum message size (in bytes) is returned, or 0 if targetNum is out of range.

◆ CSL_proxyGetDataAddr()

uintptr_t CSL_proxyGetDataAddr ( const CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum,
uint32_t  threadNum,
uint32_t  numBytes 
)

Get the read/write data address for the specified thread.

This function returns the data address the application should use to read/write the specified number of bytes corresponding to the specified thread.

Note that for performance reasons, no error checking is performed by this function. For this reason, you must insure the arguments specified meet the requirements listed below.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
threadNum[IN] Thread number (0..CSL_proxyGetNumThreads()-1)
numBytes[IN] The number of bytes to be read or written (0..CSL_proxyGetMaxMsgSize(pProxyCfg)).
Returns
The data address is returned

◆ CSL_proxyAccessTarget()

void CSL_proxyAccessTarget ( CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum,
uint32_t  threadNum,
uint8_t *  pData,
uint32_t  numBytes,
CSL_ProxyMemAccessCbFxnPtr  fpMemAccess 
)

Access (read/write) from/to the specified thread.

This function is used to read/write the specified number of bytes from/to to the specified thread. The queue access mode used is that specified in the CSL_ProxyThreadCfg structure or the last call to the CSL_proxySetQueueAccessMode or CSL_proxySetQueueParms functions.

Note that for performance reasons, no error checking is performed by this function. For this reason, you must insure the arguments specified meet the requirements listed below.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
threadNum[IN] Thread number (0..CSL_proxyGetNumThreads()-1)
pData[IN] A pointer (of type uint8_t*) to the data to be written (must be at least numBytes in size)
numBytes[IN] The number of bytes to be written (0..CSL_proxyGetMaxMsgSize(pProxyCfg)).
fpMemAccess[IN] A pointer to a function that performs the memory access. See CSL_ProxyMemAccessCbFxnPtr for the syntax of this function.
Returns
None

◆ CSL_proxySetQueueAccessMode()

static void CSL_proxySetQueueAccessMode ( const CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum,
uint32_t  threadNum,
CSL_ProxyQueueAccessMode  mode 
)
inlinestatic

Set the queue access mode.

This function sets the queue access mode for the specified thread and target.

Note that for performance reasons, no error checking is performed by this function. For this reason, you must insure the arguments specified meet the requirements listed below.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
threadNum[IN] Thread number (0..CSL_proxyGetNumThreads()-1)
mode[IN] Queue access mode (see CSL_ProxyQueueAccessMode)
Returns
None

◆ CSL_proxySetQueueParms()

static void CSL_proxySetQueueParms ( const CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum,
uint32_t  threadNum,
uint32_t  queueNum,
uint32_t  elSz,
CSL_ProxyQueueAccessMode  mode 
)
inlinestatic

Set the queue parameters.

This function sets the queue parameters for the specified thread and target.

Note that for performance reasons, no error checking is performed by this function. For this reason, you must insure the arguments specified meet the requirements listed below.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
threadNum[IN] Thread number (0..CSL_proxyGetNumThreads()-1)
queueNum[IN] Queue number in the target to use for the proxy thread
elSz[IN] Queue (ring) element size in bytes (4,8,16,32,64,128,256,512)
mode[IN] Queue access mode (see CSL_ProxyQueueAccessMode)
Returns
None

◆ CSL_proxyIsThreadError()

static uint32_t CSL_proxyIsThreadError ( const CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum,
uint32_t  threadNum 
)
inlinestatic

Get thread error status.

This function returns the error status of the specified thread.

If an error is detected on the thread, an error event (using the errEvtNum specified in the thread configuration) is generated. While in error, a thread will not process any operations. Call CSL_proxyClrThreadError to clear the error and reset the thread.

Note that for performance reasons, no error checking is performed by this function. For this reason, you must insure the arguments specified meet the requirements listed below.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
threadNum[IN] Thread number (0..CSL_proxyGetNumThreads()-1)
Returns
0=no error, 1=error detected on the thread

◆ CSL_proxyClrThreadError()

static void CSL_proxyClrThreadError ( const CSL_ProxyCfg pProxyCfg,
uint32_t  targetNum,
uint32_t  threadNum 
)
inlinestatic

Clear thread error status.

This function clears the error status of the specified thread. While in error, a thread will not process any operations.

Note that for performance reasons, no error checking is performed by this function. For this reason, you must insure the arguments specified meet the requirements listed below.

Parameters
pProxyCfg[IN] Pointer to a CSL_ProxyCfg structure containing the Proxy configuration
targetNum[IN] The proxy target number (0..pProxyCfg->numTargets-1)
threadNum[IN] Thread number (0..CSL_proxyGetNumThreads()-1)
Returns
None