Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: ECPY_configure is slow + what does ECPY_directConfigure do?

$
0
0

Hi Ralph,

1) As for the benefits of inlining: I am not sure what you are measuring, but you should consider this high-performance feature when you are submitting DMA transfers very frequently. Say, 10,000 ECPY transfers submitted per-second type situation. Inlining only saves several cycles per ECPY function call, so that you go in and configure hardware, set up and start the DMA transfer as quickly as possible. As for the actual DMA transfers, it doesn't matter whether you used inlined ECPY functions or directly programmed the registers in assembly, etc., you would still get the same performance for the physical DMA transfer.

Additionally, if you just submit a transfer and then immediately wait for the transfer to complete, essentially block until the transfer finishes, again your performance is still dictated by the physical DMA transfer, the ECPY API call overhead is noise and not the bottleneck. Ideally you submit a DMA transfer, and while transfer is taking place in the background the CPU is free to do other meaningful computations in paralled with the background DMA, and when you call ECPY 'wait' the transfer has just completed.

I am sure that if you were just profiling the ECPY calls, you would see reduced cycles when inlined, but for your whole program this may or may not be significant depending on how frequently and when you call these functions.

2) I notice that when you configure transfers in UNIVERSAL_ECPY_TI_queue()

    queueCount++;   // >0 always

    if(queueCount > queueStartMax)  // Will only ever be 1 greater.
    {
        p.transferType = ECPY_1D1D;
        p.dstAddr = (void *)dst;
        p.srcAddr = (void *)src;
        p.elementSize = size;   // Number of bytes.
        p.numElements = 1;
        p.numFrames = 1;
        ECPY_directConfigure(dmaHandle0, &p, queueCount);
        queueStartMax = queueCount;
    }
    else
    {
        // Just need to configure these.
        ECPY_directConfigure32(dmaHandle0, ECPY_PARAMFIELD_DSTADDR, (unsigned int)dst, queueCount);
        ECPY_directConfigure32(dmaHandle0, ECPY_PARAMFIELD_SRCADDR, (unsigned int)src, queueCount);
        ECPY_directConfigure16(dmaHandle0, ECPY_PARAMFIELD_ELEMENTSIZE, size, queueCount);
    }

(a) when  (queueCount > queueStartMax) you are doing a partial configuration of the transferNo=queueCount. u Remeber that, partial configuration only works after you have done a full configure once. I am not sure where you did that.

(b) when queueCount == 1 with direct APIs you always need to do a full-configure.

Finally, the API reference is part of the framework components release documentation, that is what I was referring to. It lists the type of pre/post conditions when using these APIs.

good luck,

Murat


Viewing all articles
Browse latest Browse all 25965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>