QP (framework)

Last updated
QP real-time embedded frameworks (RTEFs)
Logo qp 256.png
Developer Quantum Leaps
Written in QP/C in C, QP/C++ in C++
OS family Framework / RTOS
Working stateMature
Source model Open source
Marketing target Embedded systems
Update method GitHub
License GPL and Commercial (Dual licensing)
Official website state-machine.com

QP (Quantum Platform) is a family of open source real-time embedded frameworks (RTEFs) and runtime environments based on active objects (actors) and hierarchical state machines (UML statecharts). The QP family consists of the lightweight QP/C and QP/C++ frameworks, written in C (C99) and C++ (C++11), respectively. [1]

Contents

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 (RTE) systems.

Active Objects (Actors) can be combined with a wide variety of threading models, including real-time kernels (RTOS kernels). In the latter case, the combination, carefully designed for deterministic performance, is called the Real-Time Embedded Framework (RTEF).

The Active Object architecture inherently supports and automatically enforces the best practices of concurrent programming. [2] This results in applications that are safer, more responsive, and easier to manage than the "naked" threads and the myriad of blocking mechanisms of a traditional Real-Time Operating System (RTOS). The QP frameworks also provide a higher level of abstraction and the right abstractions to effectively apply graphical modeling and code generation to deeply embedded systems.

Framework, NOT a Library

The main difference between an RTOS and a (real-time) framework is that when you use a "naked" RTOS, you write the main body of each and every thread in the application and from there, you call the various RTOS services (e.g., a time-delay or a semaphore). [3]

When you use a framework, you reuse the overall architecture (such as the event loop for all private threads of Active Objects) 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. In contrast, a “naked” RTOS lets you do anything and offers no help or automation for the best practices.

Hierarchical State Machines

The behavior of active objects (actors) is specified in QP by means of hierarchical state machines (UML statecharts). 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. [4]

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 (QEP), a portable, event-driven, real-time framework (QF), a selection of built-in real-time kernels (QV, QK, or QXK), and a software tracing system (QS).

Figure 1: Block diagram showing QP components and their relationship to the hardware and the application QP block diagram.jpg
Figure 1: Block diagram showing QP components and their relationship to the hardware and the application

QEP (QP Event Processor) is a universal UML-compliant event processor that enables direct coding of UML state machines (UML statecharts) in highly maintainable C or C++, in which every state machine element is mapped to code precisely, unambiguously, and exactly once (traceability). 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 (QP Active Object Framework) is a highly portable, event-driven, real-time application framework for concurrent execution of Active Objects specifically designed for real-time embedded systems.

QV (Coopeartve Kernel) is a tiny cooperative kernel designed for executing active objects in a run-to-completion (RTC) fashion.

QK (Preemptive Kernel) is a tiny preemptive non-blocking run-to-completion kernel designed specifically for executing state machines in a run-to-completion (RTC) fashion.

QXK (Dual-Mode Kernel) is a tiny preemptive blocking kernel designed for hybrid applicatinons consisting of active objects and traditional blocking threads.

