Quick Overview of
QP Frameworks &
QM Modeling Tool

state-machine.com
Presentation Outline
• What is QP?
What is QP?

• Active Objects (Actors) for Real-Time Embedded Systems
• Hierarchical St...
What is QP?
●

Family of active object (actor) frameworks
for real-time embedded (RTE) systems
QP/C, QP/C++, and QP-nano

...
Where does it run? (bare metal)
●

Single-chip 32-bit, 16-bit, and some 8-bit microcontrollers
32-bit (ARM): ARM Cortex-M,...
Where does it run? (OS/RTOS)
●

QP/C and QP/C++ can run on top of an OS or RTOS
Big OS: POSIX (Linux, QNX, etc.), Win32
Bi...
Who is using it?
●

Millions of products: medical, defense, communication,
transportation, industrial, consumer, ...

stat...
How is it licensed?
●

QP frameworks are available under dual-licensing model:
–
–

●

GPL (v3) open source license
Commer...
Presentation Outline
• What is QP?

• Active Objects (Actors) for Real-Time Embedded Systems
Active Objects (Actors) for R...
Active Objects (Actors)
●

Active objects (actors) automatically enforce the
following best practices of concurrent progra...
Active Objects for Embedded MCUs
●

Active objects cannot operate in a vacuum and require a
software infrastructure (frame...
Asynchronous Communication
●

All events are delivered asynchronously:

1. Each active object has its own event queue and ...
True Encapsulation for Concurrency
●

Traditional encapsulation with synchronous methods
does not encapsulate anything in ...
Run-to-Completion (RTC) Processing
●

AOs process events one at a time (to completion)
→ RTC should not be confused with t...
No Blocking (!)
●

Event-driven AOs don't block to wait for events
→ Therefore AOs remain responsive to events
→ Easy to a...
Super-Fast Preemptive Kernel
●

Non-blocking AOs can work with non-blocking kernels
→ Preemptive multitasking with a singl...
Presentation Outline
• What is QP?

• Active Objects (Actors) for Real-Time Embedded Systems
• HierarchicalState Machines ...
Specifying Behavior of Active Objects
●

Each Active Object in QP has a state machine
→ Naturally handle events based on t...
Transition Explosion in Traditional FSMs
●

Traditional Finite State Machines inflict repetitions
→ There is no way to cap...
Reuse of Behavior Through State Nesting
●

Hierarchical State Machines support state nesting
→ Nested states inherit the b...
Manual Coding of HSMs in QP/C++
QState Calc::on(Calc *me, QEvt const *e) {
switch (e->sig) {
case Q_ENTRY_SIG: {
// entry ...
Presentation Outline
• What is QP?

• Active Objects (Actors) for Real-Time Embedded Systems
• Hierarchical State Machines...
What is QM?
• Free graphical modeling and code generation tool for QP

state-machine.com

22
How Does it Work?

1. Create AO classes

3. Add actions/guard code

2. Draw state machines

4. Generate code

state-machin...
What's Special about QM?

Turning code generation
upside down”...

state-machine.com

24
Presentation Outline
• What is QP?

• Active Objects (Actors) for Real-Time Embedded Systems
• Hierarchical State Machines...
Why Software Tracing?
Biggest problem: limited visibility into the embedded system
→ You need to observe the system live; ...
QS Software Tracing System
QS (QP Spy ) tracing provides wealth of information:
→ All state machine activities (entering/e...
QSPY Host Application
QSPY host application receives and displays the QS data:
→ Human-readable format
→ Interface to MATL...
Presentation Outline
• What is QP?

• Active Objects (Actors) for Real-Time Embedded Systems
• Hierarchical State Machines...
MISRA Compliance
Safe subset of C or C++ for use in safety critical applications
→ MISRA Compliance Matrices for QP/C, QP/...
Upcoming SlideShare
Loading in …5
×

Quick Overview of QP Frameworks and QM Modeling Tool

1,253
-1

Published on

This presentation provides a quick overview of the QP™ active object (actor) frameworks and the QM™ modeling and code-generation tool for QP.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,253
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • This presentation provides a quick overview of the QP™ active object (actor) frameworks and the QM™ modeling and code-generation tool for QP.
  • Quick Overview of QP Frameworks and QM Modeling Tool

    1. 1. Quick Overview of QP Frameworks & QM Modeling Tool state-machine.com
    2. 2. Presentation Outline • What is QP? What is QP? • Active Objects (Actors) for Real-Time Embedded Systems • Hierarchical State Machines (UML Statecharts) • QM--Free Graphical Modeling and Code Generation Tool • QS Software Tracing • MISRA Compliance state-machine.com 2
    3. 3. What is QP? ● Family of active object (actor) frameworks for real-time embedded (RTE) systems QP/C, QP/C++, and QP-nano state-machine.com 3
    4. 4. Where does it run? (bare metal) ● Single-chip 32-bit, 16-bit, and some 8-bit microcontrollers 32-bit (ARM): ARM Cortex-M, ARM7/9 (TI, NXP, Atmel, ST...) 32-bit (not ARM): Renesas RX, AVR32, PIC32, TI C28, C55 DSPs 16-bit: TI MSP430, Microchip PIC24/dsPIC, Renesas R8C 8-bit: AVRmega, 68HC08 state-machine.com 4
    5. 5. Where does it run? (OS/RTOS) ● QP/C and QP/C++ can run on top of an OS or RTOS Big OS: POSIX (Linux, QNX, etc.), Win32 Big OS: Qt GUI and application framework RTOS: ThreadX, uC/OS-II, ... state-machine.com 5
    6. 6. Who is using it? ● Millions of products: medical, defense, communication, transportation, industrial, consumer, ... state-machine.com 6
    7. 7. How is it licensed? ● QP frameworks are available under dual-licensing model: – – ● GPL (v3) open source license Commercial closed source licenses QM modeling tool is freeware NOTE: If your company has a policy forbidding open source in your product, QP can be licensed commercially state-machine.com 7
    8. 8. Presentation Outline • What is QP? • Active Objects (Actors) for Real-Time Embedded Systems Active Objects (Actors) for RTE Systems • Hierarchical State Machines (UML Statecharts) • QM--Free Graphical Modeling and Code Generation Tool • QS Software Tracing • MISRA Compliance state-machine.com 8
    9. 9. Active Objects (Actors) ● Active objects (actors) automatically enforce the following best practices of concurrent programming(*): 1. Keep all of the task's data local, bound to the task itself and encapsulated from the rest of the system. 2. Communicate among tasks asynchronously via intermediary event objects. This avoids blocking tasks to wait on each other. 3. Tasks should spend their lifetime responding to incoming events, so their mainline should consist of an event loop. 4. Tasks should process events one at a time (to completion), thus avoiding any concurrency hazards within a task itself. (*) Articles by: Herb Sutter, Edward E. Lee, dr. Dave Stewart, Jack Ganssle, ... state-machine.com 9
    10. 10. Active Objects for Embedded MCUs ● Active objects cannot operate in a vacuum and require a software infrastructure (framework) QP frameworks are smaller than typical bare-bones RTOSes state-machine.com 10
    11. 11. Asynchronous Communication ● All events are delivered asynchronously: 1. Each active object has its own event queue and receives all events exclusively through this queue. 2. Event producers merely post events to the AO queues but they don't wait in line for the processing of the events. state-machine.com 11
    12. 12. True Encapsulation for Concurrency ● Traditional encapsulation with synchronous methods does not encapsulate anything in terms of concurrency → AOs are the most stringent form of object-oriented programming state-machine.com 12
    13. 13. Run-to-Completion (RTC) Processing ● AOs process events one at a time (to completion) → RTC should not be confused with thread preemption → AOs can preempt each other state-machine.com 13
    14. 14. No Blocking (!) ● Event-driven AOs don't block to wait for events → Therefore AOs remain responsive to events → Easy to add new events → In contrast, all RTOS inter-task communication and synchronization is based on blocking. state-machine.com 14
    15. 15. Super-Fast Preemptive Kernel ● Non-blocking AOs can work with non-blocking kernels → Preemptive multitasking with a single stack → Fully compatible with Rate-Monotonic Analysis (RMA) → Less CPU, less RAM, shorter latencies. state-machine.com 15
    16. 16. Presentation Outline • What is QP? • Active Objects (Actors) for Real-Time Embedded Systems • HierarchicalState Machines (UML Statecharts) Hierarchical State Machines (UML Statecharts) • QM--Free Graphical Modeling and Code Generation Tool • QS Software Tracing • MISRA Compliance state-machine.com 16
    17. 17. Specifying Behavior of Active Objects ● Each Active Object in QP has a state machine → Naturally handle events based on the type and the system state → Avoids “spaghetti code”--No 1. problem of event-driven systems. state-machine.com 17
    18. 18. Transition Explosion in Traditional FSMs ● Traditional Finite State Machines inflict repetitions → There is no way to capture similar transitions state-machine.com 18
    19. 19. Reuse of Behavior Through State Nesting ● Hierarchical State Machines support state nesting → Nested states inherit the behavior from the surrounding states state-machine.com 19
    20. 20. Manual Coding of HSMs in QP/C++ QState Calc::on(Calc *me, QEvt const *e) { switch (e->sig) { case Q_ENTRY_SIG: { // entry action BSP_message("on-ENTRY"); return Q_HANDLED(); } case Q_EXIT_SIG: { // exit action BSP_message("on-EXIT"); return Q_HANDLED(); } case Q_INIT_SIG: { // initial transition BSP_message("on-INIT"); return Q_TRAN(&Calc::ready); } case C_SIG: { // state transition BSP_clear(); // clear the display return Q_TRAN(&Calc::on); } case OFF_SIG: { // state transition return Q_TRAN(&Calc::final); } } return Q_SUPER(&QHsm::top); // superstate } state-machine.com 20
    21. 21. Presentation Outline • What is QP? • Active Objects (Actors) for Real-Time Embedded Systems • Hierarchical State Machines (UML Statecharts) • QM—FreeGraphical Modeling and Code Generation Tool QM--Free Graphical and Code Generation Tool • QS Software Tracing • MISRA Compliance state-machine.com 21
    22. 22. What is QM? • Free graphical modeling and code generation tool for QP state-machine.com 22
    23. 23. How Does it Work? 1. Create AO classes 3. Add actions/guard code 2. Draw state machines 4. Generate code state-machine.com 23
    24. 24. What's Special about QM? Turning code generation upside down”... state-machine.com 24
    25. 25. Presentation Outline • What is QP? • Active Objects (Actors) for Real-Time Embedded Systems • Hierarchical State Machines (UML Statecharts) • QM--Free Graphical Modeling and Code Generation Tool • QS Software Tracing QS Software Tracing • MISRA Compliance state-machine.com 25
    26. 26. Why Software Tracing? Biggest problem: limited visibility into the embedded system → You need to observe the system live; not stopped in a debugger state-machine.com 26
    27. 27. QS Software Tracing System QS (QP Spy ) tracing provides wealth of information: → All state machine activities (entering/exiting states, transitions,...) → All event posting, event queuing, event dispatching, … → Real-time Kernel scheduling, task switches, ... state-machine.com 27
    28. 28. QSPY Host Application QSPY host application receives and displays the QS data: → Human-readable format → Interface to MATLAB/GNU-Octave → Interface to Message-Sequence-Chart (MSC) generator state-machine.com 28
    29. 29. Presentation Outline • What is QP? • Active Objects (Actors) for Real-Time Embedded Systems • Hierarchical State Machines (UML Statecharts) • QM--Free Graphical Modeling and Code Generation Tool • QS Software Tracing • MISRA Compliance MISRA Compliance state-machine.com 29
    30. 30. MISRA Compliance Safe subset of C or C++ for use in safety critical applications → MISRA Compliance Matrices for QP/C, QP/C++, and QP-nano → Complete suite of scripts and tools to automate checking of comliance of the application-level code with PC-Lint state-machine.com 30
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×