Quantum Platform™ (QP) Product Family
Quantum Platform™ (QP) is a family of very lightweight, open source, state machine-based frameworks for embedded systems. QP enables developing well-structured embedded applications as a set of concurrently executing hierarchical state machines (UML statecharts). With QP, coding of modern state machines directly in C or C++ is a non-issue. No big design automation tools are needed.
QP consists of a universal UML-compliant event processor (QEP), a portable event-driven framework (QF), and a tiny run-to-completion kernel (QK). Current versions of QP include: QP/C™ and QP/C++™, which require about 4KB of code and a few hundred bytes of RAM, and the ultra-lightweight QP-nano, which requires only 1-2KB of code and just several bytes of RAM.

QP can work with or without a traditional OS/RTOS. In the simplest configuration, QP can completely replace a traditional RTOS. QP includes a simple non-preemptive scheduler and a fully preemptive kernel (QK). QK is smaller and faster than most traditional preemptive kernels or RTOS, yet offers fully deterministic, preemptive execution of embedded applications.
QP/C and QP/C++ can also work with a traditional OS/RTOS to take advantage of existing device drivers, communication stacks, and other middleware. QP has been ported to Linux/BSD, Windows, VxWorks, uC/OS-II, and other popular OS/RTOS.
An earlier version of QP (v2.x) was originally published in the book Practical Statecharts in C/C++ (CMP Books 2002). Today, QP™ is used worldwide by some of the largest companies in their respective industries, such as: consumer electronics, telecommunications equipment, industrial automation, transportation systems, medical devices, and many more.
Top of pageQP/C and QP/C++
QP/C™ and QP/C++™ are the most powerful members of the QP™ product family implemented in C and C++, respectively. The picture below shows the main components of QP/C™ and QP/C++™.

