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.

How to simulate NDK on CCS TI simulator?

Hello. I want to simulate NDK in CCS on evm6678 platform to see how fast works PA and higher level soft (LLD e.t.c). How can I do it? Now i get message something like "Emac registration successfull, waiting for link up...". And some DHCPC statuses like "enabled". Please help, how can i simulate "linking up"?

  • I understood some things... I edited configuration file of simulator, wrote there my Network Card's name, and enabled logging. Now when I starts the simulation, I can see in log-file that there is all ok, Simulator connects to my Network Card through Winpcap-driver, also I can see there that it captures broadcast packets from network, but there is no activity in CCS-console, there is still "Waiting for link-up" message... What did I make wrong?

  • Hi,

    Couple of things.

    1. Currently we have some issues on successfully bringup the NDK applications (like client) reliably on Simulator. Sometimes it works and sometimes it does not. We are working on this.

    2. However, the procedure to get this work on simulator is to get the nimu_eth library compiled for simulator support (that is the library needs to be recompiled with SIMULATOR_SUPPORT define during compile time).

    3. For Simulator support, the application (client application) needs to be modifed for static ip only and linked with the nimu_eth library from #2, since DHCP mode did not work for simulator.

    -Thanks,

    Aravind

  •  Hi. I have already compiled the project with SIMULATOR_SUPPORT define option. I will try it with static IP, but i'm afraid it will not help with "linking up". Thanks, I will try...

  • Unfortunately, it does not work even with static IP... What else things should I know to make it works? Thanks.

    P.S. As I told earlier, I see broadcast packets capturing by winpcap driver (in log-file), but I CAN'T see any outgoing packets from EMAC, even ARP-replies. Turn out to be either these packets don't reach the emac / NIMU, or EMAC can't send answer-packets back through winpcap).

    P.S.S. Additionally I am monitoring ethernet-traffic with Etherial. There are no outgoing packets too... Please help.

  • There is one more change which I forgot to mention.

    You need to update the MAC address of your PC in the test application.

    For e.g., under Client application (client.c)

    You would see below statements, please update the MAC address to your PC's MAC address and then see if it helps.

    // Simulator EMAC Switch does not handle ALE_LEARN mode, so please configure the
    // MAC address of the PC where you want to launch the webpages and initiate PING to NDK */

    Uint8 clientMACAddress [6] = {0x00, 0x15, 0xE9, 0x85, 0x8A, 0x0A}; /* MAC address for my PC */

    -Thanks,

    Aravind

     

    P.S: Please make sure that the simulator configurations are done as below. (The same can be found under Step II of \pdk_C6678_1_0_0_*\packages\ti\drv\pa\example\emacExample\Readme.txt)

    II. NIC-loopback
        b) Pick a NIC on the PC running simulation that you'd like to use to run the example. This will
           be the interface using which the packets will be sent/received by the example.
        c) Under "EMAC_ADAPTOR" section, locate the following line of code,

               INPUT2 ADAPTOR, OFF;

            Modify the above line of code to:

               INPUT2 ADAPTOR, ON;

            This will turn on the EMAC adaptor in simulator so as to send/receive packets.
        d) Under the same section, locate and modify the following line of code as follows:

               INPUT4  NETWORK_ADAPTOR, Broadcom;                   

            Modify the above line of code to include the name of the NIC card you are using, for example if
            the interface you are using for the test on your PC is a "Realtek" card, modify the above line
            to:

               INPUT4  NETWORK_ADAPTOR, Realtek;           

        e) If the following lines are uncommented, please comment them:                   

        CONNECT11       System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_tx_data_gen_opin, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_rx_data_gen_ipin;
        CONNECT12       System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_rx_data_gen_ipin, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_tx_data_gen_opin;
       
        as follows:

        //CONNECT11       System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_tx_data_gen_opin, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_rx_data_gen_ipin;
        //CONNECT12       System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_rx_data_gen_ipin, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_tx_data_gen_opin;
       

        This disables loopback at EMAC adaptor level (PHY simulation) in the simulator.

        f) Finally, configure the switch MAC configured in the example, i.e., 0x10-0x11-0x12-0x13-0x14-0x15 on the
           EMAC adaptor so that the simulator can pass all packets matching the switch MAC up to the application.

           example:

       INPUT5  MAC_ADDRESS_PORT0, 10-11-12-13-14-15;   // configure the Port0 MAC to be the switch MAC
       INPUT6  MAC_ADDRESS_PORT1, 00-01-02-03-04-05;      

    Launch the CCS Debugger and go to the Debug Perspective.

    To execute the project ensure the following is done:-
        a) Reset CPU
        b) Load Program
        c) Once the project is loaded; Run to execute it.

  • Aravind Batni said:

    There is one more change which I forgot to mention.

    You need to update the MAC address of your PC in the test application.

    For e.g., under Client application (client.c)

    Should to tell, that I don't use client.c. I'm using NDK+SYS/BIOS 6, therefore necessary services (functions like NC_SystemOpen(), NC_NetStart() etc) starts automatically, I just run Operational System by BIOS_start(), and all needed threads, including NDK's, run. I think ping in this case must work...

    Aravind Batni said:

    You would see below statements, please update the MAC address to your PC's MAC address and then see if it helps.

    // Simulator EMAC Switch does not handle ALE_LEARN mode, so please configure the
    // MAC address of the PC where you want to launch the webpages and initiate PING to NDK */

    Uint8 clientMACAddress [6] = {0x00, 0x15, 0xE9, 0x85, 0x8A, 0x0A}; /* MAC address for my PC */

    -Thanks,

    Aravind

     As I am not using client.c (and its depending sources), in NIMU's library I change extern Uint8 clientMACAddress to just  Uint8 clientMACAddress [6] = {0x00, 0x15, 0xE9, 0x85, 0x8A, 0x0A}; where I set MY PC's MAC-address. It didn't help.

    Aravind Batni said:
     

    P.S: Please make sure that the simulator configurations are done as below. (The same can be found under Step II of \pdk_C6678_1_0_0_*\packages\ti\drv\pa\example\emacExample\Readme.txt)

    II. NIC-loopback
        b) Pick a NIC on the PC running simulation that you'd like to use to run the example. This will
           be the interface using which the packets will be sent/received by the example.
        c) Under "EMAC_ADAPTOR" section, locate the following line of code,

               INPUT2 ADAPTOR, OFF;

            Modify the above line of code to:

               INPUT2 ADAPTOR, ON;

            This will turn on the EMAC adaptor in simulator so as to send/receive packets.
        d) Under the same section, locate and modify the following line of code as follows:

               INPUT4  NETWORK_ADAPTOR, Broadcom;                   

            Modify the above line of code to include the name of the NIC card you are using, for example if
            the interface you are using for the test on your PC is a "Realtek" card, modify the above line
            to:

               INPUT4  NETWORK_ADAPTOR, Realtek;           

        e) If the following lines are uncommented, please comment them:                   

        CONNECT11       System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_tx_data_gen_opin, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_rx_data_gen_ipin;
        CONNECT12       System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_rx_data_gen_ipin, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_tx_data_gen_opin;
       
        as follows:

        //CONNECT11       System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_tx_data_gen_opin, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_rx_data_gen_ipin;
        //CONNECT12       System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_rx_data_gen_ipin, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_tx_data_gen_opin;

        This disables loopback at EMAC adaptor level (PHY simulation) in the simulator.

    All is OK except of there is no CONNECT11 and CONNECT12 lines in my config-file (tisim_c6678_pv.cfg). I have:

    CONNECT1 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_reset, System.C66XX_S.SHARED_SYSTEM.SHARED_SYSTEM_INTF.reset_out;
    CONNECT2 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_receive_data_port0, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_tx_data_gen_opin;
    CONNECT3 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_send_data_port0, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii0_rx_data_gen_ipin;
    CONNECT4 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_receive_data_port1, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_tx_data_gen_opin;
    CONNECT5 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_send_data_port1, System.C66XX_S.SHARED_SYSTEM.SWITCHSS.switchss_sgmii1_rx_data_gen_ipin;
    CONNECT6 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_error_opin,System.C66XX_S.CPU_SYSTEM_0.CPU0.error_intf_ssi;
    CONNECT7 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_error_opin,System.C66XX_S.CPU_SYSTEM_1.CPU1.error_intf_ssi;
    CONNECT8 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_error_opin,System.C66XX_S.CPU_SYSTEM_2.CPU2.error_intf_ssi;
    CONNECT9 System.C66XX_S.SHARED_SYSTEM.EMAC_ADAPTOR.EMAC_ADAPTOR_error_opin,System.C66XX_S.CPU_SYSTEM_3.CPU3.error_intf_ssi;

    END INTERFACES;

    //User Inputs to be passed from CPU to the peripheral model
    MODULE USER_INPUTS;

    INPUT1 CPU_NAME, SHARED;
    INPUT2 ADAPTOR, ON;
    INPUT3 NUMBER_OF_PORTS,2;
    INPUT4 NETWORK_ADAPTOR, Realtek;
    INPUT5 MAC_ADDRESS_PORT0, 00-1C-BF-36-25-AF;
    INPUT6 MAC_ADDRESS_PORT1, 00-21-86-81-A8-F0;
    INPUT7 MAC_CRC, ON;
    INPUT8 LOG_FILE, c:\emac_log.txt;

    IMHO, all is OK too.

    Any suggestions? Thanks a lot...

  • Hi,

    Sorry to hear this. Like I said before, we are having some issues to bring up the NDK Examples on Simulator. Hopefully, we get this resolved for the GA Release of BIOS MCSDK Release.

    -Thanks,

    Aravind

  • Well, and when can we approximately expect this release?

  • The expected release time frame is around July.

    Please refer to the the IR SDOCM00079225 under SDOWP tracking this issue.

    https://cqweb.ext.ti.com/cqweb/main?command=GenerateMainFrame&service=CQ&schema=SDO-Web&contextid=SDOWP&queryID=34439429&username=readonly&password=readonly

     

    -Thanks,

    Aravind

  • Aravind,

    This issue appears to be fixed in the CQ status report. Can you please share details of when this will be released or if there is a patch available to let this work?

    Thanks,

    Oliver.

  • Oliver,

    This is fixed in the production release (build 2.0.0.11) of the BIOS MCSDK release. Please note that we verified *ping* working for the Client application using simulator.

    http://software-dl.ti.com/sdoemb/sdoemb_public_sw/bios_mcsdk/02_00_00_11/index_FDS.html

    -Thanks,
    Aravind

  • hello! thanks for link! I have installed ccs 5.0.3.00028 and McSDK 2.0.0.11. I have easily recompiled evm6678l platform's library and nimu's library with SIMULATOR_SUPPORT flag. Then I start simulation of CLIENT project provided by MCSDK. It hung up into function where it was waiting for SGMII locked. I commented that "while". Then it hung up after first call of platform_write function. I set "return" in the beginning of this function. Now it tells me that source MAC does not match config MAC. What's wrong? How should I configure all needed MAC's (including client project's config MAC, may be BIOS config MAC, and simulator's config MACs ( INPUT5 MAC_ADDRESS and  INPUT6 MAC_ADDRESS), where should I set up MAC address of my PC's network card? I finally confused... Please help.

    Thanks a lot, Vladimir.

  • Vladimir,

    Sorry to hear about this. Noticed that both 2.0.0 and 2.0.1 releases have the simulator support broken for NDK. I filed a bug against 2.0.1 release and we should be getting the fix in next releases.

    Here are the list of changes that you would like to do on top of the CCS simulator configuration file changes as mentioned above to get you moving with the Production release.

    Please do the changes as below. (Note that I explaned the changes wrt to C6678 and similar changes might be required for C6670 also).

    1. Application code/configuration changes.

    1a. Change C:\Program Files\Texas Instruments\mcsdk_2_00_00_11\examples\ndk\client\evmc6678l\client.cfg as below.

    var PlatformLib  = xdc.loadPackage('ti.platform.evmc6678l');

    change to

     var PlatformLib  = xdc.loadPackage('ti.platform.simc6678');

    1b.  change C:\Program Files\Texas Instruments\mcsdk_2_00_00_11\examples\ndk\client\client.c as below. This would select always static ip address for the Client application since the simulator does not support the DHCP mode.

    Around LIne #301,

        if (!platform_get_switch_state(1)) {  ===> change this to if (1) {

            CI_IPNET NA;
            CI_ROUTE RT;

    ....

    ....

    ....   

            if( IPTmp )
                CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_DOMAINNAMESERVER,
                             0, sizeof(IPTmp), (UINT8 *)&IPTmp, 0 );

    }

    else {

    2. Platform Library for Simulator Changes

    Around line #120 of  C:\Program Files\Texas Instruments\pdk_C6678_1_0_0_11\packages\ti\platform\simc6678\platform_lib\src\evmc6678_phy.c

    change

    #ifdef SIMULATOR_SUPPORT
     void Init_SGMII (uint32_t macPortNum)
     {
    to
    #if  1
     void Init_SGMII (uint32_t macPortNum)
     {
    3. Nimu Eth Driver Changes
    C:\Program Files\Texas Instruments\pdk_C6678_1_0_0_11\packages\ti\transport\ndk\nimu\src\nimu_eth.c file changes
    Please delete all the highlighted code as below.
      *  the knowledge on the QMSS, CPPI, PA LLD configurations/programs.
      *
      */
    -#ifdef SIMULATOR_SUPPORT
    -#include <ti/csl/csl_chipaux.h>
    -#else
     #include <ti/platform/platform.h>
     #include "resource_mgr.h"
    -#endif
     
     #include <nimu_eth.h>
     #include <include/nimu_internal.h>
    ...
    ...
    ...
    in EmacSend (NETIF_DEVICE* ptr_net_device, PBM_Handle hPkt) function,
     
     
         /* Get the core number. */
    -#ifdef SIMULATOR_SUPPORT
    -    coreNum = CSL_chipReadDNUM();
    -#else
         coreNum = platform_get_coreid();
    -#endif
     
         count = Qmss_getQueueEntryCount (gTxReturnQHnd);
    ...
    ...
    ... 
    In static int EMACInit_Core (STKEVENT_Handle hEvent) function
         uint32_t coreNum;
     
         /* Get the core number. */
    -#ifdef SIMULATOR_SUPPORT
    -    coreNum = CSL_chipReadDNUM();
    -#else
         coreNum = platform_get_coreid();
    -#endif
     
         /* Allocate memory for the private data */
         ptr_pvt_data    = Osal_nimuMalloc (platform_roundup(sizeof(EMAC_DATA), PLATFORM_CACHE_LINE_SIZE), PLATFORM_CACHE_LINE_SIZE);

  • It works. Half of above changes i mada myself. Others will make now. About MAC-addresses: I set up mac-addresses in:

    1) EmacStart function, ethinfo structure : {10, 11, 12, 13, 14, 15}

    2) ptr_pvt_data -> pdi.bMacAddr[ ] = 10, 11, 12, 13, 14, 15

    3) Simulator Configuration : INPUT5: 10-11-12-13-14-15, INPUT6: mac of my PC's network card.

    Ping works fine!!! Thanks a lot, especially, Aravind!