-
Notifications
You must be signed in to change notification settings - Fork 1.7k
FpySequencer Fix no response from validate, refactor to prevent this class of issu… #5315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zimri-leisher
wants to merge
5
commits into
nasa:devel
Choose a base branch
from
zimri-leisher:5314-fpy-validate-no-cmd-resp
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9f90b5e
Fix no response from validate, refactor to prevent this class of issu…
zimri-leisher 26c0544
Get tests passing
zimri-leisher 438e12b
Update state machine sdd
zimri-leisher 580aa46
fmt
zimri-leisher 99db183
Merge branch 'devel' into 5314-fpy-validate-no-cmd-resp
LeStarch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -258,28 +258,10 @@ class FpySequencer : public FpySequencerComponentBase { | |
| Svc_FpySequencer_SequencerStateMachine::Signal signal //!< The signal | ||
| ) override; | ||
|
|
||
| //! Implementation for action setSequenceFilePath of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! Implementation for action setSequenceExecArgs of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! | ||
| //! sets the current sequence file path member var | ||
| void Svc_FpySequencer_SequencerStateMachine_action_setSequenceFilePath( | ||
| SmId smId, //!< The state machine id | ||
| Svc_FpySequencer_SequencerStateMachine::Signal signal, //!< The signal | ||
| const Svc::FpySequencer_SequenceExecutionArgs& value //!< The value | ||
| ) override; | ||
|
|
||
| //! Implementation for action setSequenceBlockState of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! | ||
| //! sets the block state of the sequence to be run | ||
| void Svc_FpySequencer_SequencerStateMachine_action_setSequenceBlockState( | ||
| SmId smId, //!< The state machine id | ||
| Svc_FpySequencer_SequencerStateMachine::Signal signal, //!< The signal | ||
| const Svc::FpySequencer_SequenceExecutionArgs& value //!< The value | ||
| ) override; | ||
|
|
||
| //! Implementation for action setSequenceArguments of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! | ||
| //! sets the arguments to pass to the sequence | ||
| void Svc_FpySequencer_SequencerStateMachine_action_setSequenceArguments( | ||
| //! sets the sequence execution arguments (seq path, block state, seq args) | ||
| void Svc_FpySequencer_SequencerStateMachine_action_setSequenceExecArgs( | ||
| SmId smId, //!< The state machine id | ||
| Svc_FpySequencer_SequencerStateMachine::Signal signal, //!< The signal | ||
| const Svc::FpySequencer_SequenceExecutionArgs& value //!< The value | ||
|
|
@@ -358,22 +340,6 @@ class FpySequencer : public FpySequencerComponentBase { | |
| Svc_FpySequencer_SequencerStateMachine::Signal signal //!< The signal | ||
| ) override; | ||
|
|
||
| //! Implementation for action clearSequenceFile of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! | ||
| //! clears all variables related to the loading/validating of the sequence file | ||
| void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceFile( | ||
| SmId smId, //!< The state machine id | ||
| Svc_FpySequencer_SequencerStateMachine::Signal signal //!< The signal | ||
| ) override; | ||
|
|
||
| //! Implementation for action clearSequenceArguments of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! | ||
| //! clears arguments | ||
| void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceArguments( | ||
| SmId smId, //!< The state machine id | ||
| Svc_FpySequencer_SequencerStateMachine::Signal signal //!< The signal | ||
| ) override; | ||
|
|
||
| //! Implementation for action checkShouldWake of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! | ||
| //! checks if sequencer should wake from sleep | ||
|
|
@@ -422,6 +388,15 @@ class FpySequencer : public FpySequencerComponentBase { | |
| Svc_FpySequencer_SequencerStateMachine::Signal signal //!< The signal | ||
| ) override; | ||
|
|
||
| //! Implementation for action clearSequenceExecArgs of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! | ||
| //! clears the sequence execution arguments (seq path, block state, seq args) | ||
| //! and the m_fullSequenceFilePath member var | ||
| void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceExecArgs( | ||
| SmId smId, //!< The state machine id | ||
| Svc_FpySequencer_SequencerStateMachine::Signal signal //!< The signal | ||
| ) override; | ||
|
|
||
| //! Implementation for action report_seqBroken of state machine Svc_FpySequencer_SequencerStateMachine | ||
| //! | ||
| //! reports that a breakpoint was hit | ||
|
|
@@ -645,29 +620,31 @@ class FpySequencer : public FpySequencerComponentBase { | |
| // id of allocator that gave us m_sequenceBuffer | ||
| FwEnumStoreType m_allocatorId; | ||
|
|
||
| // assigned by the user via cmd | ||
| // length is FileNameStringSize | ||
| Fw::FileNameString m_sequenceFilePath; | ||
| // the execution arguments of the sequence: | ||
| // * the file name | ||
| // * the block state | ||
| // * the sequence runtime args | ||
| // See the struct member docstrings for more info | ||
| Svc::FpySequencer_SequenceExecutionArgs m_sequenceExecArgs; | ||
|
|
||
| // the full (including the SEQ_BASE_DIR prefix) path | ||
| // to the sequence file. Note: not updated until validate() is run | ||
| Fw::FileNameString m_fullSequenceFilePath; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the file name provided in the sequence exec args is not the "final" filename that we actually try to open. we need to prefix with seq base dir first. |
||
|
|
||
| // the sequence, loaded in memory | ||
| Fpy::Sequence m_sequenceObj; | ||
| // live running computation of CRC (updated as we read) | ||
| Utils::Hash m_computedCRC; | ||
|
|
||
| // Size of arguments read in current sequence. Used for validation between | ||
| // User provided arguments and what is requested of the sequence. | ||
| // user provided arguments and what is requested of the sequence. | ||
| Fpy::StackSizeType m_totalExpectedArgSize; | ||
|
|
||
| // whether or not the sequence we're about to run should return immediately or | ||
| // block on completion | ||
| Svc::BlockState m_sequenceBlockState; | ||
| // if we are to block on completion, save the opCode and cmdSeq we should | ||
| // return | ||
| FwOpcodeType m_savedOpCode; | ||
| U32 m_savedCmdSeq; | ||
|
|
||
| // sequence arguments to push to stack when entering RUNNING state | ||
| Svc::SeqArgs m_sequenceArgs{}; | ||
|
|
||
| // the goal state is the state that we're trying to reach in the sequencer | ||
| // if it's RUNNING, then we should promptly go to RUNNING once we validate the | ||
| // sequence. if it's VALID, we should wait after VALIDATING | ||
|
|
@@ -762,6 +739,12 @@ class FpySequencer : public FpySequencerComponentBase { | |
| // Validation state | ||
| // ---------------------------------------------------------------------- | ||
|
|
||
| // returns the base directory against which sequence file paths are resolved | ||
| // in validate(). defaults to the SEQ_BASE_DIR config constant. declared | ||
| // virtual so that unit tests (and specialized deployments) can swap out the | ||
| // base dir, since SEQ_BASE_DIR is otherwise fixed at compile time | ||
| virtual const char* getSequenceBaseDir() const; | ||
|
|
||
| // loads the sequence in memory, and does header/crc/integrity checks. | ||
| // return SUCCESS if sequence is valid, FAILURE otherwise | ||
| Fw::Success validate(); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to begin running the sequence, we need these three args (filename, block state and seq runtime args). Store them all in a single struct so updates to them can be "atomic"