20 m_sequenceFilePath(
"<invalid_seq>"),
23 m_totalExpectedArgSize(0),
24 m_sequenceBlockState(),
29 m_sequencesStarted(0),
30 m_statementsDispatched(0),
47 this->RUN_ARGS_cmdHandler(opCode, cmdSeq, fileName, block,
Svc::SeqArgs{0, 0});
50 void FpySequencer ::RUN_ARGS_cmdHandler(
FwOpcodeType opCode,
65 this->m_savedOpCode = opCode;
66 this->m_savedCmdSeq = cmdSeq;
81 void FpySequencer::VALIDATE_cmdHandler(
FwOpcodeType opCode,
85 this->VALIDATE_ARGS_cmdHandler(opCode, cmdSeq, fileName,
Svc::SeqArgs{0, 0});
91 void FpySequencer ::VALIDATE_ARGS_cmdHandler(
FwOpcodeType opCode,
104 this->m_savedOpCode = opCode;
105 this->m_savedCmdSeq = cmdSeq;
112 void FpySequencer::RUN_VALIDATED_cmdHandler(
FwOpcodeType opCode,
125 this->m_savedOpCode = opCode;
126 this->m_savedCmdSeq = cmdSeq;
130 FpySequencer_SequenceExecutionArgs(this->m_sequenceFilePath, block, this->m_sequenceArgs));
141 void FpySequencer::CANCEL_cmdHandler(
FwOpcodeType opCode,
163 void FpySequencer::SET_BREAKPOINT_cmdHandler(
FwOpcodeType opCode,
178 void FpySequencer::BREAK_cmdHandler(
FwOpcodeType opCode,
196 void FpySequencer::CONTINUE_cmdHandler(
FwOpcodeType opCode,
214 void FpySequencer::CLEAR_BREAKPOINT_cmdHandler(
FwOpcodeType opCode,
244 void FpySequencer::DUMP_STACK_TO_FILE_cmdHandler(
FwOpcodeType opCode,
263 status = sequenceFile.
write(this->m_runtime.stack.bytes, writeSize);
314 U16 sequenceIndex =
static_cast<U16
>((cmdUid & 0xFFFF0000) >> 16);
315 U16 currentSequenceIndex =
static_cast<U16
>(this->m_sequencesStarted & 0xFFFF);
318 if (sequenceIndex != currentSequenceIndex) {
337 this->m_runtime.currentStatementOpcode);
343 if (opCode != this->m_runtime.currentCmdOpcode) {
356 U16 cmdIndex =
static_cast<U16
>(cmdUid & 0xFFFF);
358 FW_ASSERT(this->m_statementsDispatched > 0);
359 U16 currentCmdIndex =
static_cast<U16
>((this->m_statementsDispatched) & 0xFFFF);
361 if (cmdIndex != currentCmdIndex) {
379 this->m_runtime.stack.push(static_cast<I32>(response.
e));
424 this->updateDebugTelemetryStruct();
433 void FpySequencer::updateDebugTelemetryStruct() {
436 if (this->m_runtime.nextStatementIndex >= this->m_sequenceObj.get_header().get_statementCount()) {
438 this->m_debug.reachedEndOfFile =
true;
439 this->m_debug.nextStatementReadSuccess =
false;
440 this->m_debug.nextStatementOpcode = 0;
441 this->m_debug.nextCmdOpcode = 0;
442 this->m_debug.nextStatementIndex = this->m_runtime.nextStatementIndex;
443 this->m_debug.stackSize = this->m_runtime.stack.size;
447 const Fpy::Statement& nextStmt = this->m_sequenceObj.
get_statements()[this->m_runtime.nextStatementIndex];
448 DirectiveUnion directiveUnion;
449 Fw::Success status = this->deserializeDirective(nextStmt, directiveUnion);
452 this->m_debug.reachedEndOfFile =
false;
453 this->m_debug.nextStatementReadSuccess =
false;
454 this->m_debug.nextStatementOpcode = nextStmt.get_opCode();
455 this->m_debug.nextCmdOpcode = 0;
456 this->m_debug.nextStatementIndex = this->m_runtime.nextStatementIndex;
457 this->m_debug.stackSize = this->m_runtime.stack.size;
463 this->m_debug.reachedEndOfFile =
false;
464 this->m_debug.nextStatementReadSuccess =
true;
465 this->m_debug.nextStatementOpcode = nextStmt.get_opCode();
466 this->m_debug.nextCmdOpcode = directiveUnion.constCmd.get_opCode();
467 this->m_debug.nextStatementIndex = this->m_runtime.nextStatementIndex;
468 this->m_debug.stackSize = this->m_runtime.stack.size;
472 this->m_debug.reachedEndOfFile =
false;
473 this->m_debug.nextStatementReadSuccess =
true;
474 this->m_debug.nextStatementOpcode = nextStmt.get_opCode();
475 this->m_debug.nextCmdOpcode = 0;
476 this->m_debug.nextStatementIndex = this->m_runtime.nextStatementIndex;
477 this->m_debug.stackSize = this->m_runtime.stack.size;
481 this->m_debug.reachedEndOfFile =
false;
482 this->m_debug.nextStatementReadSuccess =
false;
483 this->m_debug.nextStatementOpcode = 0;
484 this->m_debug.nextCmdOpcode = 0;
485 this->m_debug.nextStatementIndex = 0;
486 this->m_debug.stackSize = 0;
506 FW_ASSERT(0, static_cast<FwAssertArgType>(
id));
511 static_cast<FwAssertArgType>(valid.
e));
514 bool FpySequencer::isRunningState(
State state) {
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
FwIdType FwOpcodeType
The type of a command opcode.
void tlmWrite_Debug_NextStatementOpcode(U8 arg, Fw::Time _tlmTime=Fw::Time())
PlatformSizeType FwSizeType
void sequencer_sendSignal_cmd_STEP()
Send signal cmd_STEP to state machine sequencer.
void sequencer_sendSignal_cmd_SET_BREAKPOINT(const Svc::FpySequencer_BreakpointArgs &value)
Send signal cmd_SET_BREAKPOINT to state machine sequencer.
sequencer is ready to load, validate and run a sequence
void tlmWrite_Debug_ReachedEndOfFile(bool arg, Fw::Time _tlmTime=Fw::Time())
void pingIn_handler(FwIndexType portNum, U32 key) override
Handler for input port pingIn.
FwIdType FwPrmIdType
The type of a parameter identifier.
sequencer is not taking any action, waiting for a time in the future to continue
enum T e
The raw enum value.
void sequencer_sendSignal_stmtResponse_success()
Send signal stmtResponse_success to state machine sequencer.
void log_WARNING_LO_CmdResponseWhileNotRunningSequence(I32 state, FwOpcodeType opcode, Fw::CmdResponse response) const
Log event CmdResponseWhileNotRunningSequence.
void tlmWrite_Debug_StackSize(Svc::Fpy::StackSizeType arg, Fw::Time _tlmTime=Fw::Time())
void sequencer_sendSignal_cmd_VALIDATE(const Svc::FpySequencer_SequenceExecutionArgs &value)
Send signal cmd_VALIDATE to state machine sequencer.
sequencer is stepping into a single statement and dispatching it
Enum representing a command response.
void tlmWrite_State(FwEnumStoreType arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_SequencesSucceeded(U64 arg, Fw::Time _tlmTime=Fw::Time())
void sequencer_sendSignal_stmtResponse_unexpected()
Send signal stmtResponse_unexpected to state machine sequencer.
void sequencer_sendSignal_cmd_BREAK()
Send signal cmd_BREAK to state machine sequencer.
void tlmWrite_PRM_STATEMENT_TIMEOUT_SECS(F32 arg, Fw::Time _tlmTime=Fw::Time())
Svc_FpySequencer_SequencerStateMachine::State sequencer_getState() const
Get the state of state machine instance sequencer.
void log_WARNING_HI_WrongCmdResponseOpcode(FwOpcodeType opcode, Fw::CmdResponse response, FwOpcodeType expectedOpcode) const
Log event WrongCmdResponseOpcode.
Os::FileInterface::Status open(const char *path, Mode mode)
open file with supplied path and mode
void tlmWrite_StatementsFailed(U64 arg, Fw::Time _tlmTime=Fw::Time())
void parametersLoaded() override
Called whenever parameters are loaded.
sequencer has validated the sequence and is waiting for a command to run it
F32 paramGet_STATEMENT_TIMEOUT_SECS(Fw::ParamValid &valid)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void tlmWrite_handler(FwIndexType portNum, U32 context) override
Handler for input port tlmWrite.
void tlmWrite_DirectiveErrorId(const Svc::Fpy::DirectiveId &arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_Debug_NextCmdOpcode(FwOpcodeType arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_PRM_SEQ_BASE_DIR(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
void sequencer_sendSignal_cmd_RUN_VALIDATED(const Svc::FpySequencer_SequenceExecutionArgs &value)
Send signal cmd_RUN_VALIDATED to state machine sequencer.
void log_WARNING_LO_CmdResponseFromOldSequence(FwOpcodeType opcode, Fw::CmdResponse response, U16 oldSequenceIdx, U16 currentSequenceIdx) const
Log event CmdResponseFromOldSequence.
Sequencer blocking state.
void sequencer_sendSignal_checkTimersIn()
Send signal checkTimersIn to state machine sequencer.
void tlmWrite_StatementsDispatched(U64 arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_LastDirectiveError(const Svc::Fpy::DirectiveErrorCode &arg, Fw::Time _tlmTime=Fw::Time())
void parameterUpdated(FwPrmIdType id) override
Called whenever a parameter is updated.
Type_of_statements & get_statements()
Get member statements.
Status write(const U8 *buffer, FwSizeType &size)
write data to this file from the supplied buffer bounded by size
void tlmWrite_Debug_NextStatementIndex(U32 arg, Fw::Time _tlmTime=Fw::Time())
const char * toChar() const
Convert to a C-style char*.
enum T e
The raw enum value.
void log_WARNING_HI_InvalidSeqRunCall(I32 state) const
Log event InvalidSeqRunCall.
Command successfully executed.
void log_WARNING_HI_FileOpenError(const Fw::StringBase &filePath, I32 errorCode) const
Log event FileOpenError.
void seqCancelIn_handler(FwIndexType portNum) override
Command had execution error.
void sequencer_sendSignal_cmd_CANCEL()
Send signal cmd_CANCEL to state machine sequencer.
void log_WARNING_HI_InvalidCommand(I32 state) const
Log event InvalidCommand.
void tlmWrite_BreakBeforeNextLine(bool arg, Fw::Time _tlmTime=Fw::Time())
void log_ACTIVITY_HI_BreakpointCleared() const
Log event BreakpointCleared.
void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) override
Handler for input port cmdResponseIn.
Fw::ParamString paramGet_SEQ_BASE_DIR(Fw::ParamValid &valid)
void tlmWrite_SequencesFailed(U64 arg, Fw::Time _tlmTime=Fw::Time())
void checkTimers_handler(FwIndexType portNum, U32 context) override
Handler for input port checkTimers.
void tlmWrite_SeqPath(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
PlatformIndexType FwIndexType
void sequencer_sendSignal_cmd_CLEAR_BREAKPOINT()
Send signal cmd_CLEAR_BREAKPOINT to state machine sequencer.
void log_WARNING_HI_InvalidSeqCancelCall(I32 state) const
Log event InvalidSeqCancelCall.
void tlmWrite_DirectiveErrorIndex(U64 arg, Fw::Time _tlmTime=Fw::Time())
RateGroupDivider component implementation.
void log_WARNING_HI_CmdResponseWhileNotAwaiting(FwOpcodeType opcode, Fw::CmdResponse response) const
Log event CmdResponseWhileNotAwaiting.
void log_WARNING_HI_CmdResponseWhileAwaitingDirective(FwOpcodeType opcode, Fw::CmdResponse response, U8 expectedDirectiveOpcode) const
Log event CmdResponseWhileAwaitingDirective.
Enum representing parameter validity.
void sequencer_sendSignal_cmd_CONTINUE()
Send signal cmd_CONTINUE to state machine sequencer.
void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args) override
Handler for input port seqRunIn.
Auto-generated base for FpySequencer component.
void sequencer_sendSignal_cmd_RUN(const Svc::FpySequencer_SequenceExecutionArgs &value)
Send signal cmd_RUN to state machine sequencer.
void log_WARNING_HI_FileWriteError(FwSizeType writeSize, const Fw::StringBase &filePath, I32 errorCode) const
Log event FileWriteError.
void tlmWrite_BreakOnlyOnceOnBreakpoint(bool arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_WrongCmdResponseIndex(FwOpcodeType opcode, Fw::CmdResponse response, U16 actualCmdIdx, U16 expectedCmdIdx) const
Log event WrongCmdResponseIndex.
void tlmWrite_SequencesCancelled(U64 arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_BreakpointInUse(bool arg, Fw::Time _tlmTime=Fw::Time())
FpySequencer(const char *const compName)
void tlmWrite_BreakpointIndex(U32 arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_Debug_NextStatementReadSuccess(bool arg, Fw::Time _tlmTime=Fw::Time())