Detailed Description of Interface Functions

The following table gives a detailed description of parameters and returned values for the specified runtime access functions.

 

Function

int vaRt_OpenHap (const char* hapFileName, va_hap_handle* hap)

Parameter 1

Name of hap file which shall be opened.

Parameter 2

Return pointer for hap handle.

Description

Opens the hardware applet with the provided name and returns a pointer to the hap structure.

The returned pointer is used as a handle in all other interface functions.

Return value

0 :  OK

<0: Error opening applet

 

Function

int vaRt_CloseHap (va_hap_handle handle)

Parameter 1

Hap handle from vaRt_OpenHap().

Description

Closes the VA hardware applet.

Return value

0  = OK

<0 = Error closing HAP

 

Function

int vaRt_GetConfig (va_hap_handle handle, int fpgaID, char **data, size_t *sizeInBytes)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

ID of the FPGA within the target platform. For single-configuration HAP files (currently the only option) this parameter may be fixed to -1. Otherwise this parameter must correspond to the (optional) FPGA ID specified in the hardware definition file used for creating the VisualApplets platform.

Parameter 3

Pointer to buffer for the configuration bitstream.

Parameter 4

Communicate the size of the configuration bitstream in bytes.

Description

Get the configuration bitstream for the FPGA design. The function has two modes of operation:

    *data == NULL: the size of the bitstream in bytes is returned via parameter 4.

    *data != NULL: The buffer is filled with the bitstream. Parameter 4 must be set to the buffer size. Via the same parameter the actual bitstream length is returned.

Return value

0:  OK

<0:  Error acquiring the bitstream

Function

int vaRt_GetAppletProperty (va_hap_handle handle, const char* propName,
va_data * data)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Name of property which shall be queried.

Parameter 3

Pointer to data structure which will used for communication.

Description

Get property of the applet. Following properties may be queried:

“VisualAppletsVersion”: Get version of VisualApplets framework used for creating this applet (type VA_STRING)

“IPCoreVersion”: Get version of VA IP Core (type VA_STRING)

“AppletVersion”: Get applet version (type VA_STRING)

“DesignFreq”: Get frequency of design clock in MHz (type VA_DOUBLE)

“PlatformVendor”: Vendor of platform (type VA_STRING)

“PlatformType”: Name of hardware platform (type VA_STRING)

“PlatformID”: Identification number of platform device (type VA_STRING)

“PlatformVersion”: Platform device version as defined in the hardware description used for creating the applet (type VA_STRING)

The properties are identified by one of the above strings (provided through parameter 2) and communicated via the data structure given through parameter 3. For properties of type VA_STRING the returned string may be overwritten by the next call of this function.

Return value

0 : OK

<0 : Can’t retrieve applet property

 

Function

int vaRt_GetProcessCount (va_hap_handle handle, unsigned int* count)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Return value for process count.

Description

Get the number of processes of which the design is composed.

Return value

0: OK

<0 : Can’t retrieve information

 

Function

int vaRt_GetIoPortCount (va_hap_handle handle, unsigned int* count)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Return value for port count.

Description

Get the number of used I/O ports of the VA IP Core. The returned number represents the size of an internally managed port list where all interface ports are registered and the position in the list is the logical number of the I/O port.

Return value

0: OK

<0 : Can’t retrieve information

 

Function

int vaRt_GetIoPortName (va_hap_handle handle, unsigned int index, const char** name)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Logical interface port number, which is an integer between Zero and the returned value from vaRt_GetIoPortCount() minus 1

Description

Get the name of the interface port with the given logical number. When there are several ports of the same kind these ports are differentiated by a suffix “_X” where X is the port index (e.g. “DmaRd_0”).

Return value

0: OK; *name returns a pointer to a static buffer which holds the requested name (0-terminated). Note that the buffer may be overwritten by the next call of this function

<0 : No port with given index found

 

Function

int vaRt_GetIoPortProperty (va_hap_handle handle, const char* portName, const char* propName, va_data* data)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Name of I/O port.

Parameter 3

Name of property which shall be queried.

Parameter 4

Pointer to data structure which will be used for communication.

Description

Get property of the I/O port with the given name. Following properties may be queried:

“OperatorName”: User defined name of connected operator (type VA_STRING)

“OperatorType”: Operator type name of connected operator (type VA_STRING)

“Process”: Logical number of process in which the connected operator works (type VA_UINT32)

“FormatID”: Format ID of I/O operator (type VA_UINT32, only available for ports of type ImIn or ImgOut)

The properties are identified by one of the above strings (provided through parameter 3) and communicated via the data structure given through parameter 4. For properties of type VA_STRING the returned string may be overwritten by the next call of this function.

Return value

0: OK

<0 : Can’t retrieve the requested property

 

Function

int vaRt_InitParams (va_hap_handle handle, struct va_device *device, ReadReg32 *read32, WriteReg32 *write32, ReadReg64 *read64, WriteReg64 *write64)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Pointer to device handle which is provided to the low level access functions WriteReg32(), ReadReg32(), WriteReg64, and ReadReg64() for any register access.

Parameter 3

Function pointer for 32-Bit register read function.

Parameter 4

Function pointer for 32-Bit register write function.

Parameter 5

Function pointer for 64-Bit register read function.

Parameter 6

Function pointer for 64-Bit register write function.

Description

Initialize parameter interface by providing low level register access functions and associating a board interface pointer to them. The initialization procedure includes configuring initial values. Note that any other function vaRt_*Param* and the functions for controlling reset and enable may only be called after this function has been executed successfully.

Regarding the register access functions following options are available:

    Providing 32-Bit functions only

    Providing 64-Bit functions only

    Providing both 32-Bit and 64-Bit functions

