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.

SRIO例程中SRIO_loopback_Test.c文件KeyStone_queuePush函数

大家好 问一下 SRIO例程中SRIO_loopback_Test.c文件下 172行程序

cycles= TSCL;
KeyStone_queuePush(QMSS_SRIO_QUEUE_BASE+uiPortNum,(Uint32)hostDescriptor|FETCH_SIZE_64);
_mfence(); //force all memory operation complete 强制所有内存操作完成
_mfence(); //force all memory operation complete 强制所有内存操作完成


KeyStone_queuePush这个函数主要实现什么功能?
看了下前后程序 在开发板运行了下 大概意思是要把数据从核0的LL2搬运到核1的LL2
核0的LL2地址是0x10802200
核1的LL2地址是0x11800200
现在不明白 KeyStone_queuePush这个函数是如何对应上核1 0x11800200这个地址的

KeyStone_queuePush函数跳转后的原型如下:
static inline void KeyStone_queuePush (Uint32 queueNum, Uint32 descAddr)
{
gpQueueManageVBUSM[queueNum].REG_D_Descriptor= descAddr;
}

queueNum=QMSS_SRIO_QUEUE_BASE+uiPortNum=672 这是消息队列的号码

  • 搜了下 有工程师说:下面的代码是发送函数, KeyStone_queuePush等效于发送
  • 结合SRIO手册2.3.3.2.1 TX Protocol-Specific Descriptor Information看看。
    hostDescriptor包含了描述符word0~7的控制信息:
    Words 0-7 of the descriptor hold the control information such as data buffer start address, and total
    message payload byte count. This information is sent to the TXU as sideband signals.
    FETCH_SIZE_64应该是指 Protocol-Specific Descriptor中的SSIZE。
  • Nancy Wang:

    您好 这个我看了!

    关键是KeyStone_queuePush(QMSS_SRIO_QUEUE_BASE+uiPortNum,(Uint32)hostDescriptor|FETCH_SIZE_64);等效于发送 是个发送函数

    是把数据从核0的LL2搬运到核1的LL2

    核0的LL2地址是0x10802200 因为消息队列的标号2057对应的地址就是0x10802200
    QMSS_SRIO_QUEUE_BASE+uiPortNum=672 672这个消息队列的标号不知如何对应上核1的LL2地址0x11800200的???
  • {CORE0_LL2_HOST_SIZE1_FDQ,  ((Uint32)&hostDescriptor_LL2[LL2_SIZE1_DESC_START_IDX][0])+0x10000000,  SRIO_DESCRIPTOR_SIZE, 

    CORE0_LL2_HOST_SIZE1_FDQ=2057 

    ((Uint32)&hostDescriptor_LL2[LL2_SIZE1_DESC_START_IDX][0])+0x10000000, =0x10824600

    0x10824600就是描述符的首地址 0x10802200这个地址就在描述符里