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.

Hwi_eventMap Parameters

Hi.

I wonder if anyone knows the answer to this question about Event Combiner and Hwis.

Why in the majority of the examples do we see:

EventCombiner_dispatchPlus(eventId, someFunction, someParam, aBool);

EventCombiner_enableEvent(eventId);

Hwi_eventMap(8, eventId);

Hwi_enableInterrupt(8);

 

And yet in nimu_eth.c in PDK 1.0.0.11 NDK Transport driver, we see

EventCombiner_dispatchPlus(eventId, someFunction, someParam, aBool);

EventCombiner_enableEvent(eventId);

Hwi_eventMap(7, eventId >> 5);

Hwi_enableInterrupt(7);

 

Why is the event ID right shifted by 5 (divide by 32) in this instance and not the others? It seems to work (as far as I can tell). Is it something to do with HWI 7 as opposed to HWI 8?

 

  • Hi Simon --

    I think the 2nd one (the one from the PDK) is correct.  Can you give info on where you see the first usage?  This looks wrong to me.

    The EventCombiner is is a hardware mux that muxes 32 interrupts into a single output event which is routed to the CPU.   There are 128 events that are grouped into 4 sets of 32.  These are manged by 4 different event combiners.   The output event id for each combiner is 0, 1, 2, 3.  So, right shift of 5 does divide by 32 and yield 0 for (0-31), 1 for (32-63), etc.  The CPU can only handle 12 interrupt inputs, so the event combiner is used to enable more than 12 interrupts in the system.   Hwi_eventMap is used to route the output of the event combiner (0-3) to one of the CPU interrupts.

    -Karl-

  • Hi Karl,

    Thanks for that additional explanation. Make more sense now.

    I see now how to (for example) map high priority queue (on a C6670) on DSP EventId 48 to say HWI 8 using "Hwi_eventMap(8, 48>>5);".

    But if Hwi_eventMap call connects the event ID into the event handle int routine, what are the four lines from the CFG file doing? The lines:

    ECM.eventGroupHwiNum[0] = 7;

    ECM.eventGroupHwiNum[1] = 8;

    ECM.eventGroupHwiNum[2] = 9;

    ECM.eventGroupHwiNum[3] = 10;

    Is the case that the assignment of the Hwi_eventMap must marry with these lines in the CFG file? For example eventId is mapped to HWI 8 because its in the range 32-64, but DSP eventID 102 must be mapped to HWI 9, and DSP eventId 15 must be mapped to HWI 7?

    Karl Wechsler said:
    Can you give info on where you see the first usage?

    With regard to the locations of event IDs being used "as is" in the examples, I refer to the Driver examples (from C6670 PDK 1.0.0.11 - I realise there is a later version of the MCSDK for C6670):

    • bcp/example/bcp_lte_dl.c : line 4775
    • bcp/test/test_lte_dl.c : 4778
    • fftc/example/multicore/multicore.c : 280
    • fftc/test/test_mono_singlecore.c : 98
    • fftc/test/test_mono_singlecore_psinfo.c : 98
    • fftc/test/test_multicore.c : 102
    • fftc/test/test_singlecore.c : 98
    • fftc/test/test_singlecore_psinfo.c : 98
    • srio/example/sriomulticoreloopback/multicoreloopback.c : 642

    The last one, the SRIO is the point from which I started, as I am working predominatly with SRIO. But in integrating with the NDK stack I noticed the discrepency.

    Interestingly, in the PA driver, the example code in "example/emacExample/cppi_qmss_mgmt.c:556" actually says that it is mapping eventId 48 to Hwi to (eventId/32). So that tends to agree with your assertion.

    Simon.