现在在用C6678与FPGA进行通信,DSP端使用的程序是论坛的KeyStone_SRIO程序。
有两个问题:
1.DSP与FPGA通信选择的模式问题,我选择的是SRIO_NO_LOOPBACK模式;
根据手册path配置为configuration4、mode4 ,具体为4xLaneABCD。
2.程序中,在DSP_2DSP()函数中有这么一句注释:On dual Nyquist EVM only lane 2 and 3 are connected between 2 DSPs,即在两个DSP之间只有通道2和通道3连接。
可是我在FPGA端将SRIO设置为4x模式,因此我将程序更改为:
void SRIO_2DSP_Test()
{
int j;
SRIO_Transfer_Param * transferParam;
SRIO_LSU_Transfer lsuTransfer;
Int32 uiCompletionCode;
Uint32 cycles;
Uint32 uiFreeQueueEntryCount;
Uint32 * uipSrc, * uipDst, uiByteCount, uiDestID;
SRIO_Packet_Type packet_type;
HostPacketDescriptor * hostDescriptor;
serdesLinkSetup.linkSpeed_GHz= SRIO_DEFAULT_TEST_SPEED;
srio_cfg.srio_1x2x4x_path_control= test_2DSP_cfg.multiple_port_path;
srio_identify_used_ports_lanes(srio_cfg.srio_1x2x4x_path_control);
/*On dual Nyquist EVM only lane 2 and 3 are connected between 2 DSPs*/
//**************************修改***************************************//
srio_cfg.blockEn.bLogic_Port_EN[0]= TRUE;
srio_cfg.blockEn.bLogic_Port_EN[1]= TRUE;
srio_cfg.blockEn.bLogic_Port_EN[2]= TRUE;
srio_cfg.blockEn.bLogic_Port_EN[3]= TRUE;
KeyStone_SRIO_Init(&srio_cfg);
SRIO_PktDM_init();
//**************************修改***************************************//
//**********************************************************************//
if(srio_cfg.blockEn.bLogic_Port_EN[0])
KeyStone_SRIO_match_ACK_ID(2, DSP1_SRIO_BASE_ID, 0);
if(srio_cfg.blockEn.bLogic_Port_EN[1])
KeyStone_SRIO_match_ACK_ID(2, DSP1_SRIO_BASE_ID, 1);
if(srio_cfg.blockEn.bLogic_Port_EN[2])
KeyStone_SRIO_match_ACK_ID(2, DSP1_SRIO_BASE_ID, 2);
if(srio_cfg.blockEn.bLogic_Port_EN[3])
KeyStone_SRIO_match_ACK_ID(3, DSP1_SRIO_BASE_ID, 3);
//**************************修改***************************************//
// for(j= 2; j< 4; j++)
for(j= 0; j< 4; j++)
{
transferParam= &test_2DSP_cfg.transfer_param[j];
uiByteCount= transferParam->byteCount;
if(0==uiByteCount)
continue;
packet_type= transferParam->packet_type;
if(packet_type<0x90) //directIO
{
uipSrc = (Uint32 *)transferParam->source;
uipDst= (Uint32 *)transferParam->dest;
/*initialize buffer*/
InitDataBuffer(uipSrc, uipDst, uiByteCount);
InitLsuTransfer(&lsuTransfer, transferParam, j, DSP1_SRIO_BASE_ID, j);
/*setup a doorbell after each DirectIO operation
to notify the other side of SRIO*/
InitLsuDoorbell(&lsuTransfer, transferParam);
KeyStone_SRIO_LSU_transfer(&lsuTransfer);
uiCompletionCode= KeyStone_SRIO_wait_LSU_completion(j,
lsuTransfer.transactionID, lsuTransfer.contextBit);
printf("%s from 0x%8x to 0x%8x, %6d bytes, completion code = %d\n",
get_packet_type_string(transferParam->packet_type),
uipSrc, uipDst, uiByteCount,
uiCompletionCode);
// printf("%6d bytes\n",uiByteCount);
}
请问:我这种理解和修改有问题吗?
Andy Yin1:
6678 SRIO是可以支持4x mode,你看到的注释只是说明TI的一块有两个DSP的EVM在硬件设计时只有通道2及3是链接的,如果硬件支持的话,这个例程是可以修改来支持任何mode的。
user1212849:
回复 Andy Yin1:
SRIO_PATH_CTL_4xLaneABCD模式下,只有srio_cfg.blockEn.bLogic_Port_EN[0]=1,其他为0