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.

AM6548: ICSSG memory supported accesses

Part Number: AM6548

I've asked this already in the referenced thread, but since that thread is marked as answered I'm guessing that it might not get answered anymore.

I'm looking for ways to optimize the tiesc_memcpy/memset functions that come with the EtherCAT slave for the AM6548. These functions operate on 8-bit pointers only, which is of course less than optimal.

Can someone tell me which types of accesses the ICSSG memory supports? E.g. the A53 TRM says that for device type memory the ACE master will only generate:

  • INCR N (N:1, 2, or 4) 128-bit for write transfers.
  • INCR N (N:1, 2, or 4) 128-bit for read transfers.
  • INCR 1 32-bit, 64-bit, and 128-bit for read transfers.
  • INCR 1 8-bit, 16-bit, 32-bit, 64-bit, and 128-bit for write transfers.

In the referenced thread the answer was that "accesses to the ICSSG memory need to be 32-bit aligned and n*4 bytes in length to complete properly".

I briefly debugged the memset/memcpy routines that come with the A53 compiler, and it seems that the ICSSG memory is able to handle even STP q0, q0, [xN] instructions that probably generate a burst of two 128-bit writes.

What I don't know is if there are any guarantees for what the ICSSG supports, and what the interconnect does to the processor's write transactions.

Can I assume that a write of any size is safe, as long as it's aligned to 32-bit, because the interconnect (or the ICSSG memory) translates all larger transactions into 32-bit writes? Is it safe to use 16-bit writes for 16-bit aligned addresses? Is it ok to use 8-bit accesses, or does that incur any additional penalty apart from the overhead of 8-bit vs. 32-bit transfers?

The R5f guarantees that all accesses to device type or strongly ordered memory occur as 32-bit writes, even if a STRD or STM is used, so the situation should be simpler for the R5f.

Regards,

Dominic

  • Dominic,

    We've seen some potential toolchain issues when unaligned length is used as argument for memcpy/memset. Rather than byte copy included to the EtherCAT solution, using memset/memcpy for aligned address + aligned length and then byte copy only for the remainder may be the most performance-optimized solution.

    Best regards,

    Dave

  • Hello Dave,

    I'm really more interested in understanding the behaviour of the hardware than ways to work around behaviour of a particular software.

    For example we use the ICSSGs of the AM654x both from the A53 cores as well as from the R5f cores, in some instances running TI-RTOS and sometimes running Linux. We've also integrated 5 different versions of the AM65x Processor SDK RTOS since we started working on this project, with several changes in compiler versions and lots of changes in hardware configuration (e.g. R5f force-write-through being enabled at first) which certainly affect what really happens on the interconnect level when I call "memcpy()".

    Instead of a trial and error approach where I figure out which kind of hardware accesses the ICSSG memory supports I was hoping that you could explain to me what kind of accesses the ICSSG memory is expected/designed to support.

    Since the ICCSG memory probably needs to be mapped as "device type" memory (the EtherCAT slave sample maps it that way) there are going to be further restrictions, but that's something well documented by the ARM architecture and the core TRMs.

    Regards,

    Dominic

  • Dominic,

    The topology should allow for unaligned accesses to ICSSG. However, we have seen that the GCC compiler tries to optimize the memcpy and might generate an incorrect load/store if address isn’t aligned, and the A53 has restrictions on what alignments are allowed with “optimized” load/stores. 

    I would advise that for memory copies to/from the ICSSG you leverage aligned addresses for the bulk of the copy.

    Best regards,

    Dave