Programming in C Catalina - rosco-pc/propeller-wiki GitHub Wiki
Ross Higson has developed Catalina - a free ANSI compliant C compiler for the Propeller Chip. Catalina can be downloaded from SourceForge. The current release is 3.13.2.
Catalina is based upon LCC (a robust, widely used and portable C compiler front-end), with a custom back-end that generates Large Memory Model (LMM) PASM code for the Propeller. For general details on LMM, go here.
Catalina is now essentially complete. Bugs and maintenance releases will still be issued, but no more functional additions are expected - at least not until the Prop II arrives!
The Parallax forums should be used for contacting the author or interacting with other Catalna users - see this Parallax forum thread
Major features of Catalina:
- ANSI C compliant, with C89 library (plus some C99 library functions).
- Floating point support (32 bit IEEE 754).
- Debugger support. Several debuggers are now supported:
- POD debugger for assembly level debugging; or
- BlackBox (Windows or Linux command line) for source level debuggin; or
- BlackCat (Windows GUI) for source level debugging.
- Basic support for all Propeller platforms, plus extended support for specific platforms - the targets provided support the Hydra, Hybrid, TriBladeProp, Morpheus, DracBlade, RamBlade, C3 and the Demo Board. Others can be easily added.
- Platform independent - Win32 and Linux binaries provided. Easily ported to other platforms.
- All source code provided (compiler, libraries and tools).
- XMM support for programs larger than 32K (requires additional hardware).
- Supports the Code::Blocks Integrated Development Environment.
- It's FREE!
Catalina supports three different addressing modes:
- Tiny - all code and data share the 32Kb of Hub RAM. This mode is used by all LMM and EMM programs, and is suitable for use on any Propeller platform.
- Small - code can be up to 16Mb, but all data (including the stack and heap) must still share the 32kb of Hub RAM. This is the original XMM mode as implemented in the various beta releases. This mode requires dedicated XMM hardware (i.e. external SRAM). Currently supported are the Hydra and Hybrid (using the HX512 external SRAM card), the TriBladeProp, RamBlade, DracBlade Morpheus and C3.
- Large - code, data and heap can be up to 16Mb (combined), and only the stack uses the 32Kb of Hub RAM. This mode uses a completely new code generator (the previous code generator remains in use for the other modes), and also an enhanced XMM Kernel. This requires the same dedicated XMM hardware as the Small mode. When the Prop II eventually surfaces, the space available for stack under the Large addressing model is expected to be increased to 256Mb. However, note that 'larger' is not always 'better' - programs that use the larger addressing modes will generally be slower than programs that use the smaller addressing modes. A programs should always use the smallest addressing mode it can.
Other notable enhancements in recent releases are as follows:
- Multi-cog and multi-thread support. Catalina can execute C code on all 8 cogs concurrently, and execute multiple C threads on each cog.
- An SD Card program loader (Catalyst). Catalyst is an interactive program loader and a set of utility programs that simplifies the execution of Catalina programs (LMM and XMM) on platforms with an SD card. Catalyst can also be used to load normal SPIN/PASM binaries. Catalyst includes several example applications programs, such as the vi editor, the Lua scripting language and a fully ISO compliant Pascal P5 compiler. These require XMM RAM.
- A serial program loader (Payload). Payload can load LMM or XMM programs (up to 16Mb) into the Propeller directly from a PC. Payload can also be used to load normal SPIN/PASM binaries.
- Suport for Code::Blocks for graphical editing and compiling of C programs. Code::Blocks can be downloaded from here
- Support for multi-CPU systems such as the TriBladeProp and Morpheus. This includes support for "proxy devices" (in a multi-CPU system, this is the ability to use devices physically connected to another CPU as if they were directly connected to the CPU on which the Catalina program is running).
- Simplified compiler command-line options (no more obscure options like -Wl-W-d or -x5). Environment variables can be used to to store commonly used configuration options.
- A standard target package that inlcudes all supported platforms. All platform-specific target configuration can now be done on the command-line using. New "custom" platforms can be added to the standard target package, or a completely new target can be created instead.
Here is a picture of Catalina being used from within Code::Blocks: