Skip to content

Conversation

lsk567
Copy link
Contributor

@lsk567 lsk567 commented Aug 4, 2025

Related Issue(s)
Has Unit Tests (y/n) y
Documentation Included (y/n) y

Change Description

This PR brings an ActivePhaser component to the Svc directory, which was originally written by @LeStarch.

phaser_diagram

Rationale

ActivePhaser is a scheduling component that provides fine-grained control over the timing of port calls, including specifying start times and lengths. For applications that require more timing guarantees, this component can serve as a suitable alternative to rate groups.

Testing/Review Recommendations

Future Work

  • Complete the sdd.
  • Address a few FIXMEs in the code.

@LeStarch LeStarch added the Deferred To Next Release This PR is marked as deferred until after the upcoming release. label Aug 4, 2025
@thomas-bc
Copy link
Collaborator

Please run formatting on this contribution, we are adding formatting check to CI

fprime-util format --dirs Svc/ActivePhaser

@LeStarch LeStarch removed the Deferred To Next Release This PR is marked as deferred until after the upcoming release. label Aug 7, 2025
@lsk567 lsk567 marked this pull request as ready for review August 12, 2025 02:22
m_cycle = cycle_ticks;
}

void ActivePhaser ::register_phased(FwIndexType port, U32 length, U32 start, U32 context) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
// Handler implementations for user-defined internal interfaces
// ----------------------------------------------------------------------

void ActivePhaser ::Tick_internalInterfaceHandler() {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
return false;
}

void ActivePhaser ::startChild(U32 full_ticks) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
// Component construction and destruction
// ----------------------------------------------------------------------

ActivePhaser ::ActivePhaser(const char* const compName)

Check notice

Code scanning / CodeQL

Use of basic integral type Note

compName uses the basic integral type char rather than a typedef with size and signedness.
void ActivePhaser ::init(const FwSizeType queueDepth, const FwIndexType instance) {
FW_ASSERT(queueDepth == 1, static_cast<FwAssertArgType>(
queueDepth)); // Dependent on queue-depth of one to prevent a rush to catch up
ActivePhaserComponentBase::init(1, instance);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter instance has not been checked.
}
}

ActivePhaser::FinishStatus ActivePhaser ::finishChild(U32 full_ticks) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
m_state.used += 1;
}

ActivePhaser ::~ActivePhaser() {}

Check notice

Code scanning / CodeQL

More than one statement per line Note

This line contains 2 statements; only one is allowed.
@thomas-bc thomas-bc merged commit c8e2d44 into nasa:devel Sep 10, 2025
52 of 53 checks passed
thomas-bc pushed a commit to thomas-bc/fprime that referenced this pull request Sep 10, 2025
* Initial open source review of active phaser

* Start working on ActivePhaser's FPP model

* Add ActivePhaser implementation

* Start working on unit tests

* Fill in test logic

* Add comments

* Guard against writing outside of container

* Add comment

* Update comments

* Fix comment on overflow

* Comment on the use of actual_start and others

* Add comments and max connection count

* Add comments

* Phaser updates

* Add telemetry channels

* Update comments, fix FPP, update API calls in tester

* Apply formatter

* Minor comment change

* Fix spelling

* First draft of SDD

* Revert "Add telemetry channels"

This reverts commit 1690e51.

* PRIVATE -> private

* Add friend class declaration for ActivePhaserTester

* Fix FIXMEs where possible

* Formatting

* Fix minor UT issues

* Remove (void)

---------

Co-authored-by: ZIIIKT <[email protected]>
Co-authored-by: M Starch <[email protected]>
Co-authored-by: Michael D Starch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants