Compilation of Matlab to Process Networks (Compaan)
Compaan is an effort to automatically compile a subset of imperative programs into a concurrent representation. Compaan uses Matlab language as the imperative language and compiles programs in this language into a concurrent representation: a particular version of Process Networks.
The compaan work is motivated by the advent of a new kind of embedded architectures that is composed of a microprocessor, some memory, and a number of dedicated coprocessors that are linked together via some kind of programmable interconnect. These architectures are devised to be used in real-time, high-performance signal processing applications. Thy have in common that they exploit parallelism using instruction level parallelism offered by the microprocessor and coarse-grained parallelism offered by the coprocessors. Given a set of applications, the hardware/software codesign problem is to determine what needs to execute on the microprocessor and what on the coprocessors and furthermore, what should each coprocessor contain, while being programmable enough to support the set of applications.
Compaan tries to provide a tool that can help designers in answering this tough question of how to partition an application into hardware and software candidates. A motivation why Process Networks are a good match for these new embedded architectures can be found in
kienhuis et at. [2000]. Compaan consists of three different tools, which are shown here below.

The three tools are:
MatParser.
MatParser is a sequential to parallel compiler. It extracts all available parallelism present in a Matlab description. The Matlab however needs to be confined to a particular type called Nested Loop Programs. MatParser uses a very advance parametric integer programming (PIP) technique to find all available parallelism in terms of the parameters of the original program.
DgParser
DgParser converts a single assignment program, generated by MatParser, into a Polyhedral Reduced Dependence Graph (PRDG) representation. A PRDG representation is much more amenable to mathematical manipulation.
Panda.
Panda transforms the PRDG description of an algorithm into a network of parallel running Processes, the desired Kahn Process Network. This tool uses the Polylib library extensively. Using Polylib, Panda can generate Ehrhart polynomials that give a symbolic expression for the number of integer points available in arbitrary polyhedra. The conversion from the PRDG to a Process Network happens in three steps; domain scanning, domain reconstruction and linearization.
The process networks that are being created by Compaan need to be made accessible in some kind, such that it can be simulated and analyzed. We use the Ptolemy II framework, developed at UC Berkeley. We make a process network available in the PN-domain. Compaan generates the network description in MoML, which is a modeling markup language based on XML used in Ptolemy II for specifying interconnections of parameterized components. The process generation step in this case, generates the Ptolemy II actors in the PN-domain. A MoML description can be executed as an application using a command-line interface or as a visual rendition in the Ptolemy II block diagram editor Vergil.
Two examples will show screen dumps of PN networks in Ptolemy II.
The Ptolemy II framework enables us to combine the derived process network descriptions with predefined actors like sources to read Matrices and sinks to read and visualize Matrices. It also let us combine process networks with other domains, enabling the description and simulation of more complex systems.
Achievements
Achievements in MatParser, DgParser, and
Panda
Publications/Presentations
- Presentation at the Workshop for Compiler and Architecture Support for Embedded Systems, Washington October 1-3, 1999. See the following link for
Slides presented at the workshop.
Edwin Rijpkema, Bart Kienhuis and Ed F. Deprettere, ``Compilation from Matlab to Process Networks'', Presented at the Second International Workshop on Compiler and Architecture Support for Embedded Systems (CASES'99), October 1-3 1999, Washington.
Bart Kienhuis, Edwin Rijpkema, and Ed F. Deprettere, ``Compaan: Deriving Process Networks from Matlab for Embedded Signal Processing Architectures.'', Presented at the 8th International Workshop on Hardware/Software Codesign (CODES'00), May 3 -- 5 2000, San Diego. CA. Slides are also available.
Bart Kienhuis, ``MatParser: An array dataflow analysis compiler.'', Technical Report UCB/ERL M00/9.
Ed F. Deprettere, Edwin Rijpkema, Paul Lieverse and Bart Kienhuis, "``High Level Modeling for Parallel Executions of Nested Loop Algorithms'', IEEE International Conference on Application-specific Systems, Architectures and Processors (ASAP'2000), July 10 -- 12 2000, Boston Massachusetts, USA.
People Involved
Bart Kienhuis (GSRC, UCB): MatParser, Ptolemy Interface
Edwin Rypkema (TU Delft): Panda, SBFsim
Ed Deprettere (Leiden University)
Ning Zhang (BWRC, UCB): Provides the algorithms for PicoRadio.
Related Links
- The software used in the Compilation from Nested Loop Programs written in Matlab to relays heavily on tools from the Integer Linear Programming domain. Another GSRC website is a discussion form about these tools. Have a look at the CASES page for more information.
- Part of this work is related to the Jacobium Processor project at Delft University. Have a look at the Jacobium web page.