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 Doorbell info 发送失败

大家好,

我在C6670上面通过SRIO发送一个Doorbell包给FPGA(Xilinx V6)。

大致的代码如下:

Srio_DrvBuffer  DBLL_Info;

/* Open DIO SRIO Non-Blocking Socket */
srioSocket= Srio_sockOpen (hSrioDrv, Srio_SocketType_DIO, FALSE);
if (srioSocket== NULL)
{
      System_printf ("Error: Unable to open the DIO socket - %d\n", 0);
      return -1;
}
// DIO Binding Information: Use 16 bit identifiers
bindInfo.dio.doorbellValid  = 0;
bindInfo.dio.intrRequest    = 1;
bindInfo.dio.supInt         = 0;
bindInfo.dio.xambs          = 0;
bindInfo.dio.priority       = 0;
bindInfo.dio.outPortID      = 3;
bindInfo.dio.idSize         = 0;
bindInfo.dio.srcIDMap       = 0;
bindInfo.dio.hopCount       = 0;
bindInfo.dio.doorbellReg    = 0;
bindInfo.dio.doorbellBit    = 0;


/* Bind the SRIO socket: DIO sockets do not need any binding information. */ 
if (Srio_sockBind_DIO (srioSocket, &bindInfo) < 0)
{
    System_printf ("Error: Binding the SIO socket failed.\n");
    return -1;
}

//设置Doorbell Info的为Reg=1,Bit=3    
*DBLL_Info = (int32_t)SRIO_SET_DBELL_INFO(1,3);

/* Populate the DIO Address Information where the data is to be sent. */
to.dio.rapidIOMSB    = 0x0;
to.dio.rapidIOLSB    = (uint32_t)READ_BASE_ADDR;	
to.dio.dstID         = 0xAA;		//FPGA;
to.dio.ttype         = dio_ttype;
to.dio.ftype         = dio_ftype;//为0xA

//发送一次Doorbell包
if (Srio_sockSend_DIO (srioSocket,DBLL_Info, 1, (Srio_SockAddrInfo*)&to) < 0)
{
   System_printf ("Debug(Core %d): DIO Socket Example Failed\n", coreNum);
   return -1;
}

按照我的理解,

if (Srio_sockSend_DIO (srioSocket,DBLL_Info, 1, (Srio_SockAddrInfo*)&to) < 0)

这句代码实现的是DSP对外发送一个Doorbell包,我在这里设置断点,每执行一次,可以在FPGA端通过Chipscope抓取到包。
观察包的内容的确是Doorbell类型的,TargetID、SourceID都正确。
但是问题是:

FPGA抓取的来自DSP的Doorbell包的DoorbellInfo始终为0x0000。虽然我在DSP程序中设置DoorbellInfo为Reg=1,Bit=3发送的。

而且我通过Memory Browser观察0x02900D14即LSU0的Reg5,也是DoorbellInfo为0x0000.

感觉就是DoorbellInfo没有设置到LSU里面。

请问这个问题应该如何解决?
谢谢了~~

  • 是不是下面这句有问题?

    *DBLL_Info = (int32_t)SRIO_SET_DBELL_INFO(1,3);

    DBLL_Info 的类型是(void *)哦?

    参考一下下面的例子:

    static void sendMgmtPingReply(void)
    {
        Srio_SockAddrInfo       to;
        uint32_t                doorbellInfo;

    #ifdef DEBUG_CONTROL_MESSAGES_RX
        /* Debug Message: */
        System_printf ("Debug: Mgmt Ping Reply to Device Id:0x%x Doorbell Reg 0x%x Doorbell Bit 0x%x\n",
                        srio_device_ID2, PRODUCER_DOORBELL_REG, PRODUCER_DOORBELL_BIT);
    #endif

        /* Program the destination information: */
        to.dio.rapidIOMSB    = 0x0;
        to.dio.rapidIOLSB    = 0x0;
        to.dio.dstID         = srio_device_ID2;
        to.dio.ttype         = 0;
        to.dio.ftype         = Srio_Ftype_DOORBELL;

        /* Use the SRIO Driver Macro to program the doorbell information */
        doorbellInfo = SRIO_SET_DBELL_INFO(PRODUCER_DOORBELL_REG, PRODUCER_DOORBELL_BIT);

        /* Send the Doorbell. */
        if (Srio_sockSend (mgmtSocket, (Srio_DrvBuffer)doorbellInfo, 0, &to) < 0)
        {
            System_printf ("Error: Unable to send doorbell to the producer.\n");
            return;
        }
        return;
    }

  • 非常非常感谢!确实是那个地方出错了!现在已经改好了。

x 出现错误。请重试或与管理员联系。