• 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) » CSL_intcPlugEventHandler v/s CpIntc_dispatchPlug v/s CSL_intcHookIsr
Share
C6000 Multicore DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Resources
  • KeyStone Multicore DSP + ARM Product Folder
  • Keystone II MCSDK Download
  • Keystone II MCSDK User's Guide

  • KeyStone Multicore DSP Product Folder
  • Keystone I BIOS-MCSDK Download
  • Keystone I BIOS-MCSDK User's Guide

  • Keystone I & II Training

  • C6000 Multicore DSP Product Folder
  • C6000 Multicore Devices

  • DESKTOP-LINUX-SDK 01_00_00_07 Download
  • MCSDK-VIDEO 02_01_00_08 Download

  • C6472 and C6474 Online Training
  • Check out
    Multicore Mix blog
    • $core_v2_blog.Current.Name

      Wireless base stations – why monitor the backup battery?

      Posted 4 days ago
      by Raj Radjassamy
      2G, 3G and 4G LTE base stations use lead-acid batteries as the...
    • $core_v2_blog.Current.Name

      Innovation through smart integration – achieving lower power, high performing small cells

      Posted 5 days ago
      by Debbie Greenstreet
      Wireless small cell market activity is accelerating lately and...
    • $core_v2_blog.Current.Name

      Four for Friday: What’s up at the Small Cells World Summit?

      Posted 19 days ago
      by Debbie Greenstreet
      If you are a follower of the wireless technology, you have probably...

    Forums

    CSL_intcPlugEventHandler v/s CpIntc_dispatchPlug v/s CSL_intcHookIsr

    This question is answered
    RCReddy
    Posted by RCReddy
    on Jul 05 2012 15:12 PM
    Genius3345 points

    I am not able to understand the differences in handling interupts.

    An ISR can be hooked in 3 ways [CSL_intcPlugEventHandler, CpIntc_dispatchPlug and CSL_intcHookIsr], what is purpose and when [at what stage]. Can Some Member from Ti/Public Kindly writeback a Detailed reply on this.

    please reply to below points

    1. differences among them.

    2. when to use what.

    3. Any guidelines for point 2.

    4. ease of use.

    5. Any major configs/settings to be taken care.

    Thanks

    RC Reddy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • RandyP
      Posted by RandyP
      on Jul 07 2012 20:49 PM
      Guru61625 points

      RC,

      Which device are you using? Which software versions are you using?

      Following the examples that are provided with the software packages will show you how to use these functions.

      Regards,
      RandyP

      Search for answers, Ask a question, click  Verify  when complete, Help others, Learn more.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RCReddy
      Posted by RCReddy
      on Jul 08 2012 09:42 AM
      Genius3345 points

      Hi Ran,

                     I am using c6670.

                     CCSV5 [latest 69 version], MCSDK - 02_00_09_21.

      1. In Hyperlink, CSL_intcPlugEventHandler is used for hooking ISR. 

      2. In SRIO, for handling ISR, CpIntc_dispatchPlug is used.

      3. In AIF2, CSL_intcHookIsr is used for hooking ISR.

      all above three functions based example projects are from Ti in PDK folders under c6670.

      I couldn't understand the situation/context in which each of the above functions is used. Kindly answer below questions

      My main question stands the same.

      1. differences among them.

      2. when to use which ISR HOOKING FUNCTION.

      3. Any guidelines for point 2.

      4. Ease of use.

      5. Any major configs/settings to be taken care.

      Thanks

      RC Reddy 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • River Liu
      Posted by River Liu
      on Jul 12 2012 02:37 AM
      Prodigy195 points

      CSL_intcHookIsr mapping ISR function to hardware interrupt vector, the function should be defined as "interrupt".

      CSL system maintatins its self ISR-vector mapping table as below,

          _CSL_intcCpuIntrTable.nmiIsr  = _CSL_intcNmiDummy;     _CSL_intcCpuIntrTable.isr4  = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr5  = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr6  = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr7  = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr8  = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr9  = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr10 = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr11 = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr12 = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr13 = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr14 = _CSL_intcDispatcher;     _CSL_intcCpuIntrTable.isr15 = _CSL_intcDispatcher;

      So CSL_intcPlugEventHandler just plug your own ISR in _CSL_intcDispatcher to get second jumping.

      However CSL_intcHookIsr will replace the above mapping table in the corresponding place using your "interrupt" function.

       

      CpIntc_dispatchPlug  is a BIOS function. BIOS maintains interrupt using its self APIs. In BIOS6 maybe you can mix BIOS APIs and CSL APIs in using interrupt.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RCReddy
      Posted by RCReddy
      on Jul 12 2012 11:20 AM
      Genius3345 points

      Hi River Liu,

                         Many thanks for replying [with your experiences/expertise]. Let me put more discussion on this [I did some study and went through examples]. Here is my understanding/questions based on what you told. please confirm which is right and which is wrong.

      This is the MAJOR diagram

      System_Interrupt ==> input event on CICx ==> Host Interrupt ==> eventId[4 to 128] ==> CPUINT[4 to 15]

      1. Say, if i don't use any CSL_intcHookIsr, then the default function called for any of the CPUINT4 to CPUINT15 is _CSL_intcDispatcher.

      2. Say, if i use CSL_intcHookIsr for say CPUINT 9 and hook MyIsr(), then any Pulse/level sensitive signal on Interrupt PIN 9 will raise/cause the Isr function MyIsr() instead of default _CSL_intcDispatcher.

      3. _CSL_intcDispatcher = Function of {CPUINT only}

      System_Interrupt ==> input event on CICx ==> Host Interrupt ==> eventId ==> CPUINT

      4. CSL_intcPlugEventHandler plugs Isr at event level, say i map event 

      System_Interrupt ==> input event on CICx ==> Host Interrupt ==> eventId ==> CPUINT

      CSL_intcPlugEventHandler  = Function of {evenId, CPUINT}

      5. CpIntc_dispatchPlug plugs Isr to the system Interrupt itself.

      System_Interrupt ==> input event on CICx ==> Host Interrupt ==> eventId ==> CPUINT

      CpIntc_dispatchPlug  = Function of {System_Interrupt}

      Hi Team Ti,

                        Please confirm if my understanding is correct.

      Thanks

      RC Reddy

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RCReddy
      Posted by RCReddy
      on Jul 17 2012 02:32 AM
      Genius3345 points

      Hi,

           Anyone member from Ti please respond to my above post

      Thanks

      RC Reddy

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RCReddy
      Posted by RCReddy
      on Jul 18 2012 08:30 AM
      Genius3345 points

      Hi Ti folks,

                      Still waiting for response :-(, kindly respond

      Thanks

      RC Reddy

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • judahvang
      Posted by judahvang
      on Jul 27 2012 10:33 AM
      Genius16765 points

      RC Reddy,

      I don't know the answer to questions #1-4

      As far as #5 is concerned.  CpIntc_dispatchPlug simply plugs a table with your function and argument.  This table then is used by CpIntc_dispatch when processing CpIntc interrupts.

      Hwi_create() - this plugs the interrupt vector and the ISR fxn.  When using CpIntc, you must plug the Hwi fxn with CpIntc_dispatch so it knows how to process the CpIntc interrupts.

      CpIntc- deals with System interrupts and Host Interrupts.

      Hwi - deals with the GEM interrupt contorller.

      EventCombiner - deals with the Event Combiner.

      Here is a picture, hope this helps:

      Judah

      If my reply answers your question please mark the thread as answered

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RCReddy
      Posted by RCReddy
      on Aug 01 2012 12:48 PM
      Genius3345 points

      Hi Judah,

                    Thanks for your reply, Also i need answers for questions 1 to 4. I have been re-iterating the same over and over again, please ask any Ti expert [on interrupts ] to clarify/confirm my understanding of the interrupts [questions 1 to 4]. 

      Also why don't Ti publish such a simplified diagrams anywhere in the documents, This simple pic you pasted is worth more than N paragraphs reading and digesting. 

      Request you to please ask an expert to answer questions on which API at which stage [where my understanding is correct] and also under what situations/contexts, which API is to be used. 

      Again requesting to you pull in an expert.

      Thanks

      RC Reddy

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Uday
      Posted by Uday
      on Aug 01 2012 17:26 PM
      Expert3910 points

      Hello RC Reddy,

      Please see our comments inline confirming your statements. Please let us know if you have any further questions.

      Q1: Say, if i don't use any CSL_intcHookIsr, then the default function called for any of the CPUINT4 to CPUINT15 is _CSL_intcDispatcher.
      A1: That is correct. Here is a snapshot of the _CSL_intcDispatcher function from CSL:
      interrupt void _CSL_intcDispatcher (void)
      {
          Uint32  evtId;
          Uint32  intrId = (_CSL_intcCpuIntrTable.currentVectId - \
                          (Uint32)(&_CSL_intcCpuIntrTable) - 4)/4;
              
          /* Get the Event Source of the Interrupt */
          if (intrId < 8)
              evtId = CSL_FEXTR(((CSL_IntcRegsOvly)CSL_CGEM0_5_REG_BASE_ADDRESS_REGS)->INTMUX1, \
                                  (intrId-4)*8+6,(intrId-4)*8);
          else {
              if (intrId < 12)
                  evtId = CSL_FEXTR(((CSL_IntcRegsOvly)CSL_CGEM0_5_REG_BASE_ADDRESS_REGS)->INTMUX2, \
                                      (intrId-8)*8+6,(intrId-8)*8);
              else
                  evtId = CSL_FEXTR(((CSL_IntcRegsOvly)CSL_CGEM0_5_REG_BASE_ADDRESS_REGS)->INTMUX3, \
                                      (intrId-12)*8+6,(intrId-12)*8);
          }
          
          if (_CSL_intcEventOffsetMap[evtId] != CSL_INTC_MAPPED_NONE)
              _CSL_intcEventHandlerRecord[_CSL_intcEventOffsetMap[evtId]].handler (
                  _CSL_intcEventHandlerRecord[_CSL_intcEventOffsetMap[evtId]].arg
                  );    

      Q2: Say, if i use CSL_intcHookIsr for say CPUINT 9 and hook MyIsr(), then any Pulse/level sensitive signal on Interrupt PIN 9 will raise/cause the Isr function MyIsr() instead of default _CSL_intcDispatcher.
      A2: Correct

      Q3:
      _CSL_intcDispatcher = Function of {CPUINT only}
      System_Interrupt ==> input event on CICx ==> Host Interrupt ==> eventId ==> CPUINT
      A3
      : Correct

      Q4:
      CSL_intcPlugEventHandler plugs Isr at event level, say i map event
      System_Interrupt ==> input event on CICx ==> Host Interrupt ==> eventId ==> CPUINT
      CSL_intcPlugEventHandler  = Function of {eventId, CPUINT}
      A4: Correct

      Q5. CpIntc_dispatchPlug plugs Isr to the system Interrupt itself.
      System_Interrupt
      ==> input event on CICx ==> Host Interrupt ==> eventId ==> CPUINT
      CpIntc_dispatchPlug  = Function of {System_Interrupt}

      A5: Has been explained by Judah

      - Uday

      --- If you need more help, please reply. If this answers your question, please Verify Answer below this post ---

      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 Aug 02 2012 08:04 AM
      Genius4475 points

      Hi Uday,

      Can you give the code examples for cases 3 to 5?  How would you set this up?  I am still confused because when I look at some of the code examples, they also mix in BIOS interrupt calls.  Is there some advice as to how to seperate the two?  Here is an example of two sections of code that I have been trying to compare and understand.  They are both in the SRIO example code.  It seems like the first interrupt is just set up using BIOS calls and then the other one is linked a few times and then set up in BIOS?    Which example above would match each case or are they different from the descriptions above?

      Thanks, Brandy

                      EventCombiner_dispatchPlug (49, (EventCombiner_FuncPtr)Srio_rxCompletionIsr, (UArg)drvHandle, TRUE);

                      EventCombiner_enableEvent(49);

                      hSrioCSL = CSL_SRIO_Open (0);

                      CSL_SRIO_DisableInterruptPacing (hSrioCSL, 0);

                      CSL_SRIO_RouteLSUInterrupts (hSrioCSL, 0, 0);

                      CSL_SRIO_RouteLSUInterrupts (hSrioCSL, 1, 0);

                      CSL_SRIO_RouteLSUInterrupts (hSrioCSL, 2, 0);

                      CpIntc_dispatchPlug(CSL_INTC0_INTDST0, (CpIntc_FuncPtr)myDioTxCompletionIsr, (UArg)drvHandle, TRUE);

                      CpIntc_mapSysIntToHostInt(0, CSL_INTC0_INTDST0, 8);

                      CpIntc_enableHostInt(0, 8);

                      CpIntc_enableSysInt(0, CSL_INTC0_INTDST0);

                      eventId = CpIntc_getEventId(8);

                      EventCombiner_dispatchPlug (eventId, (EventCombiner_FuncPtr)CpIntc_dispatch, 8, TRUE);

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RCReddy
      Posted by RCReddy
      on Aug 02 2012 08:39 AM
      Genius3345 points

      Hi Brandy,

                      good questions you put. even I was preparing the same questions.

      Hi Judah and Uday,

                                    Please explain the following in terms of hooking ISR's [again i repeat please tell/explain in context of ISR hooking only]

                              1. primary v/s secondary interrupts ISR handling?

                              2. BIOS v/s CSL based ISR handling?

                              3. when to use CSL functions and when to use BIOS functions?

                              4. BIOS functions before or after BIOS_start()? [if before or after, what are the consequences]

      Thanks

      RC Reddy

                               

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • judahvang
      Posted by judahvang
      on Aug 02 2012 17:03 PM
      Verified Answer
      Verified by RCReddy
      Genius16765 points

      Primary Interrupts are those that are given a GEM event (There are 128 GEM events).  These do not go through INTC.  You can hook an ISR for one of these by creating a Hwi instance and specifying the eventId.

      Secondary interrupts are those that go through INTC.  I think I've already explained that you use CpIntc APIs for configuring this and specifying your ISR handler.  Then you create a Hwi that runs the function CpIntc_dispatch() which will determine which Secondary interrupt caused the interrupt and call its ISR handler accordingly.

      In BIOS, think of your ISR just like 'C' function.  In fact, you would write your ISR as though it was just a regular 'C' function.  We save/restore context and determine what cause the interrupt and call the appropriate ISR handler.  My recommendation would be if you are using BIOS then use the BIOS ISR handling scheme also.

      Use CSL when you need to configure some piece of hardware or writing a driver...like USB, SRIO, or I2C, etc...  Use BIOS for thread processing like Hwis (interrupt), Swi, Task.

      Before BIOS_start is like the create or setup phase.  BIOS_start basically is when things really start working (Interrupts are enabled).  You threads will be running, interrupts will be happening, etc...

      Judah

      If my reply answers your question please mark the thread as answered

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BhavinKharadi
      Posted by BhavinKharadi
      on Aug 02 2012 17:46 PM
      Verified Answer
      Verified by RCReddy
      Intellectual1185 points

      Brandy,

      Here is answer for each of the questions.

      In above piece of code, you are configuring interrupts using BIOS APIs only. CSL_SRIO_xxx functions are configuring SRIO there are no BIOS functions for configuring SRIO. CSL_SRIO_xxx functions are not configuring either CICx OR Corepac Intc (so they are not configuring System Interrupt OR Host Interrupt OR EventID OR CPUINT). CSL_SRIO_RouteLSUInterrupts () function is configuring routing ICRR registers to transfer LSUx interrupt (inside SRIO) to INTDSTx (in your case  it is INTDST0). INTDST0 is system interrupt to CIC0.

      For CSL example about interrupt refer to PDK packages\ti\csl\example\cpintc.

      RCReddy,

      Here are answers for your queries:

      2. BIOS v/s CSL based ISR handling?

      3. when to use CSL functions and when to use BIOS functions?

      If your application is using SYSBIOS then you should use SYSBIOS Interrupt APIs to configure interrupts. If you are not using SYSBIOS then you should use CSL Interrupt APIs to configure interrupts. If you try to use the both interrupt functions then there will be conflicts in configuring ISTP and so errors in getting interrupts. (Brandy, you already seen this in your previous post about Timer interrupt having problem with NDK).

      For answers on questions on 1st and 4th refer to Judah’s reply.

      Regards,

      Bhavin

      interrupt
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RCReddy
      Posted by RCReddy
      on Aug 06 2012 14:30 PM
      Genius3345 points

      Hi Bhavin/Friedland/Judah,

                                                Interrupts being a major part, it comes as a surprise that no keystone training is available, whatever points discussed above can be put in a presentation. I request you to make it simple for the people to understand and also add a keystone training to the same. The bits and pieces information which came out of above discussion can be arranged and put in a document. 

      Thanks

      RC Reddy

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • BhavinKharadi
      Posted by BhavinKharadi
      on Aug 07 2012 11:20 AM
      Intellectual1185 points

      RC Reddy,

      We are in process of putting together a Wiki for the interrupts handling. We can certainly put down all above information in that.

      Regards,

      Bhavin

      Interrupts
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    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