Skip to content

synxexample

Overview

The synx example illustrates the usage of the following synx APIs described here:

  • synx_initialize
  • synx_create
  • synx_import
  • synx_wait
  • synx_signal
  • synx_uninitialize

Refer to the Feature Matrix for example support and to know the DSP architecture on the target.

Project structure

  • inc/synxexample.idl

IDL interface that defines the synxexample API.

This IDL file is compiled by the QAIC IDL compiler into the following files:

synxexample.h: C/C++ header file

synxexample_stub.c: Stub source that needs to be built for the HLOS (LA/LE)

synxexample_skel.c: Skel source that needs to be built for the Hexagon DSP

  • src/ : Source files for the HLOS executable and Hexagon-side implementation of the synxexample

    synxexample_apps.c : Demonstrates the synx APIs on HLOS side and invokes call to DSP functions that demonstrate the synx APIs on DSP.

    synxexample_imp.c : Demonstrates synx APIs on DSP.

Call flow of synxexample

The following diagram depicts the call flow of synx example

jpg

Definition of the terms in the diagram:

Term Description
synx_session1 Synx session created on CPU
setup This function creates the synx session on DSP
synx_session2 Synx session created on DSP
h_synx1, h_synx3 Synx objects created on CPU
workerthreadfunction Thread created at CPU where the h_synx1 object is signaled
dsp_callfn Thread created at CPU to call the dspalgorithm1 function
h_imp_synx1, h_imp_synx3 Synx objects imported on DSP that are mapped to h_synx1 and h_synx3 respectively
dspalgorithm1 The DSP implementation of this function calls the synx_wait on h_imp_synx1 object
dspalgorithm2 This function signals the h_imp_synx3 object that is waiting on CPU
Uninitialize This function deintializes the synx_session2 on DSP

Using the walkthrough script

The walkthrough script synxexample_walkthrough.py automates the steps of signing the device, building, pushing and running the synxexample. You can run the walkthrough script with the dry-run (-DR) option to display all the commands that the script would execute without actually running them.

Review the generic setup and walkthrough_scripts instructions to learn more about setting up your device and using the walkthrough script.