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.

Linux/TDA2: how to get DSP algorithm use time

Part Number: TDA2


Tool/software: Linux

how  to  getting the actual time consuming of the DSP algorithm? 

i   have   use  WH_time[0] = _itoll(TSCH, TSCL);    to get  the circles    of  fuctions   ,but   i  donot  know   how  to get  the  actual time!

BESTWISHES

shuai

  • follow is the log , i use _itoll(TSCH, TSCL) and get the time is about 104ms , but i sub 80.123833 s: AHD_Detect_times2 = 104.159703 ms - [HOST] [DSP1 ] 79.984444 s: AHD_Detect_times2 = 104.099196 ms is about 140 ms, so is there anyway to get the fuction actual time not circles.

    [HOST] [DSP1 ] 79.845604 s: g_sImage.pi32Pitch[0]: DMA: width CH (TCC) = 768 (768)
    [HOST] [DSP1 ] 79.845635 s: wordWidth42: DMA: height42 CH (TCC) = 107 (107)
    [HOST] [DSP1 ] 79.846489 s: Af▒
    [HOST] [DSP1 ] 79.984444 s: AHD_Detect_times2 = 104.099196 ms
    [HOST] [DSP1 ] 79.984505 s: i32SignNumber: DMA: height5 CH (TCC) = 1 (576)
    [HOST] [DSP1 ] 79.984536 s: 2 593 714 335 520
    [HOST] [DSP1 ] 79.984810 s: inPitch[0]: DMA: outPitch[0] CH (TCC) = 768 (4096)
    [HOST] [DSP1 ] 79.984841 s: wordWidth2: DMA: height2 CH (TCC) = 768 (576)
    [HOST] [DSP1 ] 79.984871 s: g_sImage.pi32Pitch[0]: DMA: width CH (TCC) = 768 (768)
    [HOST] [DSP1 ] 79.984902 s: wordWidth42: DMA: height42 CH (TCC) = 107 (107)
    [HOST] [DSP1 ] 79.985756 s: Af▒
    [HOST] [DSP1 ] 80.123833 s: AHD_Detect_times2 = 104.159703 ms
    [HOST] [DSP1 ] 80.123863 s: i32SignNumber: DMA: height5 CH (TCC) = 1 (576)
    [HOST] [DSP1 ] 80.123924 s: 2 593 714 335 520
    [HOST] [DSP1 ] 80.124229 s: inPitch[0]: DMA: outPitch[0] CH (TCC) = 768 (4096)
    [HOST] [DSP1 ] 80.124260 s: wordWidth2: DMA: height2 CH (TCC) = 768 (576)
    [HOST] [DSP1 ] 80.124290 s: g_sImage.pi32Pitch[0]: DMA: width CH (TCC) = 768 (768)
    [HOST] [DSP1 ] 80.124290 s: wordWidth42: DMA: height42 CH (TCC) = 107 (107)
    [HOST] [DSP1 ] 80.125175 s: Af▒
    [HOST] [DSP1 ] 80.263039 s: AHD_Detect_times2 = 104.039445 ms
    [HOST] [DSP1 ] 80.263100 s: i32SignNumber: DMA: height5 CH (TCC) = 1 (576)
    [HOST] [DSP1 ] 80.263130 s: 2 593 714 335 520
    [HOST] [DSP1 ] 80.263405 s: inPitch[0]: DMA: outPitch[0] CH (TCC) = 768 (4096)
    [HOST] [DSP1 ] 80.263435 s: wordWidth2: DMA: height2 CH (TCC) = 768 (576)
    [HOST] [DSP1 ] 80.263435 s: g_sImage.pi32Pitch[0]: DMA: width CH (TCC) = 768 (768)
    [HOST] [DSP1 ] 80.263466 s: wordWidth42: DMA: height42 CH (TCC) = 107 (107)
    [HOST] [DSP1 ] 80.264350 s: Af▒
    [HOST] [DSP1 ] 80.402488 s: AHD_Detect_times2 = 104.230851 ms
    [HOST] [DSP1 ] 80.402519 s: i32SignNumber: DMA: height5 CH (TCC) = 1 (576)
    [HOST] [DSP1 ] 80.402549 s: 2 593 714 335 520
    [HOST] [DSP1 ] 80.402854 s: inPitch[0]: DMA: outPitch[0] CH (TCC) = 768 (4096)
    [HOST] [DSP1 ] 80.402915 s: wordWidth2: DMA: height2 CH (TCC) = 768 (576)
    [HOST] [DSP1 ] 80.402946 s: g_sImage.pi32Pitch[0]: DMA: width CH (TCC) = 768 (768)
    [HOST] [DSP1 ] 80.402976 s: wordWidth42: DMA: height42 CH (TCC) = 107 (107)
    [HOST] [DSP1 ] 80.403800 s: Af▒
    [HOST] [DSP1 ] 80.541725 s: AHD_Detect_times2 = 104.039919 ms
  • Using TSCH/TSCL we can get the DSP cycles across a function. But to get the time you will have to divide by CPU frequency

    t0 = _itoll(TSCH, TSCL);

    funcABC();

    t1 = _itoll(TSCH, TSCL);

    cycles = t1 - t0;

    time  = (cycles / CPU_frequency) * 1000

    Eg. lets cycles = 20,000,000 and CPU freq = 600,000,000 

    So time - (20,000,000 / 600,000,000) * 1000 = 33ms

    Regards,
    Shyam

  • Hi Shyam
    question1
    from this boot inf my cpu Frequency is 750000000 Hz??
    [HOST] [HOST ] 30.213292 s: SYNC_2 : Init done - linkid-0x0
    [HOST] [HOST ] 30.213444 s: SYNC_3 : Init done - linkid-0x0
    [HOST] [HOST ] 30.216403 s: MERGE_0 : Init done - linkid-0x0
    [HOST] [HOST ] 30.216555 s: MERGE_1 : Init done - linkid-0x0
    [HOST] [HOST ] 30.216708 s: MERGE_2 : Init done - linkid-0x0
    [HOST] [HOST ] 30.216860 s: MERGE_3 : Init done - linkid-0x0
    [HOST] [HOST ] 30.219849 s: MERGE_4 : Init done - linkid-0x0
    [HOST] [HOST ] 30.220002 s: SELECT_0 : Init done - linkid-0x0
    [HOST] [HOST ] 30.220124 s: SELECT_1 : Init done - linkid-0x0
    [HOST] [HOST ] 30.220215 s: GATE_0 : Init done - linkid-0x0
    [HOST] [HOST ] 30.220276 s: GATE_1 : Init done - linkid-0x0
    [HOST] [HOST ] 30.220368 s: GATE_2 : Init done - linkid-0x0
    [HOST] [HOST ] 30.220490 s: GATE_3 : Init done - linkid-0x0
    [HOST] [HOST ] 30.220581 s: SGXFRMCPY_0 : Init done - linkid-0x2000040
    [HOST] [HOST ] 30.220612 s: SYSTEM: Initializing A15 Links ... DONE !!!
    [HOST] [HOST ] 30.220978 s: OSA: Adjusting global time, timeH by 0 units!!!
    [HOST] [HOST ] 30.221008 s: SYSTEM: System A15 Init Done !!!
    [HOST] [DSP1 ] 16.392423 s: ***** DSP1 Firmware build time 17:35:58 Jul 26 2018
    [HOST] [DSP1 ] 16.392484 s: *** SYSTEM: CPU Frequency <ORG = 600000000 Hz>, <NEW = 750000000 Hz>
    [HOST] [DSP1 ] 16.392728 s: SYSTEM: System Common Init in progress !!!
    [HOST] [DSP1 ] 16.392911 s: SYSTEM: IPC init in progress !!!
    [HOST] [DSP1 ] 16.392942 s: SYSTEM: Attaching to [IPU2] ...
    [HOST] [DSP1 ] 16.675959 s: SYSTEM: Attaching to [IPU2] ... SUCCESS !!!
    [HOST] [DSP1 ] 16.725645 s: SYSTEM: Attaching to [DSP2] ... SUCCESS !!!
    [HOST] [DSP1 ] 16.750106 s: SYSTEM: Attaching to [EVE1] ... SUCCESS !!!
    [HOST] [DSP1 ] 16.770054 s: SYSTEM: Attaching to [EVE2] ... SUCCESS !!!
    [HOST] [DSP1 ] 16.790154 s: SYSTEM: Attaching to [EVE3] ... SUCCESS !!!
    [HOST] [DSP1 ] 16.810101 s: SYSTEM: Attaching to [EVE4] ... SUCCESS !!!
    [HOST] [DSP1 ] 16.810162 s: SYSTEM: Notify register to [IPU2] line 0,

    question2
    from follow inf i sub 80.123833 s-79.984444 s=140ms
    ([HOST] [DSP1 ] 79.984444 s: AHD_Detect_times2 = 104.099196 ms [HOST] [DSP1 ] 80.123833 s: AHD_Detect_times2 = 104.159703 ms )
    so i think AHD_Detect_times2 is small than 140ms??
    right ?
    HOST] [DSP1 ] 79.845604 s: g_sImage.pi32Pitch[0]: DMA: width CH (TCC) = 768 (768)
    [HOST] [DSP1 ] 79.845635 s: wordWidth42: DMA: height42 CH (TCC) = 107 (107)
    [HOST] [DSP1 ] 79.846489 s: Af▒
    [HOST] [DSP1 ] 79.984444 s: AHD_Detect_times2 = 104.099196 ms
    [HOST] [DSP1 ] 79.984505 s: i32SignNumber: DMA: height5 CH (TCC) = 1 (576)
    [HOST] [DSP1 ] 79.984536 s: 2 593 714 335 520
    [HOST] [DSP1 ] 79.984810 s: inPitch[0]: DMA: outPitch[0] CH (TCC) = 768 (4096)
    [HOST] [DSP1 ] 79.984841 s: wordWidth2: DMA: height2 CH (TCC) = 768 (576)
    [HOST] [DSP1 ] 79.984871 s: g_sImage.pi32Pitch[0]: DMA: width CH (TCC) = 768 (768)
    [HOST] [DSP1 ] 79.984902 s: wordWidth42: DMA: height42 CH (TCC) = 107 (107)
    [HOST] [DSP1 ] 79.985756 s: Af▒
    [HOST] [DSP1 ] 80.123833 s: AHD_Detect_times2 = 104.159703 ms
    BESTWISHES
    SHUAI
  • Hi Shuai,

    1. Yes
    2. Yes

    Regards,
    Shyam