大家好,
我在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里面。
请问这个问题应该如何解决?
谢谢了~~
Feng Jin:
回复 Brighton Feng:
非常非常感谢!确实是那个地方出错了!现在已经改好了。