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.

PROCESSOR-SDK-AM64X: M4F MSRAM access time

Part Number: PROCESSOR-SDK-AM64X
Other Parts Discussed in Thread: TMDS64EVM

Hi Support,

I have a project where M4F needs to access MSRAM memory periodically.

I have experienced approximately 260ns of MSRAM reading time. It is measured by setting MCU_GPIO pin at the beginning of MSRAM read and cleared at completing the reading.

I have 2 questions related to this experience:

  • what is the M4F - MSRAM access time? It is running via MCU_CBASS that runs at 200MHz (am I right?), so I would expect less time.
  • maybe M4F MCU_GPIO access time has some effect on the 260ns but according to my experience if I run GPIO SET/CLEAR in a loop then its update period in 20ns (or less) range.

Peter

  • Hi,

    some additions to the initial post:

    • SDK version_ mcu_plus_sdk_am64x_08_06_00_43
    • CCS: 12.3
    • TMDS64EVM board
    • D6 pin is observed with the probe
    • CCS project in Release mode

    Regards, Peter

  • Hello Peter,

    maybe M4F MCU_GPIO access time has some effect on the 260ns but according to my experience if I run GPIO SET/CLEAR in a loop then its update period in 20ns (or less) range.

    Yes, I agree with your point. When you are testing with GPIO pins, definitely will be added GPIO latency.

     

    Instead of using GPIO_pinWriteHigh functions, directly write in to Register. This way, we can reduce the function stack time.

    You can also use the timer method. Based on these two experiments, we will collect data.

    /*Sample Code */

    CycleCounterP_reset();
    txStartTicks = CycleCounterP_getCount32();
    Flash_nandGpmc_cacheRead(gFlashHandle[CONFIG_FLASH0], curOffset, dstAddr, chunkSize);
    txStopTicks = CycleCounterP_getCount32();
    Final_Ticks_Cache = txStopTicks - txStartTicks;

    May I know how many bytes you are reading?

    If you are reading 32 bits, measuring time might be difficult. So, you can try to read some bytes of data and see how much time you are taking and don't use any for loops directly assign MSRAM memory values in to M4F Memory .

    I can get the details from my team for how long M4F takes to read MSRAM data.

    Regards,

    S.Anil.

  • Hi,

    i am using direct GPIO register control, no GPIO_pinWriteHigh function is used.

    May I know how many bytes you are reading?

    32 bits at a time

    don't use any for loops directly assign MSRAM memory values in to M4F Memory

    what you mean "directly assign"?

    Basically GPIO update time is quite low (~20ns?).

    Can you please confirm if I assert a write to the MCU_GPIO data out register than it takes the output pin approx 20ns to be updated?

    You can also use the timer method. Based on these two experiments, we will collect data.

    /*Sample Code */

    CycleCounterP_reset();
    txStartTicks = CycleCounterP_getCount32();
    Flash_nandGpmc_cacheRead(gFlashHandle[CONFIG_FLASH0], curOffset, dstAddr, chunkSize);
    txStopTicks = CycleCounterP_getCount32();
    Final_Ticks_Cache = txStopTicks - txStartTicks;

    is the CCS built-in cycle counter is equivalent with the method shown above?

    I just simply reset the counter by double clicking on it and read the value at the next breakpoint .

    Peter

  • Hello Peter,

    Please see my answers below .

    what you mean "directly assign"?

    You're doing things correctly. I am saying that instead of using any functions to control GPIO pins, use the registers to control ON and OFF. So, you're already doing it this way.

    Can you please confirm if I assert a write to the MCU_GPIO data out register than it takes the output pin approx 20ns to be updated?

    Currently, I don't have data on this for AM64X.

    Long ago, I tested controlling the ON and OFF of a GPIO pin on the M4 core in the AM62X but not in the AM64X.

    Test Method:

    1. I'm controlling the GPIO pin continuously, turning it ON and OFF while (1)
    2. No functions are used in the test code to control the GPIO PIN and directly write values into the GPIO register.
    3. MCU M4 runs at 400 MHz.
    4. The MPU area setting is strongly ordered.

    Results :

    M4 takes 43 ns to turn the GPIO pin on and 57 ns to turn the GPIO off.

    I am thinking that the same results would be applicable to AM64X, and I hope you are trying to control MCU_GPIO pins on M4F only.

    CycleCounterP_reset();
    txStartTicks = CycleCounterP_getCount32();
    Flash_nandGpmc_cacheRead(gFlashHandle[CONFIG_FLASH0], curOffset, dstAddr, chunkSize);
    txStopTicks = CycleCounterP_getCount32();
    Final_Ticks_Cache = txStopTicks - txStartTicks;

    Here, you can measure performance by using a Cycle timer.

    In your application, you can try the steps below to measure timing.

     

    Ex : 

    #define MSRAM_ADDRESS 0x7000000

    uint32_t Data = 0;

    uint32_t txStartTicks = 0U; uint32_t txStopTicks = 0U; uint32_t Final_Ticks = 0U;

     

    CycleCounterP_reset();

    txStartTicks = CycleCounterP_getCount32();

    Data = * ( (uint32 *)MSRAM_ADDRESS ) ;

    txStopTicks = CycleCounterP_getCount32();


    Final_Ticks = txStopTicks + txStartTicks;

     

    To convert a counter to time, you can follow the steps below.

    Time =  Final_Ticks * ( 1 / CPU operating frequency )

    Let's say you have the Final Ticks count values of 20 and the M4F CPU operating frequency is 400 MHz.

    Time = (1/400M) * 20

    For more details about the Cycle timer, please go through the below link.

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/latest/exports/docs/api_guide_am64x/KERNEL_DPL_CYCLE_COUNTER_PAGE.html

    I got the information from my colleagues and confirmed that we have around 360 ns latency time when M4F is reading 4 bytes of data from MSRAM memory.

    I hope this will be helpful .

    Regards,

    S.Anil.