7 #ifndef FpySequencer_HPP 8 #define FpySequencer_HPP 25 "Sequence arg count must be below U8 max");
26 static_assert(
Svc::Fpy::NUM_REGISTERS <= std::numeric_limits<U8>::max(),
"Register count must be below U8 max");
28 "Sequence statement count must be below U16 max");
30 "Local variable buffer size must be below FwSizeType max");
32 "Local variable buffer size must be greater than FW_TLM_BUFFER_MAX_SIZE");
34 "Local variable buffer size must be greater than FW_PARAM_BUFFER_MAX_SIZE");
118 void DEBUG_SET_BREAKPOINT_cmdHandler(
FwOpcodeType opCode,
146 void DEBUG_CLEAR_BREAKPOINT_cmdHandler(
FwOpcodeType opCode,
157 void Svc_FpySequencer_SequencerStateMachine_action_signalEntered(
165 void Svc_FpySequencer_SequencerStateMachine_action_setSequenceFilePath(
174 void Svc_FpySequencer_SequencerStateMachine_action_setSequenceBlockState(
183 void Svc_FpySequencer_SequencerStateMachine_action_validate(
191 void Svc_FpySequencer_SequencerStateMachine_action_report_seqSucceeded(
199 void Svc_FpySequencer_SequencerStateMachine_action_report_seqCancelled(
207 void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_RUNNING(
215 void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_VALID(
223 void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_IDLE(
231 void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_OK(
240 void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_EXECUTION_ERROR(
248 void Svc_FpySequencer_SequencerStateMachine_action_dispatchStatement(
256 void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceFile(
264 void Svc_FpySequencer_SequencerStateMachine_action_checkShouldWake(
272 void Svc_FpySequencer_SequencerStateMachine_action_resetRuntime(
280 void Svc_FpySequencer_SequencerStateMachine_action_checkStatementTimeout(
288 void Svc_FpySequencer_SequencerStateMachine_action_incrementSequenceCounter(
296 void Svc_FpySequencer_SequencerStateMachine_action_clearDebugBreakpoint(
304 void Svc_FpySequencer_SequencerStateMachine_action_report_debugBroken(
312 void Svc_FpySequencer_SequencerStateMachine_action_setDebugBreakpoint(
321 void Svc_FpySequencer_SequencerStateMachine_action_report_seqFailed(
329 void Svc_FpySequencer_SequencerStateMachine_action_report_seqStarted(
446 static constexpr U32 CRC_INITIAL_VALUE = 0xFFFFFFFFU;
474 U64 m_sequencesStarted;
477 U64 m_statementsDispatched;
486 U32 nextStatementIndex = 0;
517 bool breakOnBreakpoint =
false;
519 bool breakOnlyOnceOnBreakpoint =
false;
521 U32 breakpointIndex = 0;
526 U64 statementsFailed = 0;
529 U64 sequencesSucceeded = 0;
532 U64 sequencesFailed = 0;
535 U64 sequencesCancelled = 0;
545 static void updateCrc(U32& crc,
569 const FpySequencer_FileReadStage& readStage,
570 bool updateCrc =
true);
577 Signal dispatchStatement();
582 Fw::Success deserializeDirective(
const Fpy::Statement& stmt, DirectiveUnion& deserializedDirective);
585 void dispatchDirective(
const DirectiveUnion& directive,
const Fpy::DirectiveId&
id);
588 Signal checkStatementTimeout();
594 bool isRunningState(
State state);
597 FpySequencer_DebugTelemetry getDebugTelemetry();
604 void sendSignal(
Signal signal);
612 Signal waitRel_directiveHandler(
const FpySequencer_WaitRelDirective& directive,
DirectiveError& error);
613 Signal waitAbs_directiveHandler(
const FpySequencer_WaitAbsDirective& directive,
DirectiveError& error);
614 Signal setSerReg_directiveHandler(
const FpySequencer_SetSerRegDirective& directive,
DirectiveError& error);
615 Signal goto_directiveHandler(
const FpySequencer_GotoDirective& directive,
DirectiveError& error);
617 Signal noOp_directiveHandler(
const FpySequencer_NoOpDirective& directive,
DirectiveError& error);
618 Signal getTlm_directiveHandler(
const FpySequencer_GetTlmDirective& directive,
DirectiveError& error);
619 Signal getPrm_directiveHandler(
const FpySequencer_GetPrmDirective& directive,
DirectiveError& error);
621 Signal deserSerReg_directiveHandler(
const FpySequencer_DeserSerRegDirective& directive,
DirectiveError& error);
622 Signal setReg_directiveHandler(
const FpySequencer_SetRegDirective& directive,
DirectiveError& error);
624 Signal binaryRegOp_directiveHandler(
const FpySequencer_BinaryRegOpDirective& directive,
DirectiveError& error);
625 I64 binaryRegOp_or(I64 lhs, I64 rhs);
626 I64 binaryRegOp_and(I64 lhs, I64 rhs);
627 I64 binaryRegOp_ieq(I64 lhs, I64 rhs);
628 I64 binaryRegOp_ine(I64 lhs, I64 rhs);
629 I64 binaryRegOp_ult(I64 lhs, I64 rhs);
630 I64 binaryRegOp_ule(I64 lhs, I64 rhs);
631 I64 binaryRegOp_ugt(I64 lhs, I64 rhs);
632 I64 binaryRegOp_uge(I64 lhs, I64 rhs);
633 I64 binaryRegOp_slt(I64 lhs, I64 rhs);
634 I64 binaryRegOp_sle(I64 lhs, I64 rhs);
635 I64 binaryRegOp_sgt(I64 lhs, I64 rhs);
636 I64 binaryRegOp_sge(I64 lhs, I64 rhs);
637 I64 binaryRegOp_feq(I64 lhs, I64 rhs);
638 I64 binaryRegOp_fne(I64 lhs, I64 rhs);
639 I64 binaryRegOp_flt(I64 lhs, I64 rhs);
640 I64 binaryRegOp_fle(I64 lhs, I64 rhs);
641 I64 binaryRegOp_fgt(I64 lhs, I64 rhs);
642 I64 binaryRegOp_fge(I64 lhs, I64 rhs);
644 Signal unaryRegOp_directiveHandler(
const FpySequencer_UnaryRegOpDirective& directive,
DirectiveError& error);
645 I64 unaryRegOp_not(I64 src);
646 I64 unaryRegOp_fpext(I64 src);
647 I64 unaryRegOp_fptrunc(I64 src);
648 I64 unaryRegOp_fptoui(I64 src);
649 I64 unaryRegOp_fptosi(I64 src);
650 I64 unaryRegOp_sitofp(I64 src);
651 I64 unaryRegOp_uitofp(I64 src);
653 Signal exit_directiveHandler(
const FpySequencer_ExitDirective& directive,
DirectiveError& error);
deser up to 8 bytes out of an serReg
FpySequencer_SetSerRegDirective setSerReg
FwIdType FwOpcodeType
The type of a command opcode.
void directive_if_internalInterfaceHandler(const Svc::FpySequencer_IfDirective &directive) override
Internal interface handler for directive_if.
PlatformSizeType FwSizeType
FpySequencer_GotoDirective gotoDirective
bool Svc_FpySequencer_SequencerStateMachine_guard_goalStateIs_RUNNING(SmId smId, Svc_FpySequencer_SequencerStateMachine::Signal signal) const override
performs a unary reg operation on src reg, and stores in res reg
void pingIn_handler(FwIndexType portNum, U32 key) override
Handler for input port pingIn.
void directive_getPrm_internalInterfaceHandler(const Svc::FpySequencer_GetPrmDirective &directive) override
Internal interface handler for directive_getPrm.
FpySequencer_UnaryRegOpDirective unaryRegOp
FwIdType FwPrmIdType
The type of a parameter identifier.
void directive_binaryRegOp_internalInterfaceHandler(const Svc::FpySequencer_BinaryRegOpDirective &directive) override
Internal interface handler for directive_binaryRegOp.
U8 value[Fpy::MAX_SERIALIZABLE_REGISTER_SIZE]
void directive_cmd_internalInterfaceHandler(const Svc::FpySequencer_CmdDirective &directive) override
Internal interface handler for directive_cmd.
FpySequencer_WaitRelDirective waitRel
SmId
State machine identifiers.
FpySequencer_WaitAbsDirective waitAbs
Enum representing a command response.
void directive_setReg_internalInterfaceHandler(const Svc::FpySequencer_SetRegDirective &directive) override
Internal interface handler for directive_setReg.
void directive_getTlm_internalInterfaceHandler(const Svc::FpySequencer_GetTlmDirective &directive) override
Internal interface handler for directive_getTlm.
FpySequencer_IfDirective ifDirective
FpySequencer_NoOpDirective noOp
void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename) override
Handler for input port seqRunIn.
FpySequencer_SetRegDirective setReg
void directive_waitRel_internalInterfaceHandler(const FpySequencer_WaitRelDirective &directive) override
Internal interface handler for directive_waitRel.
void directive_noOp_internalInterfaceHandler(const Svc::FpySequencer_NoOpDirective &directive) override
Internal interface handler for directive_noOp.
void directive_unaryRegOp_internalInterfaceHandler(const Svc::FpySequencer_UnaryRegOpDirective &directive) override
Internal interface handler for directive_unaryRegOp.
void parametersLoaded() override
Called whenever parameters are loaded.
FpySequencer_CmdDirective cmd
FpySequencer_DirectiveErrorCode DirectiveError
void tlmWrite_handler(FwIndexType portNum, U32 context) override
Handler for input port tlmWrite.
void directive_deserSerReg_internalInterfaceHandler(const Svc::FpySequencer_DeserSerRegDirective &directive) override
Internal interface handler for directive_deserSerReg.
void directive_exit_internalInterfaceHandler(const Svc::FpySequencer_ExitDirective &directive) override
Internal interface handler for directive_exit.
External serialize buffer with no copy semantics.
#define FW_TLM_BUFFER_MAX_SIZE
FpySequencer_SequencerStateMachineStateMachineBase::State State
void directive_waitAbs_internalInterfaceHandler(const FpySequencer_WaitAbsDirective &directive) override
Internal interface handler for directive_waitAbs.
void parameterUpdated(FwPrmIdType id) override
Called whenever a parameter is updated.
void directive_goto_internalInterfaceHandler(const Svc::FpySequencer_GotoDirective &directive) override
Internal interface handler for directive_goto.
#define FW_PARAM_BUFFER_MAX_SIZE
void allocateBuffer(FwEnumStoreType identifier, Fw::MemAllocator &allocator, FwSizeType bytes)
uint8_t U8
8-bit unsigned integer
sets a register to a constant value
friend class FpySequencerTester
FpySequencer_GetPrmDirective getPrm
void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) override
Handler for input port cmdResponseIn.
performs a binary reg operation on the lhs and rhs regs, and stores the result in the third register ...
void checkTimers_handler(FwIndexType portNum, U32 context) override
Handler for input port checkTimers.
PlatformIndexType FwIndexType
FpySequencer_GetTlmDirective getTlm
RateGroupDivider component implementation.
Defines a base class for a memory allocator for classes.
void directive_setSerReg_internalInterfaceHandler(const FpySequencer_SetSerRegDirective &directive) override
Internal interface handler for directive_setSerReg.
Declares F Prime string base class.
FpySequencer_DeserSerRegDirective deserSerReg
void deallocateBuffer(Fw::MemAllocator &allocator)
Auto-generated base for FpySequencer component.
FpySequencer_ExitDirective exit
FpySequencer_SequencerStateMachineStateMachineBase::Signal Signal
bool Svc_FpySequencer_SequencerStateMachine_guard_shouldDebugBreak(SmId smId, Svc_FpySequencer_SequencerStateMachine::Signal signal) const override
bool Svc_FpySequencer_SequencerStateMachine_guard_debugBreakOnce(SmId smId, Svc_FpySequencer_SequencerStateMachine::Signal signal) const override
FpySequencer(const char *const compName)
FpySequencer_BinaryRegOpDirective binaryRegOp