Return value

0: Parameter interface has been initialized successfully

<0 : Error during initialization

 

Function

int vaRt_GetParamCount (va_hap_handle handle, unsigned int* count)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Return value for number of parameters.

Description

Get the number of parameters of the applet which can be accessed via the parameter interface. The returned number represents the size of an internally managed parameter list where all available parameters are registered and the position in the list defines the logical number of the parameter.

Return value

0: OK

<0 : Can’t retrieve information

 

Function

int vaRt_GetParamName (va_hap_handle handle, unsigned int index, const char** name)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Logical parameter number, which is an integer between Zero and the returned value from vaRt_GetParamCount() minus 1.

Parameter 3

Return pointer to name string.

Description

Get the name of the applet parameter by the given logical parameter number.

Return value

0: OK; *name returns a pointer to a static buffer which holds the parameter name (0-terminated). Note that the buffer may be overwritten by the next call of this function.

<0  : Can’t retrieve information

 

Function

int vaRt_GetParamId (const struct va_hap_handle* handle, unsigned int index, int* paramId)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Logical parameter number, which is an integer between Zero and the returned value from vaRt_GetParamCount() minus 1.

Parameter 3

Return pointer for parameter ID.

Description

Get the ID of a parameter of the applet. This ID is used for accessing that parameter.

Return value

0: OK

<0 : No parameter with given index found

 

Function

int vaRt_GetParamIdByName (const struct va_hap_handle* handle, const char* name, int* paramId)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Name of parameter which can be one of the values provided by vaRt_GetParamName().

Parameter 3

Return pointer for parameter ID.

Description

Get the ID of a parameter with the given name. This ID is used for accessing that parameter.

Return value

0: OK

<0 : No parameter with given name found

 

Function

int vaRt_GetParamProperty (va_hap_handle handle, int paramID, const char* propName, va_data* data)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Parameter name.

Parameter 3

Name of property which shall be queried.

Parameter 4

Pointer to data structure which will be used for communication.

Description

Query property of applet parameter. Different parameter types do have different properties. See the VA Engine specification for a list of available parameter properties. The properties are identified by a string given by parameter 3 and communicated via the data structure provided by parameter 4. For properties of type VA_STRING the returned string is stable at least until the parameter gets modified.

Return value

0 : OK

<0 : Can’t retrieve parameter property

 

Function

int vaRt_GetParam (va_hap_handle handle, int paramID, va_data * value)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Parameter ID.

Parameter 3

Pointer to data structure which will be used for communication. The associated data element will be overwritten by the acquired value.

Description

Query the applet parameter by parameter ID. The data is communicated using a data structure given by parameter 3. For querying field parameters use vaRt_GetParamArray(). For properties of type VA_STRING the returned string is stable at least until the parameter gets modified.

Return value

0: OK.

<0 : Error querying the parameter.

 

Function

int vaRt_GetParamArray (va_hap_handle handle, int paramID, va_data* values, size_t startIndex, size_t elementCount)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Parameter ID.

Parameter 3

Pointer to the data structure which will be used for communication. The associated data elements will be overwritten by the acquired values.

Parameter 4

Start index within the parameter field

Parameter 5

Number of elements which shall be queried

Description

Query field parameter of applet by parameter ID filling an array of data elements. The data is communicated via the data structure given by parameter 4.

Return value

0: OK.

<0 : Error querying the array.

 

Function

int vaRt_SetParam (va_hap_handle handle, int paramID, const va_data * value)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Parameter ID.

Parameter 3

Pointer to the data structure which will be used for submitting data to the Applet.

Description

Set applet parameter with the given name. Data is provided by a data structure (Parameter 4). For setting field parameters use vaRt_SetParamArray().

Return value

0: OK.

<0 : Error setting the parameter.

 

Function

int vaRt_SetParamArray (va_hap_handle handle, int paramID, const va_data * values, size_t startIndex, size_t elementCount)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Parameter ID.

Parameter 3

Pointer to the data structure which will be used for submitting values to the applet.

Parameter 4

Start index within parameter field.

Parameter 5

Number of elements which shall be set.

Description

Set field parameter of applet with the given name submitting an array of data elements. The data is provided via a data structure (Parameter 3).

Return value

0: OK.

<0 : Error setting the parameter field.

 

Function

int vaRt_SetGlobalEnable (va_hap_handle handle, int active)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

State to which the global enable shall be set (1 or 0).

Description

Set the global enable to 1 (active=1) or 0 (active=0).

Return value

0: OK

<0 : Error setting the global enable state.

 

Function

int vaRt_SetProcessEnable (va_hap_handle handle, unsigned int procNr, int active)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Process number or ((unsigned int)-1) for identifying all processes at once.

Parameter 3

State to which the enable shall be set (1 or 0).

Description

Set the enable of a process (or all processes) to 1 (active=1) or 0 (active=0).

Return value

0: OK.

<0 : Error setting the process enable state.

 

Function

int vaRt_ResetProcess (va_hap_handle handle, unsigned  int procNr)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter 2

Process number or ((unsigned int)-1) for identifying all processes at once.

Description

Reset the process with the given logical process number (or all processes). The according process reset signal(s) will be asserted and released again. The enable signal(s) of the corresponding process(es) is not touched. Use vaRt_SetProcessEnable() and this function for controlling the applet.

Return value

0: OK.

<0 : Cannot reset the process.

 

Function

const char* vaRt_GetErrorDescription (va_hap_handle handle, int errorCode)

Parameter 1

Hap handle from vaRt_OpenHap().

Parameter2

Code from vaRt_GetLastError().

Description

Query error message string for given error code.

Return value

Not NULL: Error description (0-terminated c-string)

NULL: No description available