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