• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C6000 Multicore DSP » Keystone Multicore Forum (C66, 66A, AM5) » How to use Packet Accelerator and SRIO together?
Share
C6000 Multicore DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Training Available
TI provides self-paced online training that introduces the primary components of the KeyStone II family of SoC devices.

  • KeyStone II SoC Overview >
  • KeyStone II Software Overview >
  • KeyStone II ARM Cortex-A15 Corepac Overview >
  • More Information >
  • Check out
    Multicore Mix blog
    • $core_v2_blog.Current.Name

      Geeks UNITE for Geek Pride Day

      Posted 2 days ago
      by Lauren Reed1
      Happy Geek Pride Day from the Processors team! We wanted to celebrate...
    • $core_v2_blog.Current.Name

      OpenMP - All aboard!

      Posted 4 days ago
      by Debbie Greenstreet
      With so many end products today relying on multicore DSPs for...
    • $core_v2_blog.Current.Name

      A look back: Two years of Multicore Mix

      Posted 5 days ago
      by Lauren Reed1
      A big thank you to everyone who participated in our contest last...

    Forums

    How to use Packet Accelerator and SRIO together?

    This question is not answered
    Vladimir Podgoretskiy
    Posted by Vladimir Podgoretskiy
    on Dec 05 2011 10:42 AM
    Intellectual570 points

    Hello. I want to join NDK client and SRIO_multicore_loopback example applications. I plan to use single (same) .out file for all cores (4 cores). That's what i did:

    1) ipc_start on all cores

    2) on core0 initialize QMSS;

    3) on core0 insert memory region for PA;

    4) on core0 insert memory region for SRIO (number and size of descriptors I got from respective example applications);

    5) on core0 initialize CPPI;

    6) on core0 initialize SRIO;

    7) wait for SRIO to be initialized on other cores;

    8) start BIOS on all cores;

    9) after that executing Srio_start() on all cores failed.

    What I have done wrong?

    How to correctly initialize PA and SRIO together?

    How to correctly locate linker sections in memories (MSMCSRAM and L2SRAM)?

    I suppose that my problem is because of system_heap section is located in MSMCSRAM (it doesn't fit to L2SRAM) and all dynamically created variables (including pointers, descriptors) are allocated at the same addresses for all cores.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • ArunMani
      Posted by ArunMani
      on Dec 05 2011 12:09 PM
      Genius9510 points

      I don't see you doing PA initialization step in the description above. What you mean by cores failed. Can you elaborate?

       

      Thanks,

      Arun.

      If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Vladimir Podgoretskiy
      Posted by Vladimir Podgoretskiy
      on Dec 05 2011 20:35 PM
      Intellectual570 points

      Sorry, i forgot to describe PA initialization. It is done directly before NDK configuration and launching. So, LAN network works correctly (I can ping my EVMc6678l board). Now order of my actions is:   ipc_start, bios_start, then the same as was.

      Here is console log:

      [C66xx_2] Debug(Core 2): Waiting for SRIO to be initialized.
      [C66xx_3] Debug(Core 3): Waiting for SRIO to be initialized.
      [C66xx_0] Debug(Core 0): Host Region PA 0xc2fbb80
      [C66xx_1] Debug(Core 1): Waiting for SRIO to be initialized.
      [C66xx_0] Debug(Core 0): Host Region SRIO 0xc304b80
      [C66xx_0] QMSS successfully initialized
      [C66xx_0] CPPI successfully initialized
      [C66xx_0] Debug(Core 0): SRIO Driver has been initialized
      [C66xx_0] Error: Receive Queue Configuration Failed
      [C66xx_0] Error(Core 0): SRIO Driver failed to start
      [C66xx_0] PA successfully initialized
      [C66xx_0] PASS successfully initialized
      [C66xx_0] Ethernet subsystem successfully initialized
      [C66xx_0] Ethernet eventId : 48 and vectId (Interrupt) : 7
      [C66xx_0] Verify_Init: Expected 0 entry count for Queue number = 897, found 128 entries
      [C66xx_0] Registration of the EMAC Successful, waiting for link up ..
      [C66xx_1] Debug(Core 1): QMSS started
      [C66xx_2] Debug(Core 2): QMSS started
      [C66xx_3] Debug(Core 3): QMSS started
      [C66xx_1] Debug(Core 1): SRIO can now be used.
      [C66xx_2] Debug(Core 2): SRIO can now be used.
      [C66xx_3] Debug(Core 3): SRIO can now be used.
      [C66xx_1] Error: Receive Queue Configuration Failed
      [C66xx_1] Error(Core 1): SRIO Driver failed to start
      [C66xx_0] Network Added: If-1:192.168.2.100
      [C66xx_2] Error: Receive Queue Configuration Failed
      [C66xx_2] Error(Core 2): SRIO Driver failed to start
      [C66xx_3] Error: Receive Queue Configuration Failed
      [C66xx_3] Error(Core 3): SRIO Driver failed to start

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Vladimir Podgoretskiy
      Posted by Vladimir Podgoretskiy
      on Dec 05 2011 20:37 PM
      Intellectual570 points

      A piece of source-code is:

      int main()
      {
      Ipc_start(); /* Initialize the heap in shared memory. Using IPC module to do that */
      BIOS_start (); /* Start the BIOS 6 Scheduler */
      return(0);
      }

      //
      // Main Thread
      //
      int StackTest()
      {
      int i;
      coreNum = CSL_chipReadReg (CSL_CHIP_DNUM); /* Get the core number. */

      ... platform init (uart etc...)

      /* Initialize the components required to run this application:
      * (1) QMSS
      * (2) CPPI
      * (3) Packet Accelerator
      */
      if (platform_get_coreid() == 0)
      {
      CORE_0_INIT();
      }
      else
      {
      CORE_OTHERS_INIT();
      }
      return(0);
      }

      void CORE_0_INIT(void)
      {
      int rc;
      // int i;
      HANDLE hCfg;
      QMSS_CFG_T qmss_cfg;
      CPPI_CFG_T cppi_cfg;
      qmss_cfg.master_core = 1;
      cppi_cfg.master_core = 1;
      /* Initialize QMSS */
      if (res_mgr_init_qmss (&qmss_cfg, coreNum) != 0)
      {
      platform_write ("Failed to initialize the QMSS subsystem \n");
      goto main_exit;
      }
      else
      {
      platform_write ("QMSS successfully initialized \n");
      }

      /* Initialize CPPI */
      cppi_cfg.dma_num = Cppi_CpDma_PASS_CPDMA;
      cppi_cfg.num_tx_queues = NUM_PA_TX_QUEUES;
      cppi_cfg.num_rx_channels = NUM_PA_RX_CHANNELS;
      if (res_mgr_init_cppi (&cppi_cfg) != 0)
      {
      platform_write ("Failed to initialize CPPI subsystem \n");
      goto main_exit;
      }
      else
      {
      platform_write ("CPPI successfully initialized \n");
      }

      /* Power on SRIO peripheral before using it */
      if (enable_srio () < 0)
      {
      System_printf ("Error: SRIO PSC Initialization Failed\n");
      goto main_exit;
      }

      /* Device Specific SRIO Initializations: This should always be called before
      * initializing the SRIO Driver. */
      if (SrioDevice_init() < 0)
      goto main_exit;

      /* Initialize the SRIO Driver */
      if (Srio_init () < 0)
      {
      System_printf ("Error: SRIO Driver Initialization Failed\n");
      goto main_exit;
      }

      /* SRIO Driver is operational at this time. */
      System_printf ("Debug(Core %d): SRIO Driver has been initialized\n", coreNum);
      /* Write to the SHARED memory location at this point in time. The other cores cannot execute
      * till the SRIO Driver is up and running. */
      isSRIOInitialized = 1;

      /* The SRIO IP block has been initialized. We need to writeback the cache here because it will
      * ensure that the rest of the cores which are waiting for SRIO to be initialized would now be
      * woken up. */
      CACHE_wbL1d ((void *) &isSRIOInitialized, 128, CACHE_WAIT);

      PreSrioDriverInit();


      if (res_mgr_init_pass()!= 0) {
      platform_write ("Failed to initialize the Packet Accelerator \n");
      goto main_exit;
      }
      else
      {
      platform_write ("PA successfully initialized \n");
      }

      ... NDK configuration and start ...
      }

      void CORE_OTHERS_INIT(void)
      {
      // QMSS_CFG_T qmss_cfg;
      // CPPI_CFG_T cppi_cfg;
      // qmss_cfg.master_core = 0;
      // cppi_cfg.master_core = 0;
      /* All other cores need to wait for the SRIO to be initialized before they proceed with the test. */
      System_printf ("Debug(Core %d): Waiting for SRIO to be initialized.\n", coreNum);

      /* All other cores loop around forever till the SRIO is up and running.
      * We need to invalidate the cache so that we always read this from the memory. */
      while (isSRIOInitialized == 0)
      CACHE_invL1d ((void *) &isSRIOInitialized, 128, CACHE_WAIT);

      /* Start the QMSS. */
      if (Qmss_start() != QMSS_SOK)
      {
      System_printf ("Error: Unable to start the QMSS\n");
      return;
      }
      System_printf ("Debug(Core %d): QMSS started\n", coreNum);
      System_printf ("Debug(Core %d): SRIO can now be used.\n", coreNum);
      PreSrioDriverInit();

      }

      void PreSrioDriverInit(void)
      {
      Srio_DrvConfig drvCfg;
      UInt8 isAllocated;

      memset ((Void *)&drvCfg, 0, sizeof(Srio_DrvConfig)); /* Initialize the SRIO Driver Configuration. */

      if (Osal_dataBufferInitMemory(SRIO_MAX_MTU) < 0) /* Initialize the OSAL */
      {
      System_printf ("Error: Unable to initialize the OSAL. \n");
      return;
      }

      /********************************************************************************
      * The SRIO Driver Instance is going to be created with the following properties:
      * - Driver Managed
      * - Interrupt Support (Pass the Rx Completion Queue as NULL)
      ********************************************************************************/

      /* Setup the SRIO Driver Managed Configuration. */
      drvCfg.bAppManagedConfig = FALSE;

      /* Driver Managed: Receive Configuration */
      drvCfg.u.drvManagedCfg.bIsRxCfgValid = 1;
      drvCfg.u.drvManagedCfg.rxCfg.rxMemRegion = Qmss_MemRegion_MEMORY_REGION0;
      drvCfg.u.drvManagedCfg.rxCfg.numRxBuffers = 4;
      drvCfg.u.drvManagedCfg.rxCfg.rxMTU = SRIO_MAX_MTU;

      /* Accumulator Configuration. */
      {
      int32_t coreToQueueSelector[4];

      /* This is the table which maps the core to a specific receive queue. */
      coreToQueueSelector[0] = 704;
      coreToQueueSelector[1] = 705;
      coreToQueueSelector[2] = 706;
      coreToQueueSelector[3] = 707;

      /* Since we are programming the accumulator we want this queue to be a HIGH PRIORITY Queue */
      drvCfg.u.drvManagedCfg.rxCfg.rxCompletionQueue = Qmss_queueOpen (Qmss_QueueType_HIGH_PRIORITY_QUEUE,
      coreToQueueSelector[coreNum], &isAllocated);
      if (drvCfg.u.drvManagedCfg.rxCfg.rxCompletionQueue < 0)
      {
      System_printf ("Error: Unable to open the SRIO Receive Completion Queue\n");
      return;
      }

      /* Accumulator Configuration is VALID. */
      drvCfg.u.drvManagedCfg.rxCfg.bIsAccumlatorCfgValid = 1;

      /* Accumulator Configuration. */
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.channel = coreNum;
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.command = Qmss_AccCmd_ENABLE_CHANNEL;
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.queueEnMask = 0;
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.queMgrIndex = coreToQueueSelector[coreNum];
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.maxPageEntries = 2;
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.timerLoadCount = 0;
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.interruptPacingMode = Qmss_AccPacingMode_LAST_INTERRUPT;
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.listEntrySize = Qmss_AccEntrySize_REG_D;
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.listCountMode = Qmss_AccCountMode_ENTRY_COUNT;
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.multiQueueMode = Qmss_AccQueueMode_SINGLE_QUEUE;

      /* Initialize the accumulator list memory */
      memset ((Void *)&gHiPriAccumList_SRIO[0], 0, sizeof(gHiPriAccumList_SRIO));
      drvCfg.u.drvManagedCfg.rxCfg.accCfg.listAddress = l2_global_address((UInt32)&gHiPriAccumList_SRIO[0]);
      }

      /* Driver Managed: Transmit Configuration */
      drvCfg.u.drvManagedCfg.bIsTxCfgValid = 1;
      drvCfg.u.drvManagedCfg.txCfg.txMemRegion = Qmss_MemRegion_MEMORY_REGION0;
      drvCfg.u.drvManagedCfg.txCfg.numTxBuffers = 4;
      drvCfg.u.drvManagedCfg.txCfg.txMTU = SRIO_MAX_MTU;

      /* Start the Driver Managed SRIO Driver. */
      hDrvManagedSrioDrv = Srio_start(&drvCfg); //this functions fails
      if (hDrvManagedSrioDrv == NULL)
      {
      System_printf ("Error(Core %d): SRIO Driver failed to start\n", coreNum);
      return;
      }

      System_printf ("Debug(Core %d): SRIO Driver started successfully\n", coreNum);

      /* Hook up the SRIO interrupts with the core. */
      EventCombiner_dispatchPlug (48, (ti_sysbios_family_c64p_EventCombiner_FuncPtr)Srio_rxCompletionIsr, (UArg)hDrvManagedSrioDrv, TRUE);
      ti_sysbios_family_c64p_EventCombiner_enableEvent(48);
      }

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Velimir Vujanovic
      Posted by Velimir Vujanovic
      on Mar 14 2012 08:41 AM
      Prodigy10 points

      Hi Vladimir,

      I have same issue you described earlier, in  attempt  to join NDK and SRIO example. I failed to start SRIO driver with message "SRIO driver failed to start"

      Did you find solution for this?

      Thanks in advance.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BrandyJ
      Posted by BrandyJ
      on Apr 16 2012 15:16 PM
      Genius4370 points

      I am also working on this.  Hopefully TI will chime in again.

      One thing I notice in Vladimir's code is that the Ethernet is using event 48 and the SRIO is using event 48.  I needed to switch mine to event 49 and also change the "coreToQueueSelector" array to match event 49 instead.

      Now my application will run but if the as soon as I send a udp packet, the doorbell ISRs stop coming, so I think there must be some interaction still.

      Brandy

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • ArunMani
      Posted by ArunMani
      on Apr 16 2012 21:17 PM
      Genius9510 points

      Hi Brandy,

      in your case did the ping works?

      Valdimir,

      Is it possible for you to zip the project and send. I can try it out in my system.

      Thanks,

      Arun.

      If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BrandyJ
      Posted by BrandyJ
      on Apr 17 2012 07:42 AM
      Genius4370 points

      Hello Arun,

      Yes, my ping will work and I see the first "gratiutious arp" but then I never see my udp packet that I sent using sendto and then I also never get any more doorbells. 

      I am going to work through it more today.  It is slow going becuase there is alot of steps to get the emulator to work correctly when using the ndk and I find that if I don't do the process precisely (for instance, load program, system reset, global default setup, load program, go or something similar) then either SRIO or Ethernet does not work and I haven't master exactly what will work.

      Thanks,

      Brandy

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BrandyJ
      Posted by BrandyJ
      on Jun 26 2012 16:10 PM
      Genius4370 points

      Hello,

      Just to close this out, I got it to work, my fire wall was blocking all traffic.  How irritating.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use