2022-04-15 05:37 AM
e.g:
Below are the execution time of memset() function at different locations.
1. memset() plcaed at 0x0000000000219e96 : Time = 57.10 usec for 3k buffer size.
2. memset() placed at 0x0000000000219d42 : Time = 28.66 usec for 3k buffer size.
- memset is used for reference, other function timings also varies.
- We have compare and verified assembly file for above two conditions,
assembly code generated for memset functions is same.
Below are the project settings:
-----------------------------------
1. Code Memory = Flash TCM
2. Flash ART Accelerator = Enabled
3. Flash prefetch buffer = Enabled.
4. Compiler optimization = -o2.
5. Tool chain = STM32CubeIDE, gcc.
6. Clock Frequency = 216Mhz
Queries:
--------
1. Need more details on why execution timings varies with memory location.
2. How can we achieve deterministic execution time of a particular function irrespective of memory location.
2022-04-15 10:42 AM
Likely how branch/loop targets fall within cache lines vs flash lines, and how things might get evicted.
Put the code in ITCM, it's fast and not cached..
>>How can we achieve deterministic execution time of a particular function irrespective of memory location.
That might be a challenge as different memories, and different distances from the processor, cached, not cache, boundaries on underlying arrays will play into this. Plus the CM7 is super-scalar so interrupts, branch caches, and all manner of things will impact dynamic operation.
2022-04-17 11:31 PM
Hello,
Right now the complete code is placed in Flash ITCM.
we are experiencing issue of different execution timings for a function when placed at different locations within Flash ITCM memory section.
There is no cache lines for ITCM memory, so this won't create above issue.
we would like to know other possible reasons for above issue.
thanks