3.5. The Impulse C Programming Model
The Impulse C programming model used in this book is a communicating sequential process model intended for streams-oriented, mixed hardware/software applications. These applications are becoming quite common and represent a large percentage of the computationally intensive problems requiring hardware acceleration. Examples of such applications are found in many domains, including image processing (for consumer products as well as security and videoconferencing), data communications (including data compression and encryption/decryption), wireless communications, geophysics, genetic and medical analysis, and many others.
At the heart of the Impulse C programming model (shown in Figure 3-2) are processes and streams. Processes are independently synchronized, concurrently operating application components. It's useful to think of these processes as persistent subprograms that accept various data, perform specific computations and generate outputs, either on data streams or by writing to memories or other system resources. Unlike traditional software subroutines, these processes are not "called" (repeatedly invoked during the course of the program's operation) but are instead "always on" and constantly responding to data appearing on their inputs. Processes are persistent, performing the work of an application by accepting data, performing computations, and generating outputs.
Figure 3-2. The data processed by an application flows from process to process by means of streams, or in some cases by means of signals and/or shared memories.
The CSP programming model is designed to simplify the creation of highly parallel applications using a streams-oriented approach to data movement, processing, and synchronization.
An unlimited number of applications may be expressed in this way, but applications with some or all of the following characteristics are best suited to the CSP model:
Impulse C is specifically designed to address streaming applications, or other such applications in which a large amount of data must be processed through a relatively intense set of operations. (Note that other C-based hardware design languages, including the Handel-C language offered by Celoxica, provide similar capabilities.)
In Impulse C, the communicating sequential process programming model is embodied in a small set of datatypes and intrinsic library functions that can be called from a conventional C program. The C-compatible language extensions are used to specify an application as a collection of processes communicating via streams, signals, and shared memories. Intrinsic library functions defined by Impulse C are used to communicate stream and signal data between the processes and to move data in and out of shared or local memory elements. The processes are then assigned to actual resources on the target programmable platform through the use of additional Impulse C library functions.
Streams are the primary method by which multiple processes communicate with one another and synchronize their activities. An application with well-designed stream interfaces will operate efficiently when mapped to actual hardware and software. Much of the effort in creating such applications is therefore found in the design of the stream interfaces and in optimizing data movement.