用C语言编写DSP软件时,优化设计尤为重要。近年来提出了多种针对DSP代码生成阶段的偏移分配优化算法,这些算法通过调整局部变量在存储器中的布局来提高变量地址的计算效率。该文提出一种将微粒群算法与遗传算法相结合的算法(类PSO算法),对变量访问序列中各变量地址的分配进行优化,使计算地址所需的代码数量最小,从而减少程序的运行时间,提高DSP的工作效率。
Optimal design is significant when the DSP software is designed by C programming language. A number of different algorithms for optimized offset assignment in DSP code generation are developed recently, which aim at constructing a layout of local variables in memory, so that the addresses of variables can be computed efficiently. This paper presents a quasi-PSO optimization algorithm integrating PSO algorithm and genetic algorithm. The address assignment of each variable in the variable access sequence is optimized to maximize the use of auto-increment operations on address registers. This method minimizes the needed code for address computation, so as to maximize code speed and efficiency of DSP.