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 set error

Expert 2985 points


Hi all,


In my project, I want to use the DSP C6670 to send a doorbell packet to FPGA(Xilinx V6).

The code I wrote is below,

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;
}

//Set Doorbell Info Reg=1 and 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

//send one Doorbell packet
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;
}

In my opinion, the func below

if (Srio_sockSend_DIO (srioSocket,DBLL_Info, 1, (Srio_SockAddrInfo*)&to) < 0)
can send one doorbell packet. I can capture the packet from DSP using Chipscope in FPGA.
The packet's Ftype is 0xA and the TargetID and the SourceID are correct.
 It means that the FPGA can receive a doorbell packet from DSP.

But my problem is that in the doorbell packet the Doorbell Info field is always 0x0000 although I had set the Reg=1 and Bit=3 in DSP.
Also, I see the LSU0_reg5's Doorbell Info is always 0x0000.
So I think the Doorbell Info is not set into the LSU correcttly.

But Why? And how to resolve this problem?
Can anyone help me?
Thanks for any replies!

Feng

  • Feng,

    I think the doorbell info is actually a separate field that is just data that the FPGA can use to determine what to do with the doorbell.

    To trigger a doorbell, you must change the binding information on the sriosocket.  In truth, I am not sure the doorbell info field will get updated if the socket is not set up to be a doorbell.  You can also set the doorbell info when you rebind the socket, if that is easier.  Here is what I change when I need a doorbell message instead of normal DIO.

    	bindInfo.dio.doorbellValid    = 1;  //Doorbell0_ICR[0]
    	bindInfo.dio.doorbellReg    = 0;  //Doorbell0_ICR[0]
    	bindInfo.dio.doorbellBit    = bufLoc;  //Doorbell0_ICRR[3:0]

    Hope this helps.

  • Hi BrandyJ,

    I think your reply is about that the auto send of doorbell behind the last packet of one transfer.

    But I want to send a doorbell solely.

    ************************************************************

    My fault in my codes which cause the Doorbell wrong is that

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

    when I change this code to

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

    it works!

    It is a  really stupid fault!

    ************************************************************

    Anyway, thanks for your reply!

    Feng

  • Awesome!  Better an easy problem to solve than a mystery!