C6000 Program Optimization Process and Method
[Copy link]
C6000 Software Development Process
Figure 1 is a software development flow chart for C6000. The shaded part in the figure is the normal process of developing C code, and the other parts are used to assist and accelerate the development process.
The C/C++ source file is first converted into C6000 assembly source code by the C/C++ compiler (C/C++cornpiler). The compiler, optimizer and overlay tool are the components of the C/C++ compiler. The compiler allows users to complete compilation, assembly and linking in one step; the optimizer adjusts and modifies the code to improve the efficiency of the C program; the overlay tool overlaps the C/C++ statements with the corresponding assembly statements.
The assembly source code is then translated into a machine language target file by the assembler. The machine language is based on the Common Object File Format (COFF). The
linker connects the target files to generate an executable file. It must complete address relocation and resolve external references.
After obtaining the executable file, it can be debugged. The software simulator can be used to accurately simulate the instructions and running time on the PC; the XDS hardware simulator can be used to debug on the target board.
After debugging, it can be downloaded to the target board for independent operation.
3 Program Optimization Process and Methods
3.1 Program Optimization Phase
Due to the complexity of DSP applications, when using C language for DSP software development, the algorithm is usually simulated on a PC or workstation based on a general-purpose microprocessor, and then the C program is transplanted to the DSP platform after the simulation passes.
Therefore, the DSP software development and optimization process is mainly divided into three stages: C code development stage; C code optimization stage; manual assembly code rewriting stage. As shown in Figure 2.
In Figure 2, the first stage: users without C6000 knowledge can develop their own C code, and then use the code analysis tool in CCS to determine the inefficient sections that may exist in the C code, preparing for further code optimization. The second stage: C code optimization stage. In this stage, the intrinsics function and compiler compilation options are mainly used to improve the performance of the code. After optimization, the efficiency of the code is checked using a software simulator. If the expected efficiency is still not achieved, the third stage is entered. The third stage: write linear assembly optimization. In this stage, the user extracts the most time-consuming code, rewrites it in linear assembly, and then uses the assembly optimizer to optimize the code. When writing linear assembly for the first time, pipelines and register allocation can be ignored. Then, improve the performance of linear assembly code and add more details to the code, such as allocating registers. Since this stage takes more time than the second stage, the optimization of the entire code is completed in the second stage as much as possible, and linear assembly code optimization is used less.
|