20 m_sequenceFilePath(
"<invalid_seq>"),
23 m_sequenceBlockState(),
27 m_sequencesStarted(0),
28 m_statementsDispatched(0),
52 this->m_savedOpCode = opCode;
53 this->m_savedCmdSeq = cmdSeq;
67 void FpySequencer::VALIDATE_cmdHandler(
FwOpcodeType opCode,
80 this->m_savedOpCode = opCode;
81 this->m_savedCmdSeq = cmdSeq;
90 void FpySequencer::RUN_VALIDATED_cmdHandler(
93 FpySequencer_BlockState block
104 this->m_savedOpCode = opCode;
105 this->m_savedCmdSeq = cmdSeq;
119 void FpySequencer::CANCEL_cmdHandler(
FwOpcodeType opCode,
141 void FpySequencer::SET_BREAKPOINT_cmdHandler(
FwOpcodeType opCode,
156 void FpySequencer::BREAK_cmdHandler(
FwOpcodeType opCode,
174 void FpySequencer::CONTINUE_cmdHandler(
FwOpcodeType opCode,
192 void FpySequencer::CLEAR_BREAKPOINT_cmdHandler(
FwOpcodeType opCode,
223 void FpySequencer::SET_FLAG_cmdHandler(
FwOpcodeType opCode,
239 this->m_runtime.flags[flag.
e] = value;
247 void FpySequencer::DUMP_STACK_TO_FILE_cmdHandler(
FwOpcodeType opCode,
266 status = sequenceFile.
write(this->m_runtime.stack.bytes, writeSize);
317 U16 sequenceIndex =
static_cast<U16
>((cmdUid & 0xFFFF0000) >> 16);
318 U16 currentSequenceIndex =
static_cast<U16
>(this->m_sequencesStarted & 0xFFFF);
321 if (sequenceIndex != currentSequenceIndex) {
340 this->m_runtime.currentStatementOpcode);
346 if (opCode != this->m_runtime.currentCmdOpcode) {
359 U16 cmdIndex =
static_cast<U16
>(cmdUid & 0xFFFF);
361 FW_ASSERT(this->m_statementsDispatched > 0);
362 U16 currentCmdIndex =
static_cast<U16
>((this->m_statementsDispatched) & 0xFFFF);
364 if (cmdIndex != currentCmdIndex) {
390 this->m_runtime.stack.push(static_cast<I32>(response.
e));
425 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.stackSize = this->m_runtime.stack.size;
446 const Fpy::Statement& nextStmt = this->m_sequenceObj.
get_statements()[this->m_runtime.nextStatementIndex];
447 DirectiveUnion directiveUnion;
448 Fw::Success status = this->deserializeDirective(nextStmt, directiveUnion);
451 this->m_debug.reachedEndOfFile =
false;
452 this->m_debug.nextStatementReadSuccess =
false;
453 this->m_debug.nextStatementOpcode = nextStmt.get_opCode();
454 this->m_debug.nextCmdOpcode = 0;
455 this->m_debug.stackSize = this->m_runtime.stack.size;
461 this->m_debug.reachedEndOfFile =
false;
462 this->m_debug.nextStatementReadSuccess =
true;
463 this->m_debug.nextStatementOpcode = nextStmt.get_opCode();
464 this->m_debug.nextCmdOpcode = directiveUnion.constCmd.get_opCode();
465 this->m_debug.stackSize = this->m_runtime.stack.size;
469 this->m_debug.reachedEndOfFile =
false;
470 this->m_debug.nextStatementReadSuccess =
true;
471 this->m_debug.nextStatementOpcode = nextStmt.get_opCode();
472 this->m_debug.nextCmdOpcode = 0;
473 this->m_debug.stackSize = this->m_runtime.stack.size;
477 this->m_debug.reachedEndOfFile =
false;
478 this->m_debug.nextStatementReadSuccess =
false;
479 this->m_debug.nextStatementOpcode = 0;
480 this->m_debug.nextCmdOpcode = 0;
481 this->m_debug.stackSize = 0;
489 static_cast<FwAssertArgType>(valid.
e));
492 static_cast<FwAssertArgType>(valid.
e));
507 FW_ASSERT(0, static_cast<FwAssertArgType>(
id));
512 bool FpySequencer::isRunningState(
State state) {
void tlmWrite_PRM_FLAG_DEFAULT_EXIT_ON_CMD_FAIL(bool arg, Fw::Time _tlmTime=Fw::Time())
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.
void tlmWrite_Debug_ReachedEndOfFile(bool arg, Fw::Time _tlmTime=Fw::Time())
void pingIn_handler(FwIndexType portNum, U32 key) override
Handler for input port pingIn.
the default value of the EXIT_ON_CMD_FAIL sequence flag
FwIdType FwPrmIdType
The type of a parameter identifier.
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.
Os::FileInterface::Status open(const char *path, Mode mode)
open file with supplied path and mode
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())
void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename) override
Handler for input port seqRunIn.
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.
void tlmWrite_StatementsFailed(U64 arg, Fw::Time _tlmTime=Fw::Time())
void parametersLoaded() override
Called whenever parameters are loaded.
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 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.
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())
sequencer is not taking any action, waiting for a time in the future to continue
void parameterUpdated(FwPrmIdType id) override
Called whenever a parameter is updated.
sequencer is ready to load, validate and run a sequence
void sequencer_sendSignal_stmtResponse_failure()
Send signal stmtResponse_failure to state machine sequencer.
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 log_WARNING_HI_CommandFailed(FwOpcodeType opCode, U32 stmtIdx, const Fw::StringBase &filePath, Fw::CmdResponse response) const
Log event CommandFailed.
void log_WARNING_HI_InvalidSeqRunCall(I32 state) const
Log event InvalidSeqRunCall.
Command successfully executed.
if true, the sequence will exit with an error if a command fails
void log_WARNING_HI_FileOpenError(const Fw::StringBase &filePath, I32 errorCode) const
Log event FileOpenError.
Command had execution error.
void sequencer_sendSignal_cmd_CANCEL()
Send signal cmd_CANCEL to state machine sequencer.
const char * toChar() const
Convert to a C-style char*.
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.
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
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
sequencer is stepping into a single statement and dispatching it
void sequencer_sendSignal_cmd_CLEAR_BREAKPOINT()
Send signal cmd_CLEAR_BREAKPOINT to state machine sequencer.
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.
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.
sequencer has validated the sequence and is waiting for a command to run it
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())
bool paramGet_FLAG_DEFAULT_EXIT_ON_CMD_FAIL(Fw::ParamValid &valid)
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())