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.
Tool/software: Code Composer Studio
Hello,
I studied 3 example projects of SRIO:
example a) SRIO_LpbkDioIsr_evmc6678_C66BiosExampleProject
example b) SRIO_Loopback_evmc6678_C66BiosTestProject
example c) SRIO_TputBenchmarking_evmc6678_C66TestProject
I designed an application using example c which operates in polling mode. In my application, I use only one core of c6678 and I send packets and receive them on same core.
I can send DIO packets (such as NWRITE and NREAD) as well as message passing on polling mode.
Now, I want to send some NWRITE/NREAD packets using SOCKET_A and receive them using SOCKET_B (in same core). After that, for showing end of transmission, I want to send doorbell packets and receive them in interrupt mode.
My questions are:
1- Can I send/receive DIO packets (such as NWRITE and NREAD) in polled mode while send/receive doorbell packets in interrupt mode?
2- In DIO packets, when I want use polled mode (or interrupt mode), should both send and receive operates in polled mode ( or interrupt mode)? Is it possible both send and receive operates in different modes?
3- If I want send doorbell packets and receive them in interrupt mode, should I program the accumulator? or accumulator is used only to receive message passing packets?
4- I want to send doorbell packet on SOCKET_A and receive it on SOCKET_B in interrupt mode (while SOCKET_A and SOCKET_B are in same core) . Is it possible? If yes, what should I do to setup doorbell interrupts? Is there any example code for doorbell interrupts?
Best Regards,
Mohammad
Mohammad,
Polled or interrupt mode should be applicable to packet receive only.
If the DIO packets and doorbell packets are from different sockets, you should be able to receive in mixed mode.
Accumulator is not applicable to doorbell/DIO packets.
Yes, it's possible to send doorbell packet on SOCKET_A and receive it on SOCKET_B in interrupt mode. Please refer to srio_dio_tput.c in SRIO_TputBenchmarking_evmc6678_C66TestProject and the API:
void Srio_dioCompletionIsr (Srio_DrvHandle hSrioDrv, uint8_t intDstDoorbell[])
Regards,
Garrett
Hi Garrett Ding,
At first, I shall thank you for your answer.
I studied SRIO_TputBenchmarking_evmc6678_C66TestProject example.
- - - - - - - - - -
A) In this example, Routing of the Doorbell interrupts is as follow:
#if 0 /* Set the Doorbell route to determine which routing table is to be used * This configuration implies that the Interrupt Routing Table is configured as * follows:- * Interrupt Destination 0 - INTDST 16 * Interrupt Destination 1 - INTDST 17 * Interrupt Destination 2 - INTDST 18 * Interrupt Destination 3 - INTDST 19 */ CSL_SRIO_SetDoorbellRoute (hSrio, 0); #else /* Set the Doorbell route to determine which routing table is to be used * This configuration implies that the Interrupt Routing Table is configured as * follows:- * Interrupt Destination 0 - INTDST 0 * Interrupt Destination 1 - INTDST 1 * Interrupt Destination 2 - INTDST 2 * Interrupt Destination 3 - INTDST 3 */ CSL_SRIO_SetDoorbellRoute (hSrio, 1); #endif /* Route the Doorbell interrupts. * Doorbell Register 0 - All 16 Doorbits are routed to Interrupt Destination 0. * Doorbell Register 1 - All 16 Doorbits are routed to Interrupt Destination 1. * Doorbell Register 2 - All 16 Doorbits are routed to Interrupt Destination 2. * Doorbell Register 3 - All 16 Doorbits are routed to Interrupt Destination 3. */ for (i = 0; i < 16; i++) { CSL_SRIO_RouteDoorbellInterrupts (hSrio, 0, i, 0); CSL_SRIO_RouteDoorbellInterrupts (hSrio, 1, i, 1); CSL_SRIO_RouteDoorbellInterrupts (hSrio, 2, i, 2); CSL_SRIO_RouteDoorbellInterrupts (hSrio, 3, i, 3); }
- - - - - - - - - -
B) Also, interrupts registration is as follow:
/* Hook up the interrupts if using interrupt mode. */ if (!srio_usePolledMode) { /* Hook up the SRIO interrupts with the core. */ EventCombiner_dispatchPlug (48, (EventCombiner_FuncPtr)Srio_rxCompletionIsr, (UArg)hAppManagedSrioDrv, TRUE); EventCombiner_enableEvent (48); /* SRIO DIO: Interrupts need to be routed from the CPINTC0 to GEM Event. * - We have configured DIO Interrupts to get routed to Interrupt Destination 0 * (Refer to the CSL_SRIO_SetDoorbellRoute API configuration in the SRIO Initialization) * - We want this to mapped to Host Interrupt 8 * * Map the System Interrupt i.e. the Interrupt Destination 0 interrupt to the DIO ISR Handler. */ CpIntc_dispatchPlug(CSL_CIC0_SRIO_INTDST0, myDIOIsr, (UArg)hAppManagedSrioDrv, TRUE); /* SRIO DIO: Configuration is for CPINTC0. We map system interrupt 112 to Host Interrupt 8. */ CpIntc_mapSysIntToHostInt(0, CSL_CIC0_SRIO_INTDST0, 8); /* SRIO DIO: Enable the Host Interrupt. */ CpIntc_enableHostInt(0, 8); /* SRIO DIO: Get the event id associated with the host interrupt. */ eventId = CpIntc_getEventId(8); /* SRIO DIO: Plug the CPINTC Dispatcher. */ EventCombiner_dispatchPlug (eventId, CpIntc_dispatch, 8, TRUE); /* Debug Message */ System_printf ("Debug: Interrupts Registration complete\n"); }
- - - - - - - - - -
C) Function myDIOIsr( ) is as follow:
void myDIOIsr(UArg argument) { uint8_t intDstDoorbell[4]; /* The Interrupt Destination Decode registers which need to be looked into. * Please refer to the SRIO Device Initialization code. */ intDstDoorbell[0] = 0x0; intDstDoorbell[1] = 0x1; intDstDoorbell[2] = 0x2; intDstDoorbell[3] = 0x3; /* Pass the control to the driver DIO ISR handler. */ Srio_dioCompletionIsr ((Srio_DrvHandle)argument, intDstDoorbell); return; }
- - - - - - - - - -
My questions are:
Q1- If I use above codes for doorbell in interrupt mode, does it work for my application?
Q2- If I want to use "Interrupt Destination 0 -> INTDST 16" for doorbell, what is the exact codes to use instead of codes which I mention them in part B? Are the following steps true?
Step A:
* Interrupt Destination 0 - INTDST 16 * Interrupt Destination 1 - INTDST 17 * Interrupt Destination 2 - INTDST 18 * Interrupt Destination 3 - INTDST 19 */ CSL_SRIO_SetDoorbellRoute (hSrio, 0);
Step B:
// for doorbell interrupt which is one of the CorePac primary interrupts EventCombiner_dispatchPlug (20, (EventCombiner_FuncPtr)myDIOIsr, (UArg)hAppManagedSrioDrv, TRUE); EventCombiner_enableEvent (20);
Q3- Should I change function myDIOIsr( )?
Q4- Both sockets should be in blocking mode?
Q5- Is there any approach in CCS to see when events accrued and related functions such as myDIOIsr run in the system? (Such as using Breakpoint or UIA or graphical approaches)
Best Regards,
Mohammad