QS (QP/Spy) 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 (blocking/non-blocking) QXK kernel. Standalone QP ports and ready-to-use examples are provided for ARM Cortex-Mas, 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 RTOSes (such as Segger Microcontroller Systems#embOS, ThreadX, FreeRTOS, uC/OS-II, etc.)

The 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 (TCP/IP, USB, CAN, etc.) 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 (POSIX), 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". [5]

Licensing

QP framework are dual-licensed under the open source GPLv3 and a selection of traditional, closed-source licenses. Users who wish to distribute QP (e.g. embedded inside devices) can retain the proprietary status of their code by applying for a commercial license.

See also

Related Research Articles

A real-time operating system (RTOS) is an operating system (OS) for real-time computing applications that processes data and events that have critically defined time constraints. An RTOS is distinct from a time-sharing operating system, such as Unix, which manages the sharing of system resources with a scheduler, data buffers, or fixed task prioritization in a multitasking or multiprogramming environment. Processing time requirements need to be fully understood and bound rather than just kept as a minimum. All processing must occur within the defined constraints. Real-time operating systems are event-driven and preemptive, meaning the OS can monitor the relevant priority of competing tasks, and make changes to the task priority. Event-driven systems switch between tasks based on their priorities, while time-sharing systems switch the task based on clock interrupts.

<span class="mw-page-title-main">Embedded system</span> Computer system with a dedicated function

An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is embedded as part of a complete device often including electrical or electronic hardware and mechanical parts. Because an embedded system typically controls physical operations of the machine that it is embedded within, it often has real-time computing constraints. Embedded systems control many devices in common use. In 2009, it was estimated that ninety-eight percent of all microprocessors manufactured were used in embedded systems.

<span class="mw-page-title-main">QNX</span> Real-time operating system (RTOS) software

QNX is a commercial Unix-like real-time operating system, aimed primarily at the embedded systems market.

<span class="mw-page-title-main">State diagram</span> Diagram of behavior of finite state systems

A state diagram is a type of diagram used in computer science and related fields to describe the behavior of systems. State diagrams require that the system described is composed of a finite number of states; sometimes, this is indeed the case, while at other times this is a reasonable abstraction. Many forms of state diagrams exist, which differ slightly and have different semantics.

<span class="mw-page-title-main">Embedded operating system</span> Type of computer operating system

An embedded operating system is an operating system for embedded computer systems. They are designed to increase functionality and reliability for achieving a specific task. Depending on the method used for computer multitasking, this type of operating system might be considered a real-time operating system (RTOS).

Nucleus RTOS is a real-time operating system (RTOS) produced by the Embedded Software Division of Mentor Graphics, a Siemens Business, supporting 32- and 64-bit embedded system platforms. The operating system (OS) is designed for real-time embedded systems for medical, industrial, consumer, aerospace, and Internet of things (IoT) uses. Nucleus was released first in 1993. The latest version is 3.x, and includes features such as power management, process model, 64-bit support, safety certification, and support for heterogeneous computing multi-core system on a chip (SOCs) processors.

Micro-Controller Operating Systems is a real-time operating system (RTOS) designed by Jean J. Labrosse in 1991. It is a priority-based preemptive real-time kernel for microprocessors, written mostly in the programming language C. It is intended for use in embedded systems.

<span class="mw-page-title-main">FreeRTOS</span> Real-time operating system

FreeRTOS is a real-time operating system kernel for embedded devices that has been ported to 35 microcontroller platforms. It is distributed under the MIT License.

Eclipse ThreadX is a highly deterministic, embedded real-time operating system (RTOS) programmed mostly in the language C.

In computer science, a fiber is a particularly lightweight thread of execution.

Lynx Software Technologies, Inc. is a San Jose, California software company founded in 1988. Lynx specializes in secure virtualization and open, reliable, certifiable real-time operating systems (RTOSes). Originally known as Lynx Real-Time Systems, the company changed its name to LynuxWorks in 2000 after acquiring, and merging with, ISDCorp, an embedded systems company with a strong Linux background. In May 2014, the company changed its name to Lynx Software Technologies.

TI-RTOS is an embedded tools ecosystem created and offered by Texas Instruments (TI) for use across a range of their embedded system processors. It includes a real-time operating system (RTOS) component named TI-RTOS Kernel, networking connectivity stacks, power management, file systems, instrumentation, and inter-processor communications like DSP/BIOS Link. It is free and open-source software, released under a BSD license.

<span class="mw-page-title-main">ChibiOS/RT</span> Real-time operating system

ChibiOS/RT is a compact and fast real-time operating system supporting multiple architectures and released under a mix of the GNU General Public License version 3 (GPL3) and the Apache License 2.0. It is developed by Giovanni Di Sirio.

Nano-RK is a wireless sensor networking real-time operating system (RTOS) from Carnegie Mellon University, designed to run on microcontrollers for use in sensor networks. Nano-RK supports a fixed-priority fully preemptive scheduler with fine-grained timing primitives to support real-time task sets. "Nano" implies that the RTOS is small, using 2 KB of random-access memory (RAM) and using 18 KB of flash memory, while RK is short for resource kernel. A resource kernel provides reservations on how often system resources can be used. For example, a task might only be allowed to execute 10 ms every 150 ms, or a node might only be allowed to transmit 10 network packets per minute. These reservations form a virtual energy budget to ensure a node meets its designed battery lifetime and to prevent a failed node from generating excessive network traffic. Nano-RK is open-source software, is written in C and runs on the Atmel-based FireFly sensor networking platform, the MicaZ motes, and the MSP430 processor.

LynxSecure is a least privilege real-time separation kernel hypervisor from Lynx Software Technologies designed for safety and security critical applications found in military, avionic, industrial, and automotive markets.

UML state machine, also known as UML statechart, is an extension of the mathematical concept of a finite automaton in computer science applications as expressed in the Unified Modeling Language (UML) notation.

<span class="mw-page-title-main">YAKINDU Statechart Tools</span>

YAKINDU Statechart Tools (YAKINDU SCT) is a tool for the specification and development of reactive, event-driven systems with the help of finite-state machines. It comprises a tool for the graphical editing of statecharts and provides validation, simulation, and source code generators for various target platforms and programming languages. YAKINDU Statechart Tools are available with standard and professional editions, with no-cost licenses for non-commercial resp. academic usage. Users are coming from both industry and academia.

<span class="mw-page-title-main">Rodos (operating system)</span> Real-time operating system

Rodos is a real-time operating system for embedded systems and was designed for application domains demanding high dependability.

<span class="mw-page-title-main">Zephyr (operating system)</span> Real-time operating system

Zephyr is a small real-time operating system (RTOS) for connected, resource-constrained and embedded devices supporting multiple architectures and released under the Apache License 2.0. Zephyr includes a kernel, and all components and libraries, device drivers, protocol stacks, file systems, and firmware updates, needed to develop full application software.

PX5 RTOS is a real-time operating system (RTOS) designed for embedded systems. It is implemented using the ANSI C programming language.

References

  1. Miro Samek (2008). Practical UML Statecharts in C/C++, Second Edition: Event-Driven Programming for Embedded Systems (PDF). Newnes. ISBN   978-0-7506-8706-5.
  2. Herb Sutter (June 14, 2010). "Prefer Using Active Objects Instead of Naked Threads" (PDF).
  3. Sutter, Herb. "Use Threads Correctly = Isolation + Asynchronous Messages". Dr. Dobb's. Retrieved 2022-09-27.
  4. "freeware graphical QM modeling tool".
  5. "Dual Targeting and Agile Prototyping of Embedded Software".