Title :
Compact and efficient code generation through program restructuring on limited memory embedded DSPs
Author :
Rele, Siddharth ; Jain, Vipin ; Pande, Santosh ; Ramanujam, J.
Author_Institution :
Dept. of Electr. & Comput. Eng. & Comput. Sci., Cincinnati Univ., OH, USA
fDate :
4/1/2001 12:00:00 AM
Abstract :
Many embedded systems such as digital cameras, digital radios, high-resolution printers, cellular phones, etc., involve a heavy use of signal processing and are thus based on digital signal processors (DSPs). DSPs such as the TMS320C2x and the DSP5600x have irregular data paths that typically result due to application specific needs (such as chaining multiply-accumulate operations, etc.). Efficient code generation for such embedded DSP processors is a challenging problem. The stringent requirements such as tight memory constraints and fast response time result in the need for a compact and efficient code. In this paper, we address the problem of generating a compact and efficient code for embedded DSP processors. Most of the DSP instruction set architectures (ISAs) feature intrainstruction parallelism (IIP), enabling individual operations to be executed in parallel by generating a complex instruction. A reduction in generated code size and improved performance can be achieved by exploiting this parallelism present in such ISAs. In this paper, we present a code restructuring technique to fully exploit this parallelism through maximal utilization of the complex instructions present in the instruction set. We formulate this as a maximal benefit code restructuring problem, which is to derive the arrangement of statements to maximally exploit IIP without violating data dependencies. This problem is equivalent to the precedence constrained Hamiltonian path problem for directed acyclic graphs and the traveling salesman problem in general, both of which are NP-hard. In this paper, we present an optimal algorithm to solve the problem. We have implemented this optimal algorithm in a compiler targeted to generate code for the TMS320C25 DSP. We tested our framework on a number of benchmarks and found that the performance of the generated code (measured in dynamic instruction cycle counts) improves by as much as 9.9% with an average of 4%. The average code-size reduction over code compiled without exploiting parallelism is 2.9%. We also studied the effect of loop unrolling on the available IIP. An on-chip instruction cache can be effectively utilized by unrolling loops such that generated code fully occupies the memory. The benefit is reduction in dynamic instruction count due to the higher number of complex instructions generated. We found that by unrolling loop by four times to fit available on-chip instruction cache, the dynamic instruction counts reduce by as much as 9.9 %
Keywords :
cache storage; digital signal processing chips; directed graphs; instruction sets; parallel architectures; TMS320C25; average code-size reduction; benchmarks; cellular phones; code generation; digital cameras; digital radios; digital signal processors; directed acyclic graphs; dynamic instruction count; dynamic instruction cycle counts; embedded DSPs; high-resolution printers; instruction set architectures; intrainstruction parallelism; irregular data paths; loop unrolling; multiply-accumulate operations; on-chip instruction cache; precedence constrained Hamiltonian path problem; program restructuring; response time; tight memory constraints; traveling salesman problem; Cellular phones; Digital cameras; Digital communication; Digital signal processing; Digital signal processors; Embedded system; Instruction sets; Memory management; Printers; Signal processing algorithms;
Journal_Title :
Computer-Aided Design of Integrated Circuits and Systems, IEEE Transactions on