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.

如何修改K1 STK V1.1中的srio例程为no loop back



最近在做fpga与dsp通过srio进行数据传输,fpga发数据,dsp接收数据。用的是论坛里给出的K1 STK V1.1 这个程序包。但是程序包里程序很多不知道用的是哪一个。是只要用srio-test.c中的no loopback 这一段吗??如果是的话,需要怎么修改呢??求大佬赐教!!!!
 
  • if(SRIO_NO_LOOPBACK==loopback_mode)

    /*DSP0 is the master for test, DSP0 DirectIO or send message to DSP1.
    DSP1 is the slave for test, it monitor the doorbell and message
    interrupt to detect the received data*/
    if(0==uiDspNum)
    {
    SRIO_2DSP_Test();
    }
    else
    {
    srio_cfg.device_ID_routing_config= dsp1_device_ID_routing_config;
    srio_cfg.uiNumDeviceId=
    sizeof(dsp1_device_ID_routing_config)/
    sizeof(SRIO_Device_ID_Routing_Config);

    msg_cfg.message_map = DSP1_message_map;
    msg_cfg.uiNumMessageMap=
    sizeof(DSP1_message_map)/sizeof(SRIO_RX_Message_Map);
    srio_cfg.msg_cfg= &msg_cfg;

    serdesLinkSetup.linkSpeed_GHz= SRIO_DEFAULT_TEST_SPEED;
    srio_cfg.srio_1x2x4x_path_control= SRIO_PATH_CTL_1xLaneA_1xLaneB_1xLaneC_1xLaneD;
    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]= FALSE;
    srio_cfg.blockEn.bLogic_Port_EN[1]= FALSE;

    KeyStone_SRIO_Init(&srio_cfg);
    SRIO_PktDM_init();

    /*accumulation is only used for the 2nd DSP for two DSPs test*/
    QMSS_Accumulation_config();

    puts("DSP1 ready as slave for test");
    while(1);
    }
    }
  • if(SRIO_NO_LOOPBACK==loopback_mode)

    /*DSP0 is the master for test, DSP0 DirectIO or send message to DSP1.
    DSP1 is the slave for test, it monitor the doorbell and message
    interrupt to detect the received data*/
    if(0==uiDspNum)
    {
    SRIO_2DSP_Test();
    }
    else
    {
    srio_cfg.device_ID_routing_config= dsp1_device_ID_routing_config;
    srio_cfg.uiNumDeviceId=
    sizeof(dsp1_device_ID_routing_config)/
    sizeof(SRIO_Device_ID_Routing_Config);

    msg_cfg.message_map = DSP1_message_map;
    msg_cfg.uiNumMessageMap=
    sizeof(DSP1_message_map)/sizeof(SRIO_RX_Message_Map);
    srio_cfg.msg_cfg= &msg_cfg;

    serdesLinkSetup.linkSpeed_GHz= SRIO_DEFAULT_TEST_SPEED;
    srio_cfg.srio_1x2x4x_path_control= SRIO_PATH_CTL_1xLaneA_1xLaneB_1xLaneC_1xLaneD;
    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]= FALSE;
    srio_cfg.blockEn.bLogic_Port_EN[1]= FALSE;

    KeyStone_SRIO_Init(&srio_cfg);
    SRIO_PktDM_init();

    /*accumulation is only used for the 2nd DSP for two DSPs test*/
    QMSS_Accumulation_config();

    puts("DSP1 ready as slave for test");
    while(1);
    }
    }
  • else if(SRIO_NO_LOOPBACK==loopback_mode) //test between 2 DSPs
    {
    /*DSP0 is the master for test, DSP0 DirectIO or send message to DSP1.
    DSP1 is the slave for test, it monitor the doorbell and message
    interrupt to detect the received data*/
    if(0==uiDspNum)
    {
    SRIO_2DSP_Test();
    }
    else
    {
    srio_cfg.device_ID_routing_config= dsp1_device_ID_routing_config;
    srio_cfg.uiNumDeviceId=
    sizeof(dsp1_device_ID_routing_config)/
    sizeof(SRIO_Device_ID_Routing_Config);

    msg_cfg.message_map = DSP1_message_map;
    msg_cfg.uiNumMessageMap=
    sizeof(DSP1_message_map)/sizeof(SRIO_RX_Message_Map);
    srio_cfg.msg_cfg= &msg_cfg;

    serdesLinkSetup.linkSpeed_GHz= SRIO_DEFAULT_TEST_SPEED;
    srio_cfg.srio_1x2x4x_path_control= SRIO_PATH_CTL_1xLaneA_1xLaneB_1xLaneC_1xLaneD;
    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]= FALSE;
    srio_cfg.blockEn.bLogic_Port_EN[1]= FALSE;

    KeyStone_SRIO_Init(&srio_cfg);
    SRIO_PktDM_init();

    /*accumulation is only used for the 2nd DSP for two DSPs test*/
    QMSS_Accumulation_config();

    puts("DSP1 ready as slave for test");
    while(1);
    }
  • 是只要修改上面的程序吗
  • 可以结合KeyStone_1_SRIO_STK_User's_Guide.doc文档,里面有Data passing between 2 DSPs例程。