Quantum Event Processor™ (QEP) is a generic, portable, and reusable state machine engine that processes events according to the general semantics of UML™ state machines. QEP is a passive component, which means that it needs to be externally called to handle events. QEP provides facilities for executing Hierarchical State Machines (HSMs) as well as the simpler traditional Finite State Machines (FSMs). QEP is designed to operate with almost any event queuing and dispatching mechanisms, which are also necessary components of a hypothetical state machine [OMG 01]. For example, QEP can be used with virtually all existing event-driven environments, such as Microsoft Windows, or Quantum Framework designed specifically for RTE systems. QEP has been described in Part 1 of Practical Statecharts in C/C++.
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 has been described in Part 2 of Practical Statecharts in C/C++.
Quantum Kernel™ (QK) is a tiny preemptive real-time kernel specifically designed for executing independent tasks in a run-to-completion (RTC) fashion. As it turns out, the RTC-style processing and no need for blocking of active objects allows QK to be extremely simple and utilize only a single stack for all tasks and interrupts. QK is available starting from QP v3.0.
Quantum Spy™ (QS) is a real-time tracing facility built into QEP, QF, and QK components and available to the Application code as well. QS allows you to gain unprecedented visibility into your application by selectively logging almost all interesting events occurring within state machines, the framework, the kernel, and your application code. QS event logging is minimally intrusive, offers precise time-stamping, sophisticated runtime filtering of events, and good data compression. QS can be configured to send the real-time data out of the serial or Ethernet port of the target device, or even write the data to a file. QS is available starting from QP v3.1.
Top of pageQP-nano™
QP-nano™ is the smallest member of the QP™ product family. QP-nano™ is an ultra-lightweight alternative to a traditional real-time kernel or RTOS specifically designed for low-end 8- and 16-bit embedded microcontrollers (MCUs), such as AVR, MSP430, 8051, PICmicro, 68HC(S)08, M16C, and many others. QP-nano™ enables parallel execution of multiple hierarchical state machines, which communicate by sending and receiving lightweight events. Typically, QP-nano™ requires around than 1-2KB of ROM and just a few bytes of RAM per state machine.
Top of pageKey Advantages of QP™
Modern, Uncomplicated, Practical Software. QP™ is intentionally minimalist, code-centric, and low-level in nature. This characterization is not pejorative; it simply means that our infrastructure maps the fundamental concepts (such as UML statecharts or active object computing model) directly to the source code, without the need to employ complex design automation tools. Keeping the implementation small and simple has real benefits. Developers can learn and deploy QP quickly without large investments in tools and training. They also can adapt and customize the platform easily to their particular situation, including to severely resource-constrained environments. They can understand, and indeed regularly use, all the features.
Stability and Portability. All components of QP™ are provided first to the open source community under the GPL license to allow for a thorough "battle testing" and "rapid stabilization" in a very diverse combinations of embedded hardware and software before the code is deemed ready for commercial use.
Ease of Configuration. QP™ is designed from ground up to be both easy to port and self-configuring, which means that all unused features are automatically eliminated at link-time without the need for compile-time configuration based on preprocessor.
Cross-Platform Support. QP™ is available for several microprocessors and RTOS (Real-Time Operating System) options with the new ports appearing frequently and freely available from the quantum-leaps.com website.
Observability, Controllabilty, and TestabilityQuantum Spy (QS) tracing facility provides unprecedented visibility into the running application.
In-depth Documentation, Ample Coding Recipes and Design Patterns. With QP™, actual coding of even the most involved reactive systems becomes a non-issue. What becomes much more important is the actual design of effective active object-systems and their internal state machines. To this end, the documentation available for QP goes far beyond simply documenting the APIs. The developers can gain in-depth understanding of all underlying concepts and implementation techniques from the book ("Practical Statecharts in C/C++), several magazine articles, conference papers, discussion board, our Developer Zone, and constantly upgraded online Resources.
Strong Community of Experienced Developers. The open source-friendly licensing strategy practiced by Quantum Leaps ensures that the code is used and supported by a broad and diverse user's community. This strong community, the Practical Statecharts in C/C++ book, and other ample resources should give you some assurance of continued support in case circumstances beyond our control prevent Quantum Leaps from producing new editions of our software.
Flexible, Royalty-Free Licensing Model. Our flexible, cost-effective commercial licenses allow traditional, closed-source distribution of QP™ applications and thus appeal to customers, who want to retain the proprietary character of their code and implementations.
Top of pageModern, Safer Programming Model
The modern event-driven architecture underlying QP provides a much safer programming model compared to the traditional approach involving an Real-Time Operating Systems (RTOS), resource sharing, and various synchronization and mutual exclusion mechanisms (such as semaphores). QF executes concurrent state machines according to the run-to-completion (RTC) semantics, which means that you can code your applications with purely sequential techniques, without ever fiddling with semaphores, monitors, condition variables, signals, or other such mechanisms that are indispensable in every conventional RTOS-based design. Nonetheless, independent state machine can freely preempt each other and therefore your QP applications can achieve the same level of event responsiveness, determinism, and good processor utilization as best conventional RTOS-based solutions.
Top of pageA Framework, Not a Library
The Quantum Framework® (QF), the main component of the QP™, is an application framework, which means that QF provides the overall reusable architecture for the applications derived from it. Reuse on this level leads to inversion of control between your application and the infrastructure on which it is based. When you use a traditional RTOS, for example, you write the main body of the application and call various RTOS services. When you use QF, you reuse the main application skeleton provided by the framework and write the code it calls.
Top of pageTestability, Observability, and Controllabilty
A running QP application built of state machines and active objects is a highly structured affair. You can gain unprecedented visibility into the system by monitoring state transitions, event exchanges, event queues, and kernel objects, which all are under the control of QP. All these internal events can be easily logged at runtime by the minimally-intrusive Quantum Spy™ (QS), which is instrumented into the QP components and can be activated by a compile-time switch.
QS is the unique execution-tracing tool that gives developers a real-time record of any state machine activity, event exchanges, and kernel state in a running system. This is very useful for following and debugging code-execution sequences, especially in a multi-threaded environment. QS is not limited to QP components. QS provides generic logging facilities for instrumenting application code as well.
Top of pageLightweight Modeling Tool
Active object-based frameworks like QF® are not new and in fact have been in extensive use for at least a decade. Virtually all design automation tools on the market today use a variant of such a framework as a backbone of automatic code synthesis. Real-time object-oriented modeling (ROOM) calls its framework the "ROOM virtual machine" [Selic+ 94]. A visualSTATE tool from IAR Systems calls it a "visualSTATE engine" [IAR 00]. A UML-compliant design automation tool from I-Logix, Rhapsody, calls it an "Object Execution Framework" (OXF) [Douglass 99, Rinat 00]. These tools are mature products that have been successfully applied to build very diverse, mission critical, real-time systems.
QP is built on the same fundamental principles as the ROOM virtual machine or the Rhapsody's OXF. The only significant difference between QP and the design automation tools is that the tools typically use a visual modeling language (e.g., UML), whereas QP enables high-level modeling directly at the programming language level.
With the concrete, ready-to-use building blocks provided in QP, you work directly with such high-level concepts as active objects, hierarchical states, transitions, and events. QP allows you to construct, compile, and execute concurrent state models rapidly, even if they are nothing more than vastly incomplete skeletons. You can easily change the state machine topology (e.g., add, remove, or rearrange states and transitions) at any stage, even late in the process, by editing a few lines of code and recompiling. Then you can test your executable models on the host or target environments. In that way, you can quickly try out many alternatives before committing to any one of them. This process is rightly called modeling, because it enables fast exploration of your design space.
Top of pageSupport for Rapid Prototyping
QP supports rapid model building in several ways:
QP lets you work at a high level of abstraction directly with hierarchical state machines, active objects, and events.
QP has been designed from the ground up so that you can compile and correctly execute intentionally incomplete prototypes successfully. For example, the publish-subscribe event delivery of the QF does not require that you specify the recipients of events, so a prototype still compiles, even if some active objects (recipients of events) are missing. Similarly, automatic event recycling allows the correct execution of applications (without memory leaks), even if some published events are never received.
QEP lets you elaborate statecharts in layers of abstraction; that is, you can intentionally leave the internal structure of composite states unspecified.
QEP lets you modify state machine topology easily at any stage of development. A correctly structured state machine implementation is often easier to modify than the corresponding state diagram.
Thus, through support for executable prototypes, QP offers a lightweight alternative to heavy-weight and high-ceremony design automation tools, for which rapid prototyping has always been one of the biggest selling points.
Top of pageBuilt-in Preemptive Real-Time Kernel
The QF has been designed up-front to work with very wide range of multitasking models, such as preemptive and non-preemptive kernels, RTOSes, or even with a simple "superloop" (main+ISRs). The standard QP distribution contains several examples of using QF with such multitasking paradigms.
However, starting from version 3.0, Quantum Platform includes a small Quantum Kernel (QK), that provides all benefits of deterministic, preemptive, real-time kernel at a fraction of the memory footprint of a traditional preemptive kernel. As it turns out, the run-to-completion processing of events and no need for blocking of active objects allows QK to be extremely simple and utilize only a single stack for all tasks and interrupts.
Top of pageAdditional Services and Products
Quantum Leaps also stands behind all of our products with commercial support, training courses, and consulting services.
Top of page
Version: March 24, 2007




