This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[TDA4M] What function does trigger a pipelined graph?

Hi,

I know It automatically triggers the graph.

If the user set to VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO, The implementation automatically triggers graph execution when it has enough enqueued references to start a graph execution.

(https://www.khronos.org/registry/OpenVX/extensions/vx_khr_pipelining/1.0.1/vx_khr_pipelining_1_0_1.html#sec_graph_schedule_config)

But, When I set a breakpoint in a kernel process and vxGraphParameterDequeueDoneRef,  trigger(It means breakpoint, not trigger a graph) in a kernel process occurs after vxGraphParameterDequeueDoneRef.

It looks like It triggers the graph in vxGraphParameterDequeueDoneRef not automatically.

What function does trigger a pipelined graph?

Best regards

Yongsig

  • Hello Yongsig,

    As you noted, the internal framework implementation triggers the execution of a given node of the graph once data references are available at all parameters of the node.  Therefore, it is an internal framework function that ultimately checks for this and calls the node process callback to execute the node.

    Regarding your observation with setting breakpoints, where exactly are you setting breakpoints and on what cores are you setting breakpoints?

    For more information on how TI performs graph pipelining, feel free to reference the user guide below

    software-dl.ti.com/.../TIOVX_USAGE_REC.html

    Regards,

    Lucas

  • Thanks Lucas.

    I'm setting three breakpoints.

    First, vxGraphParameterEnqueueReadyRef().  This function is called on pipe-up stage.

    Second, vxGraphParameterDequeueDoneRef().

    Finally, in tivxUserKernelProcess() on A72.

    I thought the graph had to stop on the 3rd breakpoint after vxGraphParameterEnqueueReadyRef().

    But the graph stopped on  the 3rd breakpoint(tivxUserKernelProcess) after vxGraphParameterDequeueDoneRef().

    It looks like the graph triggers in vxGraphParameterDequeueDoneRef() in spite of VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO.

    Best regards

    Yongsig.

  • Hello Yongsig,

    Could you also provide the graph structure for your application?  For instance, is this a single node graph with the A72 node as the only node?  Or are there other nodes in the graph?  Also, which node and node parameter are you dequeueing?

    Regards,

    Lucas

  • OK.

    The graph structure(pseudo code) is as below.

    vx_image node_1_input, node_1_output, node_2_output, node_3_output
    
    node_1 = tivxProcess1Node(graph, node_1_input, node_1_output);
    vxSetNodeTarget(node_1, VX_TARGET_STRING, TIVX_TARGET_A72_0);
    // An input is node_1_output in node_2. node_2 = tivxProcess2Node(graph, node_1_output, node_2_output); vxSetNodeTarget(node_2, VX_TARGET_STRING, TIVX_TARGET_DSP1);
    // An input is node_2_output in node_3. node_3 = tivxProcess3Node(graph, node_2_output, node_3_output); vxSetNodeTarget(node_3, VX_TARGET_STRING, TIVX_TARGET_A72_0); add_graph_parameter_by_node_index(graph, node_1, 0); graph_parameters_queue_params_list.graph_parameter_index = 0; graph_parameters_queue_params_list.refs_list_size = 4; graph_parameters_queue_params_list.refs_list = (vx_reference*)&node_1_input; status = vxSetGraphScheduleConfig(graph, VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO, graph_parameter_index, graph_parameters_queue_params_list); status = tivxSetGraphPipelineDepth(graph, 4); status = tivxSetNodeParameterNumBufByIndex(node_2, 1u, 4); // 1u maens output index in the node. status = tivxSetNodeParameterNumBufByIndex(node_3, 1u, 4); // 1u maens output index in the node.

    status = vxVerifyGraph(graph);
    for (uint32_t i = 0; i < 4; i++) { status = vxGraphParameterEnqueueReadyRef(graph, 0, (vx_reference*)&node_1_input, 1); } while (stop){ vx_image dequeue_image; status = vxGraphParameterDequeueDoneRef(graph_, 0, (vx_reference*)&dequeue_image, 1, &num_refs); make_new_image(dequeue_image); status = vxGraphParameterEnqueueReadyRef(graph, 0, (vx_reference*)&dequeue_image, 1); }

    As you know, setting three breakpoints.

    1st. vxGraphParameterEnqueueReadyRef(),

    2nd. vxGraphParameterDequeueDoneRef(),

    3rd. node_1_process()

    This graph is working well in the pipeline mode. It seems like there is no problem with setting up the pipeline.

    The only thing that I wonder about is the breakpoints order. 

    In what order do you think the graph stop?

    I thought it should be in the 1st, 3rd, 2nd order.

    Best regards

    Yongsig.

  • Hello Yongsig,

    I think what is happening has to do with the thread priorities of the application and the node.  Since these are running on different threads, the application has not yielded to the node thread before it hits the vxGraphParameterDequeueDoneRef.  Inside the vxGraphParameterDequeueDoneRef, it then has a chance to yield to the node thread since it pends for the buffer to be available.

    I think if you put a breakpoint inside the vxGraphParameterDequeueDoneRef function at the below line and just after that line along with inside the node process callback, you will see that it hits the below line first, then yields to the node callback then continues running after the below line once the node has completed.

    status = tivxDataRefQueueWaitDoneRef(data_ref_q,
    graph->timeout_val);

    Regards,

    Lucas