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.

[参考译文] SK-TDA4VM:在 C7x 的主机仿真中进行分析

Guru**** 2457760 points
Other Parts Discussed in Thread: TDA4VM, MATHLIB

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1482521/sk-tda4vm-profiling-in-host-emulation-for-c7x

器件型号:SK-TDA4VM
主题中讨论的其他器件:TDA4VMMATHLIB

工具与软件:

你(们)好  

我们是否有任何可以用于计算在 C7x 主机仿真模式下运行的应用所用周期的分析工具?

SDK: ti-processor-sdk-rtos-j721e-evm-09_00_01_01

电路板:TDA4VM

我开发了一个执行向量操作并在 C7x 主机仿真模式下运行的测试应用程序,在该模式下,我需要使用任何可用的性能分析 API 测量整体执行所用的周期。 我提到了一个 mathlib 测试应用、其中我们使用此 TI_profile_start ()和 TI_profile_stop ()来获取内核计算周期、但我注意到我们在测试报告中没有得到任何有效的计算周期。

谢谢!

Madhu

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Madhu:

    MathLib 周期计数器(TI_profile_start ()和 TI_profile_stop ())取决于 C7x TSC、该 TSC 在主机仿真模式下不受支持、因此它返回零或无效值。要进行准确的分析、请在实际的 C7x DSP 上运行。

    在主机仿真中、您可以使用任何时间计数器来估算时间 、但这并不会反映实际的 C7x 性能。
    下面是 gettimeofday ()的示例代码。

    #include <stdio.h>
    #include <sys/time.h>
    
    #define CPU_FREQ 2e9
    
    int main() {
        struct timeval start, stop;
        gettimeofday(&start, NULL);
    
        for (int i = 1; i <= 10000; i++)
            printf("%d\n", i);
    
        gettimeofday(&stop, NULL);
    
        double elapsed_time = (stop.tv_sec - start.tv_sec) + (stop.tv_usec - start.tv_usec) / 1e6;
        double estimated_cycles = elapsed_time * CPU_FREQ;
    
        printf("Execution time: %f seconds\n", elapsed_time);
        printf("Estimated cycle count: %.0f cycles\n", estimated_cycles);
    
        return 0;
    }
    

    此致、
    Sivadeep