SA-C & The Khoros Software Development Environment


The SA-C compiler developed at Colorado State University is a stand-alone compiler. With it, programmers can develop code in the traditional unix mode of editing a file with a unix editor (e.g. VI or Emacs), compiling it from the command line, and if necessary debugging it from the command line as well. (For SA-C programs, the data flow graph simulator replaces the debugger in this mode.)

Many image processing programmers have abandoned this software development mode, however, in favor of connecting subroutines in a graphical programming environment. The most popular of these environments is the Khoros software development environment from Khoral Research, Inc. (KRI). Khoros is divided into two components: Composer, which is an editing & compilation environment for developing new "glyphs" (i.e. library routines), and Cantata, which is a graphical programming environment for combining glyphs into applications.

As part of the Cameron project, KRI has extended Composer & Cantata to allow programmers to write SA-C programs for FPGAs and to execute them from within a Cantata workspace. Cantata workspaces can arbitrarily mix C and SA-C glyphs, allowing applications programmers to exploit FPGAs within their normal software environment, and to port applications to FPGAs on a glyph-by-glyph basis. Better yet, when an application contains two or more consecutive SA-C glyphs, they can be "lasso-ed" graphically and recompiled as a unit, gaining the benefits of SA-C optimizations (including loop fusion) without rewriting any code.

Extending Composer & Guise

Composer is the environment for writing new program modules and including them as glyphs in the Cantata visual programming environment. When programmers want to write a new module, they specify the input and output variables through a tool called Guise, which automatically builds the module's GUI for Cantata. Composer then automatically generates the code for accessing these variables and checking for errors. Programmers then write the internals of the module in C or SA-C using their favorite editor. Khoral's extensions to Composer for SA-C allow programmers to specify SA-C as the source language of a module, and generate the necessary wrapping code.

Extending Cantata

Like Composer, Cantata was extended to allow for glyphs written in SA-C. These glyphs are marked by a small FPGA icon (a red chip) in Cantata, and are executed on the reconfigurable processor. Cantata was also extended to give users the ability to graphically "lasso" two or more consecutive SA-C glyphs. When glyphs are lasso-ed, they are recompiled as a single unit, complete with all of the SA-C compiler's optimizations. Chief among these optimizations (for this purpose) is loop fusion, which may combine the programs associated with the two glyphs into a single procedure that can be executed in a single pass over the image. This fusion occurs within the Cantata environment and without the user writing any new code. As a result, applications programmers who lasso two or more SA-C glyphs to create a new, optimized program may not even know how to program in SA-C. Only the programmers who write the original glyphs need to know SA-C.

(An example of the ARAGTAP pre-screener workspace in Cantata. The glyphs with red FPGA chips are SA-C glyphs.)