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

QP™ Overview

Overview
QP-nano™
Quantum Event Processor (QEP)
Quantum Framework (QF)
Quantum Kernel (QK)
Quantum Spy (QS)
products

  Related Links
   Downloads (GPL)
   Application Notes
   Licensing
  
QP™ Product Family
QP/C™ and QP/C++™
QP-nano™
Key Advantages of QP™
Modern, Safer Programming Model
A Framework, Not a Library
Testability, Observability, and Controllabilty
Lightweight Modeling Tool
Support for Rapid Prototyping
Built-in Preemptive Real-Time Kernel
Additional Services and Products

Quantum Platform™ (QP) Product Family

QP Brochure (400KB)

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

to topTop of page

QP/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++™.


QP-Components


QEP QEP Brochure (700KB)

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

QF QF Brochure (333KB)

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

QK QK Brochure (209KB)

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.

QS QS Brochure (609KB)

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.

to topTop of page

QP-nano™

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

to topTop of page

Key Advantages of QP™

to topTop of page

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

to topTop of page

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

to topTop of page

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

to topTop of page

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

to topTop of page

Support for Rapid Prototyping

QP supports rapid model building in several ways:

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.

to topTop of page

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

to topTop of page

Additional Services and Products

Quantum Leaps also stands behind all of our products with commercial support, training courses, and consulting services.

to topTop of page


Version: March 24, 2007