QF Brochure (333KB)
| Application | ||||||
| Quantum Event Processor (QEP) | ||||||
| Quantum | Framework™ (QF) | Quantum | Spy™ (QS) | |||
| Quantum Kernel (QK) or other Kernel/RTOS | ||||||
| Target Hardware | ||||||
Quantum Framework™ (QF) is a reusable event-driven application framework for executing concurrent state machines specifically designed for real-time embedded (RTE) systems. QF applications consist of independent elements called active objects that collaborate to collectively deliver the intended functionality. Active objects in QF are encapsulated tasks (each embedding an event queue and a state machine) that communicate with one another asynchronously by sending and receiving events. Within an active object, events are processed sequentially in a run-to-completion (RTC) fashion, while QF encapsulates all the details of thread-safe event exchange and queuing. QF is designed to work with Quantum Event Processor (QEP) and a scheduler/RTOS of your choice.
Versions of QF are available in highly portable ANSI-C and Embedded C++. QF has been described in Part 2 of PSiCC.
Features
Full support for active object computing with up to 63 active objects.
Publish-subscribe event delivery with event multicasting capabilities.
Direct event delivery with first-in-first-out (FIFO) and last-in-first-out (LIFO) options.
Zero-copy event passing policy for maximum performance.
Automatic event recycling.
Build-in support for event queues.
Build-in support for event pools.
Open-ended number of periodic or one-shot event timers.
Easy to integrate with wide range of schedulers from primitive "superloop" (main+ISRs) to preemptive RTOSs.
Comprehensive Programmer's Manual
Sample application included in the distributions and explained in the manual
Very clean source code passing strict static analysis with PC-Lint™.
Source code 98%-compliant with the Motor Industry Software Reliability Association (MISRA) Guidelines For The Use of The C Language in Vehicle Based Software [MISRA 98].
Dual-licensing model with choice between open source and flexible, royalty-free commercial licensing.
Top of pageHigh Portability
QF has been designed from the ground up to be highly portable. The framework has a very clean portability layer to fit just about any type of CPU/RTOS/compiler combination. Various ports of QF are available under dual-licensing for download from quantum-leaps.com website with new ports appearing frequently.
Top of pageExplanation of Internals
The internals of QF are described in Part 2 of the book: Practical Statecharts in C/C++, which is available worldwide from most technical bookstores and through online retailers, such as www.amazon.com.
Top of pageVersions of QF
Currently, versions of Quantum Framework™ are available in ANSI-C and Embedded C++. These are completely separate codesets, not merely a C++ interface to C.
Top of pageClean, Portable, Source Code
All versions of QF come with complete, very clean, portable, source code. The source code strictly complies with Quantum Leaps C/C++ Coding Standard, has been thoroughly "combed" with PC-Lint™, and is 99% compliant with the Motor Industry Software Reliability Association (MISRA) Guidelines For The Use of The C Language in Vehicle Based Software [MISRA 98]. All data types, constants, and functions in QF start with the prefix 'Q' or 'QF', which should make it easier to recognize that the services belong to the framework and should minimize name compile-time and link-time conflicts with other software.
Top of pageSmall Footprint
QF is deployed as a very-fine granularity library for "self configuration", which is automatic elimination of unused features at link-time as opposed to hand-configuration at compile-time via preprocessor macros. Therefore QF scales down automatically to include only code for features actually used. Depending on the processor and compiler, QF can be reduced to about 4K bytes of code space (ROM) and a few hundred bytes of data space (RAM), without counting stacks, event pools, and event queues.
QF uses no standard C-runtime library (e.g., string manipulation, printf(), malloc(), etc.). Obviously, the framework doesn't use any floating point operations, but even fixed-point division is carefully avoided (which might be important for ARM processors). This means that the standard C-runtime can be trimmed down drastically further reducing the codespace requirements.
QF does not pre-allocate any internal objects. All allocations is performed at the application level outside of the framework. This gives the application programmer the complete control over memory allocation policies (e.g., static allocation, or any form of dynamic allocation, if desired) and ensures the that no RAM is wasted.
The framework has been very carefully designed to conserve the stack space, which is particularly important in multitasking environments, where each task (active object) runs on it's own stack.
Top of pagePerformance
QF implements the event passing paradigm very efficiently. No events are ever copied—only the pointers to the events are passed around and stored in event queues in a thread-safe manner. Depending on the underlying RTOS, the execution of QF can be deterministic, which means that the framework can meet hard real-time deadlines. The Quantum Kernel (QK) is an example of an extremely fast, deterministic, preemptive kernel.
Top of pageObject Orientation
The basic architecture of QF and the applications derived from it is fundamentally object-oriented, which means that QF extensively uses encapsulation (classes) and inheritance (deriving new classes from the existing ones).
Object-orientation of the C version of QF might be perceived as an obstacle to some C programmers. However, the way encapsulation and inheritance are used in QF/C should, in fact, come as very familiar to any C programmer. A Quantum Leaps coding recipe "Simple Encapsulation and Inheritance in C" describes how QF/C implements these object-oriented concepts. Earlier versions of QF/C (v.2.x) used more advanced OOP techniques in C, called "C+". Starting from version 3.0 QF/C does not use "C+", although it is fully compatible with "C+".
Top of pageDesign by Contract™
An important aspect of QF that you, as the framework client, need to understand is the way it uses assertions. In this respect, the QF applies elements of the Design by Contract™ (DBC) methodology pioneered by Bertrand Meyer [Meyer 97]. (See also C/C++ Users Journal Article "An Exception or a Bug".)
DBC is a different, much more modern philosophy compared to traditional returning error status from API calls. You'll see no error returns from QF. Instead, QF uses assertions internally to help you detect errors, not so much inside the framework, but in the applications derived from it. The assertion facilities used inside QF are simple, but highly customizable to the domain of RTE systems.
Top of page
Version: April 20, 2006




