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.

General SRIO DirectIO Receive Questions for C6670 using LLD

Hi,

I am a new developer on a project that will incorporate a c6670 to communicate with a single external device via SRIO. I am using the SRIO LLD provided in the MCSDK/PDK and have briefly reviewed the four example SRIO projects provided. Unfortunately, none of the projects appear to implement an interrupt-based SRIO receive operation that I could use as a basis of my own design. I did have a couple questions about the driver and SRIO capabilities in general, all about receive:

1) From my study of the SRIO peripheral, to receive data via DirectIO from an external device, the external device will need to send a doorbell to the c6670 after transferring its data. Additionally, the external device will need to set the "correct" doorbell info bits for the DSP to be able to identify "which" transfer took place. Is my understanding of the peripheral's Direct IO capabilities correct? From my research, I couldn't see any method of initiating a CPU interrupt from the Direct IO receive data transfer alone.

2) There are 4 doorbell registers, with each having 16 bits. Does this mean that we can do a total of 64 "unique" DirectIO transfers? That is, I may have 64 data buffers at various locations, from the L2 spaces of the four cores to shared memory or even DDR3 external memory. Each of these 64 buffers would identify with a unique Doorbell Register and Doorbell Bit combination. Is this the intended use of the peripheral?

3) In the call to the Srio_dioCompletionIsr(hSrioDrv, intDstDoorbell) function of the SRIO LLD provided in the MCSDK, the destinations of the doorbells need to be provided to the driver because the user is able to configure doorbells to be routed to any of the 16 general purpose interrupt destinations (INTDST0 - INTDST15) or the eight dedicated doorbell destinations (INTDST16 - INTDST23), which 2 are routed to each of the c6670's four cores. The array of interrupt destinations, to which the doorbells are routed to, appears to only access 4 elements in the driver software (srio_drv.c), as it is based off the number of doorbell registers and not the number of interrupt destinations. This array of indices is used to access the SRIO decode registers. My question is: couldn't the number of doorbells routed potentially span a range of greater than 4 destinations? For example, can't the user route doorbells over the entire range of INTDST0-INTDST15, in which case the driver would need to read through 16 decode registers rather than just 4?

4) For DIO transfers, is there a way to determine how much data was transferred and the location to which the transfer occured? It looks like the Srio_sockRecv() function was intended to return the transfer size, but for the DIO situation, it looks like the value always returned is 1 byte, which was set in the call to Srio_dioCompletionIsr(). The doorbell information returned from Srio_sockRecv() looks correct, as the doorbell is properly "registered" with the socket. Also, I don't see anything in the API to reveal the details of the received data transfer, like the destination address. This is what led me to believe that the developer must map this back to the identity of the doorbell, as asked in question 2. The SRIO user's guide does make references to a potential "side-channel" that contains transfer description information (Figure 2-28 in SRIO User's Guide, sprugw1b.pdf), but I am unsure of how to access this via the LLD.

Thanks!

  • Hi LanceS,

    Different core have different doorbell number.

    If you want to use different core to receive doorbell interrupt must set different interrupt number.,

  • Hi,

    As far as I undestand, Srio LLD does not support dio read/writes, it only supports DIO doorbells. Basically it is useless for DIO.

    I did not find any way to detect DIO trasfer or its size. So we were using write + doorbell. To determine size you can use some type of header. If you have to deal with something more complecated then a stream or raw data take a look at Message passing interface (type 11).

    The port of the linux kernel for keystone devices has code (in git at least) for DIO writes and doorbells. There is implementation of ethernet over srio in it.

    good luck

  • Thanks for the responses. I thought the SRIO LLD did support read/writes as illustrated in one of the examples in the PDK (titled SRIO_LoopbackDioIsrexampleproject). I was using that example project as the basis of my own software prototyping. Unfortunately, the ISR aspect is only implemented in the transmit direction. I am interested in the receive direction.

    Are there any TI gurus available to take a look at my four questions? I believe this would be helpful to other developers, as well.

  • LanceS,

    You are correct that the SRIO peripheral does not provide a way to generate an interrupt in response to a Direct I/O operation that targets the chip.  It also does not record the destination address or size of DIO transfers.  The source and destination devices would need to establish a convention for either in-band or out-of-band descriptors for each transfer -- for example, if doorbell 0 indicates a transfer to a particular buffer, each write to that buffer might be prefixed with a 16- or 32-bit length of the useful data; or there might be two buffers, one that receives the length and one that receives only the useful data.

    The 64 doorbells can be assigned to reflect whatever notifications you want.  If you want to use them exclusively for data transfers, then yes, you could use them to indicate 64 different transfer destinations.

    The INTERRUPT_CTL register's DBLL_ROUTE bit controls whether the "legacy" interrupt destinations (INTDST0-INTDST15) or the dedicated doorbell interrupt destinations (INTDST16-INTDST23) are used -- and that bit controls routing for all doorbell interrupts.  The driver would read DOORBELL0_ICSR through DOORBELL3_ICSR because each one of those contains status for the 16 "bits" within each doorbell register, and this covers all 64 doorbells; the per-doorbell state is independent of the interrupt routing for that doorbell.

    If your application can tolerate a restriction that payloads contain N*8 bytes (1 <= N <= 256), you might look at SRIO MESSAGE packets as an alternative to DIO+doorbell.  The SRIO peripheral's RXU can generate an interrupt for each complete MESSAGE it receives, and it will record the length of the message's payload.

    Michael

  • Lance,

    (1) You are correct. The DOORBELL can be sent after sending the last packet. 

    (2) You are correct again. 

    (3) The user can route doorbells over the entire range of INTDST0-INTDST15. You should look at the SRIO UG http://www.ti.com/lit/ug/sprugw1b/sprugw1b.pdf (it has been updated since your original post)

    (4) There is a way you can check number of bytes received and it is Srio_sockRecv().  It may be just 1 when you use it, because you are using a blocked socket. You can read more about the API in your PDK under  pdk_C66xx_x_X_x_x/packages/ti/drv/srio/docs/doxygen/html


    You should also check out the KeyStone Training videos which have alot of the answers to you questions at http://learningmedia.ti.com/public/hpmp/KeyStone/11_SRIO/index.html


    Elush Shirazpour