QP/C++ 8.1.3
Real-Time Event Framework
Loading...
Searching...
No Matches
Non-Preemptive Kernel

Software TracingPreemptive Non-Blocking Kernel

Remarks
The concepts & definitions related to this SRS section are provided in Annex A: Concepts & Definitions, Section Non-Preemptive Kernel.

Requirements


SRS_QP_QV_00

QP/C++ Framework component shall provide non-preemptive QV kernel as one of the built-in kernels.

Description
QP/C++ Framework component shall provide the QV kernel implementation and ports to the supported CPU/compiler combinations as one of the optional software components. QP/C++ Application can then choose the QV kernel to execute Active Objects. Such a selection is exclusive, meaning that when the QP/C++ Application selects the QV kernel, other kernels are excluded and cannot be used.

Description
QP/C++ Framework component can implement the QV kernel component by reusing already existing mechanisms, such as event queues for Active Objects, event delivery mechanisms, event memory management, etc. That way, the QV kernel implementation can be quite small and consist only of the missing pieces, such as the "superloop" with the QV scheduler.

Forward Traceability (truncated to 2 level(s))



SRS_QP_QV_10

QV kernel shall provide an idle-callback defined in QP/C++ Application.

Description
When no events are available in a given pass through the "superloop" (see Figure SRS-QV-SCH), the QV kernel executes idle processing. This idle processing shall invoke an idle-callback (a function) defined in QP/C++ Application. The idle-callback can perform any processing, including putting the CPU and peripherals in a low-power sleep mode.

Note
The idle-processing of the QV kernel can be viewed as the lowest-priority task that other Active Objects can't preempt. Consequently, the idle-processing time also counts as another RTC step, which must be considered for the task-level response of the QV kernel.

Use Case
The idle-callback can perform Software Tracing data transfer to the host, or other processing.

Forward Traceability (truncated to 2 level(s))



SRS_QP_QV_11

The idle-callback shall be invoked with interrupts disabled to allow a safe transition to a low-power sleep mode.

Description
As described in Section Idle Processing in QV, a safe transition to low-power sleep mode requires the QV idle-callback to be invoked with interrupts disabled (inside the same critical section as the detection of the idle condition).

Forward Traceability (truncated to 2 level(s))



SRS_QP_QV_12

The idle-callback shall always return with interrupts enabled.

Description
Regardless of whether the idle-callback switches to a low-power mode, QP/C++ Application must define the idle-callback such that it re-enables interrupts in every path through the code. The QV kernel assumes that this will be the case, and will not work correctly if the idle-callback fails to enable interrupts.

Forward Traceability (truncated to 2 level(s))



SRS_QP_QV_20

QV kernel may provide API to selectively turn off scheduling Active Objects below the specified scheduler-disable ceiling priority.

Description
The selective scheduler disabling API shall prevent scheduling any Active Object whose unique priority is below the specified scheduler-disable ceiling priority.

Use Case
The main use case for selective scheduler disabling is in time-triggered designs and Active Objects with multi-stage processing. An Active Object that breaks up its long RTC steps into shorter pieces (multi-stage processing) would self-post a special "Reminder" event to trigger subsequent stages of processing. However, to prevent such processing from overrunning the next clock period, the Active Object can explicitly turn off the QV scheduler up to its priority level.

Forward Traceability (truncated to 2 level(s))



SRS_QP_QV_21

QV kernel may provide the API to enable the scheduler to match the API for disabling the scheduler.

Description
If the QV kernel provides the API to selectively disable the scheduler, it must also provide the complementary API to enable the scheduler (see SRS_QP_QV_20). The scheduler enabling API shall restore the scheduler-disable ceiling established in the most recent call to the scheduler disabling API.

Use Case
The main use case for scheduler enabling (matching the use case in SRS_QP_QV_20) is enabling the QV scheduler in the system clock tick.

Forward Traceability (truncated to 2 level(s))


Software TracingPreemptive Non-Blocking Kernel