Back to Fprime

PassiveRateGroup Component

Svc/PassiveRateGroup/docs/sdd.md

4.3.06.3 KB
Original Source

PassiveRateGroup Component

1. Introduction

Svc::PassiveRateGroup is an passive component that drives a set of components connected to Svc::Sched output ports. It contains an synchronous input Svc::Cycle port that drives all the operations. The component invokes each output port in order, passing an argument specified in the supplied context list. It tracks execution time of the cycle.

2. Requirements

The requirements for Svc::PassiveRateGroup are as follows:

RequirementDescriptionVerification Method
FPRIME-PRG-001The Svc::PassiveRateGroup component shall be passive and will be driven by an input synchronous port callInspection, Unit test
FPRIME-PRG-002The Svc::PassiveRateGroup component shall invoke its output ports in order, passing the value contained in a table based on port numberUnit Test
FPRIME-PRG-003The Svc::PassiveRateGroup component shall track the time required to execute the rate group and report it as telemetryUnit Test
FPRIME-PRG-004The Svc::PassiveRateGroup component shall track per-port execution times and high water marks when configuredUnit Test
FPRIME-PRG-005The Svc::PassiveRateGroup component shall provide a command to clear statistics and high water marksUnit Test

3. Design

3.1 Context

3.1.1 Component Diagram

The Svc::PassiveRateGroup component has the following component diagram:

3.1.2 Ports

The Svc::PassiveRateGroup component uses the following port types:

Port Data TypeNameDirectionKindUsage
Svc::CycleCycleInInputsynchronousReceive a call to run one cycle of the rate group
Svc::SchedRateGroupMemberOutOutputn/aRate group ports
Fw::CmdCmdDispInputsyncCommand receive port
Fw::CmdResponseCmdStatusOutputn/aCommand response port
Fw::CmdRegCmdRegOutputn/aCommand registration port
Fw::TlmTlmOutputn/aTelemetry port
Fw::TimeTimeOutputn/aTime get port

3.2 Functional Description

The Svc::PassiveRateGroup component has one input port that is used to drive all of the processing. The component calls the output ports in order, passing the context from the context list as the port argument.

The component must be configured via configure() with:

  • A context array of U32 values (one per output port) passed to each rate group member
  • An optional Os::RawTimeSource specifying which hardware timer to use for execution time measurements (defaults to Os::RAWTIME_DEFAULT)

The component tracks execution time statistics:

  • Overall rate group cycle time (current and maximum)
  • Per-port execution times and high water marks (when PassiveRateGroupCfg::PortCycleTime is enabled)
  • Total cycle count

These statistics can be cleared via the CLEAR_STATISTICS sync command, which resets the maximum cycle time and per-port high water marks to zero (the running cycle count is not cleared). All statistics are protected by lock-free atomic operations, making them ISR-safe and eliminating mutex overhead.

IMPORTANT - RawTimeSource Limitation: The RawTimeSource parameter in configure() only affects the end timestamp of each cycle. The start timestamp (cycleStart) comes from the cycle driver (e.g., RateGroupDriver, LinuxTimer), which constructs its Os::RawTime with RAWTIME_DEFAULT. If you configure a non-default RawTimeSource, the cycle time calculation subtracts timestamps from two different timer sources, producing meaningless results. This feature is only correct when using RAWTIME_DEFAULT (the default), or when the cycle driver is modified to use the same non-default source. There is currently no API to configure the cycle driver's timer source, so non-default configurations require custom cycle driver implementations.

3.2.1 Commands

The Svc::PassiveRateGroup component supports the following commands:

CommandDescription
CLEAR_STATISTICSClears port cycle time high water marks and maximum cycle time. Does NOT reset cycle count, which is a running total. Uses lock-free atomic operations for ISR-safe execution.

3.2.2 Telemetry

The Svc::PassiveRateGroup component provides the following telemetry channels:

ChannelTypeDescription
MaxCycleTimeU32Maximum execution time of rate group cycle (microseconds). Cleared by CLEAR_STATISTICS command. Updated only when maximum increases (update on change).
CycleTimeU32Execution time of current cycle (microseconds). Sent every cycle.
CycleCountU32Running total count of cycles executed. NOT cleared by CLEAR_STATISTICS command. Sent every cycle.
PortCycleTimeU32[PassiveRateGroupOutputPorts]Execution time for each port in the most recent cycle (microseconds). Sent every cycle (only when PassiveRateGroupCfg::PortCycleTime is enabled).
PortCycleTimeHWMU32[PassiveRateGroupOutputPorts]High water mark for each port execution time (microseconds). Cleared by CLEAR_STATISTICS command. Updated only when any high water mark increases (update on change). Only available when PassiveRateGroupCfg::PortCycleTime is enabled.

3.3 Scenarios

3.3.1 Rate Group Port Call

As described in the Functional Description section, the Svc::PassiveRateGroup component accepts calls to the CycleIn and invokes the RateGroupMemberOut ports:

Sequence Diagram

mermaid
sequenceDiagram
    participant RateGroupDriver
    participant PassiveRateGroup
    participant Callee
    RateGroupDriver ->> PassiveRateGroup: CycleIn
    loop for each callee
        PassiveRateGroup ->> Callee: RateGroupMemberOut[N]
        Callee -->> PassiveRateGroup: 
    end
    PassiveRateGroup -->> RateGroupDriver: 

3.4 State

Svc::PassiveRateGroup has no state machines.

3.5 Algorithms

Svc::PassiveRateGroup has no significant algorithms.

4. Change Log

DateDescription
2/9/2017First Draft
8/8/2026Updated to document CLEAR_STATISTICS command, telemetry channels, and standard ports. Added lock-free atomic operations for all statistics (m_maxTime and per-port HWMs) to provide ISR-safe, race-free concurrent access without mutex overhead.