Applying pointer analysis to the synthesis of hardware from C
Giovanni De Micheli, Luc Séméria · 2001
With the advances in Computer Aided Design (CAD) technology, the design of digital circuits is becoming more and more as the development of software. Hardware is modeled using Hardware Description Languages (HDLs) very much as software is described using programming languages. Synthesis tools are used like compilers to map these HDL models into hardware. However, modern systems, which consist of mixed software/hardware modules, are often initially modeled using programming languages instead of HDLs. Specifically, C/C++-based languages with hardware support are used to quickly verify the functionality and estimate the performances at the system level. One of the greatest challenges in C/C++-based design methodology is to efficiently map C/C++ models into hardware. Many of the networking and multimedia applications implemented in hardware or mixed hardware/software systems are making use of complex data structures stored in one or multiple memories. As a result, many of the C/C++ features that were originally designed for software applications are now making their way into hardware. Such features include dynamic memory allocation and pointers used to manage data. In this thesis, I present a solution for efficiently mapping arbitrary C code with pointers and malloc/free into hardware. In hardware, a pointer is not only the address of data in memory, but it may also reference data mapped to registers, ports or wires. Pointer analysis is used to find the set of locations each pointer may reference in a program at compile time. The values of the pointers are then encoded, and branching statements are used to dynamically access data referenced by pointers. Dynamic memory allocation and deallocation are supported by instantiating hardware memory allocators tailored to an application and a memory architecture. Several optimizations may also be performed. A heuristic algorithm is presented to efficiently encode the values of the pointers. Compiler techniques may also be used to reduce storage before loads and stores. An implementation using the SUIF compiler framework is presented, followed by some examples of implementations taken from multimedia and networking applications.