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.

6678 gettime

static void measure_sobel()
{
    Int              status;
    MessageQ_Msg     msg;

  if (selfId == 0) {
        msg = MessageQ_alloc(HEAP_ID, MESSAGE_SIZE_IN_BYTES);
        if (msg == NULL) {
           System_abort("MessageQ_alloc failed\n");
        }

        rawtimestamps0 = Timestamp_get32();
         /* Kick off the loop */
        rawtimestamps[0] = Timestamp_get32();
        status = MessageQ_put(nextQueueId, msg);
        rawtimestamps2 = Timestamp_get32();
        IMG_sobel_3x3_8((uint8_t *)0x90000000,(uint8_t *)0x91000000,1920,1080/8);
        rawtimestamps3 = Timestamp_get32();
        status = MessageQ_get(messageQ, &msg, MessageQ_FOREVER);
        rawtimestamps1 = Timestamp_get32();
        System_printf("Whole complete cost %d\n",rawtimestamps1-rawtimestamps0);
        System_printf("core0 complete cost %d\n",rawtimestamps3-rawtimestamps2);
    }
  else if(1<=selfId<=6)
  {
      status = MessageQ_get(messageQ, &msg, MessageQ_FOREVER);
      status = MessageQ_put(nextQueueId, msg);

      rawtimestamps4 = Timestamp_get32();
      IMG_sobel_3x3_8((uint8_t *)(0x90000000+(1920*1080/8)*selfId),(uint8_t *)(0x91000000+(1920*1080/8)*selfId),1920,1080/8);
      rawtimestamps5 = Timestamp_get32();
      System_printf("core%d complete cost %d\n",selfId,rawtimestamps5-rawtimestamps4);
    }
  else
  {
   status = MessageQ_get(messageQ, &msg, MessageQ_FOREVER);
   rawtimestamps2 = Timestamp_get32();
   IMG_sobel_3x3_8((uint8_t *)(0x90000000+(1920*1080/8)*selfId),(uint8_t *)(0x91000000+(1920*1080/8)*selfId),1920,1080/8);
   rawtimestamps3 = Timestamp_get32();
   status = MessageQ_put(nextQueueId, msg);
   System_printf("core%d complete cost %d\n",selfId,rawtimestamps3-rawtimestamps2);
  }
}

question:

measure_sobel() function exec in while loop;eight cores share the same project

1.Whole complete cost 94ms;but after the first exec,every other time in while loop just cost  2ms
2.every core do sobel  processing one section ,so the process time with every core,it will be same or just a little different。but the time with every core print in the console is different some time。

3.i think that can i get time in every core,if can not do that,so the printed time is wrong.


another:

if i use other multi-core communication method like below code

every whole time cost in while loop is just the same。

but like above,if i add getting time in every core,the time with every core is not correct。

thanks

best regards。

void convert_func(){
Int       status;
int i;
MessageQ_Msg     msg[7];


if (selfId == 0) {

    for(i=0;i<7;i++){
 msg[i]= MessageQ_alloc(HEAP_ID, MESSAGE_SIZE_IN_BYTES);
    if (msg== NULL) {
       System_abort("MessageQ_alloc failed\n");
    }
    }

    timeStamp1 = Timestamp_get32();//getStartTime64();
    status = MessageQ_put(nextQueueId1, msg[0]);
    if (status < 0) {
        System_abort("MessageQ_put failed\n");
    }
    status = MessageQ_put(nextQueueId2, msg[1]);
    if (status < 0) {
        System_abort("MessageQ_put failed\n");
    }
    status = MessageQ_put(nextQueueId3, msg[2]);
    if (status < 0) {
        System_abort("MessageQ_put failed\n");
    }
    status = MessageQ_put(nextQueueId4, msg[3]);
    if (status < 0) {
        System_abort("MessageQ_put failed\n");
    }
    status = MessageQ_put(nextQueueId5, msg[4]);
    if (status < 0) {
        System_abort("MessageQ_put failed\n");
    }
    status = MessageQ_put(nextQueueId6, msg[5]);
    if (status < 0) {
        System_abort("MessageQ_put failed\n");
    }    status = MessageQ_put(nextQueueId7, msg[6]);
    if (status < 0) {
        System_abort("MessageQ_put failed\n");
    }
    System_printf("core 0 MessageQ_put done\n");

 System_printf("convert start\n");


    timeStamp3 = Timestamp_get32();//getStartTime64();
    IMG_sobel_3x3_8((uint8_t *)0x90000000,(uint8_t *)0x91000000,1920,1080/8);
    timeStamp4 = Timestamp_get32();
    for(i=0;i<7;i++){
    status = MessageQ_get(messageQ, &msg[i], MessageQ_FOREVER);
    if (status < 0) {
        System_abort("MessageQ_get failed\n");
    }
    }

   timeStamp2 =Timestamp_get32();
   System_printf("Whole covert time is %d\n",timeStamp2-timeStamp1);
   System_printf("core0 covert time is %d\n",timeStamp4-timeStamp3);
}

else{
    status = MessageQ_get(messageQ, &msg[selfId-1], MessageQ_FOREVER);
    if (status < 0) {
        System_abort("MessageQ_get failed\n");
    }
    timeStamp3 = Timestamp_get32();
    IMG_sobel_3x3_8((uint8_t *)(0x90000000+(1920*1080/8)*selfId),(uint8_t *)(0x91000000+(1920*1080/8)*selfId),1920,1080/8);
    timeStamp4 = Timestamp_get32();
 status = MessageQ_put(nextQueueId, msg[selfId-1]);
 if (status < 0) {
 System_abort("MessageQ_put failed\n");
 }
 System_printf("core%d covert time is %d\n",selfId,timeStamp4-timeStamp3);
}
}

  • Cherish,

    Refer the ipc based demo file for Timestamp_get32() at the below path in MCSDK.
    mcsdk_2_01_02_06\demos\image_processing\ipc\master\src\mcip_process.c
    The time stamp discussion done in the following E2E post, this will be useful.
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/307508.aspx
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/157013/570607.aspx#570607
    You can use the TSC (time stamp counter) instead.
    http://processors.wiki.ti.com/index.php/Porting_GPP_code_to_DSP_and_Codec_Engine#Benchmark_Code_on_DSP_using_the_Time_Stamp_Counter_.28TSC.29

  • it can not solve my question.

    i do not why it comes this phenomenon

  • Cherish,

    Please explain little more about your issue, if not understand. I thought your issue with how to use the timer API call.

    If you provide your question clearly, I will try to give the technical solution for that.

  • Cherish,

    You have created new thread and addressed your issue on this E2E post.

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/343791/1201848.aspx#1201848

    You can close this thread, so that future readers may get useful.