Site Map | Contact Us
Quantum Leaps - innovating embedded systems Call us toll-free!
 

Products / Quantum Platform / QF

Overview
Quantum Event Processor (QEP)
Quantum Framework (QF)
Quantum Kernel (QK)
Quantum Spy (QS)
products

  Related Links
   Quantum Platform (QP)
   Code/Manuals
   Application Notes
   Licensing
  
Features
High Portability
Explanation of Internals
Versions of QF
Clean, Portable, Source Code
Small Footprint
Object-Orientation
Design by Contract™

QF Brochure 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

to topTop of page

High 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.

to topTop of page

Explanation 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.

to topTop of page

Versions 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.

to topTop of page

Clean, 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.

to topTop of page

Small 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.

to topTop of page

Performance

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.

to topTop of page

Object 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+".

to topTop of page

Design 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.

to topTop of page


Version: April 20, 2006