QP (framework)
QP is a family of open source real-time embedded frameworks and runtime environments based on active objects (actors) and hierarchical state machines. The QP family consists of the lightweight QP/C and QP/C++ frameworks, written in C and C++, respectively.
Active Objects (Actors) For Real-Time
The QP RTEFs are an implementation of the Active Object (Actor) model of computation, specifically tailored for real-time embedded systems.Active Objects can be combined with a wide variety of threading models, including real-time kernels. In the latter case, the combination, designed for deterministic performance, is called the Real-Time Embedded Framework. This framework uses higher level abstractions than Real-Time Operating System (RTOS) in graphical modelling and code generation to embedded systems, which create safer, and more responsive applications.
Comparison to RTOS
Compared to a framework, when using an RTOS, the main part of each individual thread can be written in the application itself and the various RTOS services can be called from there.When you use a framework, you reuse the overall architecture and you only write the code that the RTEF calls. This leads to inversion of control, which allows the RTEF to automatically enforce the best practices of concurrent programming.
Hierarchical State Machines
The behavior of active objects (actors) is specified in QP by means of hierarchical state machines. The frameworks support manual coding of UML state machines in C or C++ as well as fully automatic code generation by means of the free graphical QM modeling tool.The QP frameworks and the QM modeling tool are used in medical devices, defense & aerospace, robotics, consumer electronics, wired and wireless telecommunication, industrial automation, transportation, and many more.
QP architecture and components
QP consists of a universal UML-compliant event processor, a portable, event-driven, real-time framework, a selection of built-in real-time kernels, and a software tracing system.[Image:QP block diagram.jpg|center|Figure 1: Block diagram showing QP components and their relationship to the hardware and the application]
QEP is a universal UML-compliant event processor that enables direct coding of UML state machines in highly maintainable C or C++, in which every state machine element is mapped to code precisely, unambiguously, and exactly once. QEP fully supports hierarchical state nesting, which enables reusing behavior across many states instead of repeating the same actions and transitions over and over again.
QF is a highly portable, event-driven, real-time application framework for concurrent execution of Active Objects specifically designed for real-time embedded systems.
QV is a tiny cooperative kernel designed for executing active objects in a run-to-completion fashion.
QK is a tiny preemptive non-blocking run-to-completion kernel designed specifically for executing state machines in a run-to-completion fashion.
QXK is a tiny preemptive blocking kernel designed for hybrid applications consisting of active objects and traditional blocking threads.
QS is a software tracing system that enables live monitoring of event-driven QP applications with minimal target system resources and without stopping or significantly slowing down the code.
Standalone (Bare-Metal) Operation
The QP RTEFs can run standalone, completely replacing the traditional RTOS. The frameworks contain a selection of built-in real-time kernels, such as the cooperative QV kernel, the preemptive non-blocking QK kernel, and the unique preemptive, dual-mode QXK kernel. Standalone QP ports and ready-to-use examples are provided for ARM Cortex-Mas, as well as other CPUs.Traditional RTOS Integration
The QP RTEFs can also work with many traditional third-party RTOSes. QP ports and ready-to-use examples are provided for several RTOSesThe most important reason why you might consider using a traditional RTOS kernel for executing event-driven QP applications is compatibility with the existing software. For example, many communication stacks are designed for a traditional blocking kernel. In addition, a lot of legacy code requires blocking mechanisms, such as semaphores or time-delays. A traditional RTOS allows you to run the existing software components as regular “blocking” threads in parallel to the event-driven QP™ active objects.
General Purpose OS Integration
The QP RTEFs can also work with general purpose OSes, such as Linux, Windows, and macOS.The QP ports to the general purpose operating systems are interested in their own right. For example, the QP port to POSIX supports real-time extensions and works with embedded Linux, and POSIX subsystems of such RTOSes as: QNX, INTEGRITY, VxWorks, etc. Similarly, QP port to Windows can work with Windows IoT or Windows Embedded Compact.
But the OS support can be also interesting for developing of deeply embedded code on the desktop workstations, which is called "dual-targeting".