Memory access tracing is a key step in optimizing the data allocation for software/hardware co-optimization on size, weight and power limited embedded chip multiprocessor (CMP). However, how to obtain the memory access trace of a program using SimpleScalar is a big and basic question.
I have sent three emails to different researchers to investigate the answer to this question, however, the emails like a stone in water. Having struggled about several days, I have finally successfully answered this question by myself.
The sim-profile tool provided by SimpleScalar has laid the foundation for analyzing the memory access trace of the program. Based on the source code of sim-profile and SimpleScalar, the researcher can easily modify it so as to adapt it to meet specific requirements.
While analyzing the memory access tracing, there may be two requirements, i.e., analyzing the memory access trace of a specific section of the program, e.g., one function, a while loop, etc., obtaining the read and write number of the memory and the space locality of the memory.
To meet the first requirement, the method is proposed by Shao-Liang Peng, i.e., modifying the source code in syscall.c of SimpleScalar. This method is proposed based on the architecture of SimpleScalar. Shao-Liang Peng observed that SimpleScalar uses functions in syscall.c to broke the function of the system call of Linux. Hence, by using specific system calls in the program, it is possible to notify the sim-profile when a specific section of the program starts and ends. Hence, by analyzing the output of sim-profile the user is able to collect the memory access trace of a specific section of the program.
To meet the second requirement, the user has to modify the main function in sim-profile.c so as to make the profiler output the memory access trace. The key is detecting and disassembling the memory access instruction. To do it, the user is recommended to refer to the instruction set architecture of the processor.
本文详细介绍了如何使用SimpleScalar工具进行内存访问跟踪,包括修改syscall.c源代码以跟踪特定程序段的内存访问,以及调整sim-profile.c以输出详细的内存访问信息。作者通过自己的实践,解决了在嵌入式CMP上进行软件硬件协同优化的关键问题。
1634

被折叠的 条评论
为什么被折叠?



