Flexible code generation framework for the design of ASIPs
The framework is built on a library of modules, each one implements
a compilation pass such as code selection, resource allocation or scheduling
and is individually flexible. It thus allows flexibility at two levels:
To build a compiler for a target processor, the user selects modules from the library, and links them together as illustrated in the figure above, where the evaluation and comparison of two compilation flows is proposed.. The first one achieves sequentially code selection and register allocation followed by compaction. The second one uses three other modules and a different scheduling.
Although these two examples illustrate the use of standard compilation
flows, more sophisticated modules may exist and implement complex algorithms,
mixing, for instance, compaction and resource allocation. Additionally,
the user may build iterative flows, where some modules execute several
times, until result is satisfied.
In order to experiment with such a structure, we focused on the
use of existing tools as components of the framework. Concerning instruction
selection, although many accurate algorithms appeared recently, available
tools are mainly restricted to standard algorithms based on tree matching.
As a consequence, the Olive
code generator generator was chosen. Concerning code optimizations, we
did experiments with the Salto
framework and the SPAM
library . Salto is a tool for assembly code restructuring, and Spam is
dedicated to code optimization for DSP. Both are built following the structure
described in , with a code representation, some tool kit equivalent components
and an algorithmic level. Experiments have underlined qualities and
limitations of both tools in the domain of design space exploration.