hi,
could you help me please.
my environment consist of
- PPC 7448
- FreeScale “CodeWarrior Development Studio for PowerQUICC v8.8”. con optimization level = 4
- NO operating system, only my algorithm.
1 )I use CodeWarrior optimization level = 4.
which are the compiler options applied?
2)in my context no operating system no interrupt only algorithm.
to optimize the cache use what is the best way? using the prefetch instructions (dcbt, dcbtst) or using the gnu compiler options -fprefetch-loop-arrays.
3) if I use both together (dcbt, dcbtst) and options -fprefetch-loop-arrays, which may be the possible problems?
4) which are the best cache model for me?
regards stefano
Solved! Go to Solution.
1.
Please, refer to CW documentation "Power Arch Buid Tools Reference.pdf" page 97: Command-Line Options for Optimization -O+
2.
These are similar options. The only difference is that with -fprefetch-loop-arrays compiler options (dcbt, dcbtst) instructions are utilized by the compiler automatically.
3.
"Using prefetches can have negative effects, because there are costs associated with data prefetch instructions. These include wasting bandwidth, kicking other data out of the cache and causing additional conflict misses, consuming slots for memory instructions, and increasing code size, which can bump useful instructions out of the instruction cache.
Similarly, prefetching data that is already in the cache increases overhead without providing any benefit. Data might already be in the cache if it is in the same cache line as data already prefetched, or if the data has been used recently."
Using both techniques at the same time is not reasonable. Manual optimization could provide an advance but it requires deep knowledge of the processor architecture and the result might be platform dependent. I think, the manual optimization can be used as the last step of the software development and should be only used in critical places based on the performance profile.
To improve portability, it is reasonable to keep optimized code in libraries. For example, memory copy routines are good targets for manual optimization. For example:
BTW. The similar optimization are used in CW runtime library __mem.c with the option USE_FAST_MEMCPY.
4.
Cache write-back mode provides the best performance improvement and should be used unless there are specific requirments for target memory (I/O memory, multi-processor coherency...).
Have a great day,
Pavel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
1.
Please, refer to CW documentation "Power Arch Buid Tools Reference.pdf" page 97: Command-Line Options for Optimization -O+
2.
These are similar options. The only difference is that with -fprefetch-loop-arrays compiler options (dcbt, dcbtst) instructions are utilized by the compiler automatically.
3.
"Using prefetches can have negative effects, because there are costs associated with data prefetch instructions. These include wasting bandwidth, kicking other data out of the cache and causing additional conflict misses, consuming slots for memory instructions, and increasing code size, which can bump useful instructions out of the instruction cache.
Similarly, prefetching data that is already in the cache increases overhead without providing any benefit. Data might already be in the cache if it is in the same cache line as data already prefetched, or if the data has been used recently."
Using both techniques at the same time is not reasonable. Manual optimization could provide an advance but it requires deep knowledge of the processor architecture and the result might be platform dependent. I think, the manual optimization can be used as the last step of the software development and should be only used in critical places based on the performance profile.
To improve portability, it is reasonable to keep optimized code in libraries. For example, memory copy routines are good targets for manual optimization. For example:
BTW. The similar optimization are used in CW runtime library __mem.c with the option USE_FAST_MEMCPY.
4.
Cache write-back mode provides the best performance improvement and should be used unless there are specific requirments for target memory (I/O memory, multi-processor coherency...).
Have a great day,
Pavel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
thanks fo th answers
I have other questions for you,
could you help me?
thanks fo th answers
I have other questions for you,
could you help me?
1)
On MPC7448 What are the tools that Code Composer provide us to make a code profiling (using PERFORMANCE MONITOR registers).
2)
On MPC7448 Is possible via system exception capture, get the below informations.
-Processor.overload
- Arithmetic overflow
- Illegal program instruction
- Memory corruption
regards
Stefano