TI中文支持网
TI专业的中文技术问题搜集分享网站

IPC 模块中MessageQ核间通讯耗时

      我用6678两个核通讯,用到了IPC里的MessageQ模块,结合共享内存。0核向1核传递消息,用Timestamp_get32()函数统计耗时,1核MessageQ_get的耗时是0.00035ms,1核在接收到消息后,对消息中的某个标志位做了修改,然后又传回0核,0核MessageQ_get的耗时很长,而且不稳定,为100多ms,有时候还有负值。

      两核之间消息传递机制都一样,不知道为什么耗时耗时差别这么大?如何解决1核向0核传消息时, MessageQ_get耗时大的问题。

Allen35065:

有没有别的任务在运行?

YANYAN LEI:

回复 Allen35065:

你好:
        没有别的任务运行。
        我是仿照mcsdk里的image_processing例程(多核边缘检测),我只用了两个核,每个核有一个任务函数,而且我又测了另一个序列,1核MessageQ_get的耗时是1000多ms,0核MessageQ_get的的时间为125多ms
       Timestamp_get32()这个函数返回值为32位的,如果返回负数是溢出了吗?image_processing例程里的输出也有负数,是什么原因。
      
      

littleWhite:

回复 YANYAN LEI:

timeStamp好像对应的是两个寄存器共64bit,例程是不是只用了32bit的low register  TSCL

YANYAN LEI:

回复 littleWhite:

例程里只用了Timestamp_get32() ,Timestamp_get32()返回的是Int32类型,

下面是Timestamp_get64() 的用法,不太理解result输出的是什么

Timestamp_get64() // module-wide

index URL

Return a 64-bit timestamp

C synopsis
target-domain

Void Timestamp_get64(Types_Timestamp64 *result);

ARGUMENTS
result— pointer to 64-bit result
This parameter is a pointer to a structure representing a 64-bit wide timestamp value where the current timestamp is written.
If the underlying hardware does not support 64-bit resolution, the hi field of result is always set to 0; see xdc.runtime.Types.Timestamp64. So, it is possible for the lo field to wrap around without any change to the hi field. Use getFreq to convert this value into units of real time.

littleWhite:

回复 YANYAN LEI:

result输出是一个指针,指向一个64bit的数据,这个数据存储的是一个从硬件计数器读取的值,大小0~2^64

得到的值是对dsp时钟的计数,例如在时间点1得到一个值a,在时间点b得到值b,那么(b-a)/clk 就是两个时间点之间的时间差

赞(0)
未经允许不得转载:TI中文支持网 » IPC 模块中MessageQ核间通讯耗时
分享到: 更多 (0)