+ All Categories
Home > Technology > Quick Overview of QP Frameworks and QM Tool

Quick Overview of QP Frameworks and QM Tool

Date post: 23-Jun-2015
Category:
Upload: miro-samek
View: 21,229 times
Download: 1 times
Share this document with a friend
Description:
* Components of QP* Active object computing model* Event delivery mechanisms* Cooperative and preemptive kernels* Reuse of behavior in hierarchical state machines* Manual coding of HSMs* Automatic code generation with QM* QP customers and markets* Supported processors* Supported RTOSes/OSes and middleware*
Popular Tags:
16
1 © Quantum Leaps state-machine.com Quick Overview of QP Frameworks and QM Tool [email protected]
Transcript
Page 1: Quick Overview of QP Frameworks and QM Tool

1© Quantum Leapsstate-machine.com

Quick Overview ofQP Frameworks and QM Tool

[email protected]

Page 2: Quick Overview of QP Frameworks and QM Tool

2 2© Quantum Leapsstate-machine.com

QP state machine frameworksQP combines:● Hierarchical state machines (QEP)● Event-driven framework (QF)● Real-time kernels (QK/Vanilla/RTOS)● Software tracing (QS)

Page 3: Quick Overview of QP Frameworks and QM Tool

3 3© Quantum Leapsstate-machine.com

Active Object Computing Model

ISR1 ISR2

. . .

events

eventqueue

e = queue.get();

dispatch(e);

active object’sevent loop

init();

(a) (b)

internal statemachine

activeobject

blockingoperation

Page 4: Quick Overview of QP Frameworks and QM Tool

4 4© Quantum Leapsstate-machine.com

Event delivery mechanisms

ISR_1() ISR_2()

Active Object 1

Active Object 2

Active Object N

directevent posting

publish-subscribe “software bus”

. . .

multicasting a published event

Page 5: Quick Overview of QP Frameworks and QM Tool

5 5© Quantum Leapsstate-machine.com

Execution Profiles of Vanilla and QK Kernels(a)

low-priority task time

prio

rity

high-priority task

low-priority task

interruptentry

blocking callor explicit yield

interruptreturn

K

kernel

(b)

low-priority task time

high-priority task

low-priority task

interruptentry

context switch

interrupt return

K

kernel

(2a)

(3a)

(4a)

(1a) (5a) (6a)

(1b)

(2b)

(3b) (4b)ISR

(5b)

(6b)

(7b)

ISR producesevent for high-priority task

prio

rity

ISR producesevent for high-priority task

ISR

K

preempted

Page 6: Quick Overview of QP Frameworks and QM Tool

6 6© Quantum Leapsstate-machine.com

State-transition explosion

operand1

OPER

opEntered

operand2DIGIT_0_9, POINT

EQUALS

result

DIGIT_0_9, POINT

OPER

C

C

C

C

OFF

OFF

OFF

OFF Traditional state machines “explode”– Because of the

repetitions

Page 7: Quick Overview of QP Frameworks and QM Tool

7 7© Quantum Leapsstate-machine.com

Reuse of behavior through state nestingon

operand1

OPER

opEntered

operand2

DIGIT_0_9, POINTEQUALS

resultDIGIT_0_9, POINTOPER

C

OFFHierarchical state machines don't explode– Because they reuse

behavior

Page 8: Quick Overview of QP Frameworks and QM Tool

8 8© Quantum Leapsstate-machine.com

Manual coding a HSM in QP/C++QState Calc::on(Calc *me, QEvent 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}

top

entry /exit /

on

. . .

. . .

readyC

. . .

. . .

OFF

Page 9: Quick Overview of QP Frameworks and QM Tool

9 9© Quantum Leapsstate-machine.com

Automatic coding a HSM with QM

Page 10: Quick Overview of QP Frameworks and QM Tool

10 10© Quantum Leapsstate-machine.com

Main benefits of QPHigher level of abstraction than RTOS (productivity)● You work at the level of events

and state machines, not the raw RTOS● Your design is more structured,

maintainable, testable, and robust

Safer programming model● You don't need to use semaphores,

and other such troublesome RTOS mechanisms

More efficient in time and space● You use less CPU (no blocking) and less RAM (less stack space)● QP is smaller in RAM use and code size (ROM) than any RTOS!

Page 11: Quick Overview of QP Frameworks and QM Tool

11 11© Quantum Leapsstate-machine.com

Who is using QP?

Page 12: Quick Overview of QP Frameworks and QM Tool

12 12© Quantum Leapsstate-machine.com

Supported processors (bare metal)QP is very portable to 8-, 16-, 32-bit MCUs● ARM7/9, ARM Cortex● ColdFire● Nios II● M16C/R8C/M32C, H8

● MSP430● AVRmega, AVRXmega● TMS320C28● PsoC● others upon request...

Page 13: Quick Overview of QP Frameworks and QM Tool

13 13© Quantum Leapsstate-machine.com

Supported operating systemsQP can work with traditional OS/RTOS● Linux/embedded Linux● QNX, Integrity (POSIX)● Windows/WindowsCE● VxWorks

● ThreadX● eCos● uC/OS-II● FreeRTOS.org● others...

Page 14: Quick Overview of QP Frameworks and QM Tool

14 14© Quantum Leapsstate-machine.com

Supported middlewareQP can work with middleware directly (bare metal)● LwIP embedded TCP/IP stack● emWin / uC/GUI embedded GUI● others upon request...

Page 15: Quick Overview of QP Frameworks and QM Tool

15 15© Quantum Leapsstate-machine.com

QM graphical modeling toolQP is supported by the free graphical QM modeling tool● Best-in-class state machine diagramming● Automatic code generation based on QP

Page 16: Quick Overview of QP Frameworks and QM Tool

16 16© Quantum Leapsstate-machine.com

SummaryQP is a lightweight event-driven, state machine framework

Higher level of abstraction (productivity) and safer than a raw RTOSExcellent documentation (books, application notes, articles, manuals)

QP has been used by hundreds of companies worldwideMarkets: consumer, industrial, communication, medical, defense

QP is supported by the free QM graphical modeling tool


Recommended