Quick Overview of QP Frameworks and QM Modeling Tool
Upcoming SlideShare
Loading in...5
×
 

Quick Overview of QP Frameworks and QM Modeling Tool

on

  • 807 views

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

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

Statistics

Views

Total Views
807
Views on SlideShare
807
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • This presentation provides a quick overview of the QP™ active object (actor) frameworks and the QM™ modeling and code-generation tool for QP. <br />

Quick Overview of QP Frameworks and QM Modeling Tool Quick Overview of QP Frameworks and QM Modeling Tool Presentation Transcript

  • 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 State Machines (UML Statecharts) • QM--Free Graphical Modeling and Code Generation Tool • QS Software Tracing • MISRA Compliance state-machine.com 2
  • 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
  • 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
  • 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
  • Who is using it? ● Millions of products: medical, defense, communication, transportation, industrial, consumer, ... state-machine.com 6
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • Transition Explosion in Traditional FSMs ● Traditional Finite State Machines inflict repetitions → There is no way to capture similar transitions state-machine.com 18
  • 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
  • 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
  • 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
  • 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-machine.com 23
  • 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 (UML Statecharts) • QM--Free Graphical Modeling and Code Generation Tool • QS Software Tracing QS Software Tracing • MISRA Compliance state-machine.com 25
  • 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
  • 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
  • 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
  • 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
  • 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