7 #ifndef FpySequencer_HPP 8 #define FpySequencer_HPP 26 "Sequence arg count must be below U8 max");
28 "Sequence statement count must be below U16 max");
30 "Max stack size must be below Svc::Fpy::StackSizeType max");
32 "Max stack size must be greater than max tlm buffer size");
34 "Max stack size must be greater than max prm buffer size");
233 void Svc_FpySequencer_SequencerStateMachine_action_signalEntered(
241 void Svc_FpySequencer_SequencerStateMachine_action_setSequenceFilePath(
250 void Svc_FpySequencer_SequencerStateMachine_action_setSequenceBlockState(
259 void Svc_FpySequencer_SequencerStateMachine_action_validate(
267 void Svc_FpySequencer_SequencerStateMachine_action_report_seqSucceeded(
275 void Svc_FpySequencer_SequencerStateMachine_action_report_seqCancelled(
283 void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_RUNNING(
291 void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_VALID(
299 void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_IDLE(
307 void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_OK(
316 void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_EXECUTION_ERROR(
324 void Svc_FpySequencer_SequencerStateMachine_action_dispatchStatement(
332 void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceFile(
340 void Svc_FpySequencer_SequencerStateMachine_action_checkShouldWake(
348 void Svc_FpySequencer_SequencerStateMachine_action_resetRuntime(
356 void Svc_FpySequencer_SequencerStateMachine_action_checkStatementTimeout(
364 void Svc_FpySequencer_SequencerStateMachine_action_incrementSequenceCounter(
372 void Svc_FpySequencer_SequencerStateMachine_action_clearBreakpoint(
380 void Svc_FpySequencer_SequencerStateMachine_action_report_seqBroken(
388 void Svc_FpySequencer_SequencerStateMachine_action_setBreakpoint(
397 void Svc_FpySequencer_SequencerStateMachine_action_setBreakBeforeNextLine(
405 void Svc_FpySequencer_SequencerStateMachine_action_clearBreakBeforeNextLine(
413 void Svc_FpySequencer_SequencerStateMachine_action_report_seqFailed(
421 void Svc_FpySequencer_SequencerStateMachine_action_report_seqStarted(
581 static constexpr U32 CRC_INITIAL_VALUE = 0xFFFFFFFFU;
609 U64 m_sequencesStarted;
612 U64 m_statementsDispatched;
621 U32 nextStatementIndex = 0;
639 struct BreakpointInfo {
641 bool breakpointInUse =
false;
643 bool breakOnlyOnceOnBreakpoint =
false;
645 U32 breakpointIndex = 0;
649 bool breakBeforeNextLine =
false;
656 bool reachedEndOfFile =
false;
658 bool nextStatementReadSuccess =
false;
660 U8 nextStatementOpcode = 0;
664 U32 nextStatementIndex = 0;
673 U64 statementsFailed = 0;
675 U64 sequencesSucceeded = 0;
677 U64 sequencesFailed = 0;
679 U64 sequencesCancelled = 0;
684 U64 directiveErrorIndex = 0;
693 static void updateCrc(U32& crc,
717 const FpySequencer_FileReadStage& readStage,
718 bool updateCrc =
true);
725 void handleDirectiveErrorCode(Fpy::DirectiveId
id,
DirectiveError err);
728 Signal dispatchStatement();
733 Fw::Success deserializeDirective(
const Fpy::Statement& stmt, DirectiveUnion& deserializedDirective);
736 void dispatchDirective(
const DirectiveUnion& directive,
const Fpy::DirectiveId&
id);
739 Signal checkStatementTimeout();
745 bool isRunningState(
State state);
748 void updateDebugTelemetryStruct();
755 void sendSignal(
Signal signal);
761 U32 currentStatementIdx();
765 Signal waitRel_directiveHandler(
const FpySequencer_WaitRelDirective& directive,
DirectiveError& error);
766 Signal waitAbs_directiveHandler(
const FpySequencer_WaitAbsDirective& directive,
DirectiveError& error);
767 Signal goto_directiveHandler(
const FpySequencer_GotoDirective& directive,
DirectiveError& error);
769 Signal noOp_directiveHandler(
const FpySequencer_NoOpDirective& directive,
DirectiveError& error);
770 Signal pushTlmVal_directiveHandler(
const FpySequencer_PushTlmValDirective& directive,
DirectiveError& error);
771 Signal pushTlmValAndTime_directiveHandler(
const FpySequencer_PushTlmValAndTimeDirective& directive,
773 Signal pushPrm_directiveHandler(
const FpySequencer_PushPrmDirective& directive,
DirectiveError& error);
774 Signal constCmd_directiveHandler(
const FpySequencer_ConstCmdDirective& directive,
DirectiveError& error);
775 Signal stackOp_directiveHandler(
const FpySequencer_StackOpDirective& directive,
DirectiveError& error);
827 Signal exit_directiveHandler(
const FpySequencer_ExitDirective& directive,
DirectiveError& error);
828 Signal allocate_directiveHandler(
const FpySequencer_AllocateDirective& directive,
DirectiveError& error);
833 Signal storeRelConstOffset_directiveHandler(
const FpySequencer_StoreRelConstOffsetDirective& directive,
835 Signal loadRel_directiveHandler(
const FpySequencer_LoadRelDirective& directive,
DirectiveError& error);
836 Signal pushVal_directiveHandler(
const FpySequencer_PushValDirective& directive,
DirectiveError& error);
837 Signal discard_directiveHandler(
const FpySequencer_DiscardDirective& directive,
DirectiveError& error);
838 Signal memCmp_directiveHandler(
const FpySequencer_MemCmpDirective& directive,
DirectiveError& error);
839 Signal stackCmd_directiveHandler(
const FpySequencer_StackCmdDirective& directive,
DirectiveError& error);
840 Signal pushTime_directiveHandler(
const FpySequencer_PushTimeDirective& directive,
DirectiveError& error);
841 Signal getField_directiveHandler(
const FpySequencer_GetFieldDirective& directive,
DirectiveError& error);
842 Signal peek_directiveHandler(
const FpySequencer_PeekDirective& directive,
DirectiveError& error);
843 Signal storeRel_directiveHandler(
const FpySequencer_StoreRelDirective& directive,
DirectiveError& error);
844 Signal call_directiveHandler(
const FpySequencer_CallDirective& directive,
DirectiveError& error);
845 Signal return_directiveHandler(
const FpySequencer_ReturnDirective& directive,
DirectiveError& error);
846 Signal loadAbs_directiveHandler(
const FpySequencer_LoadAbsDirective& directive,
DirectiveError& error);
847 Signal storeAbs_directiveHandler(
const FpySequencer_StoreAbsDirective& directive,
DirectiveError& error);
848 Signal storeAbsConstOffset_directiveHandler(
const FpySequencer_StoreAbsConstOffsetDirective& directive,
850 Signal popEvent_directiveHandler(
const FpySequencer_PopEventDirective& directive,
DirectiveError& error);
void directive_storeRelConstOffset_internalInterfaceHandler(const Svc::FpySequencer_StoreRelConstOffsetDirective &directive) override
Internal interface handler for directive_storeRelConstOffset.
void directive_storeRel_internalInterfaceHandler(const Svc::FpySequencer_StoreRelDirective &directive) override
Internal interface handler for directive_storeRel.
void directive_return_internalInterfaceHandler(const Svc::FpySequencer_ReturnDirective &directive) override
Internal interface handler for directive_return.
sets the index of the next directive to execute
void directive_call_internalInterfaceHandler(const Svc::FpySequencer_CallDirective &directive) override
Internal interface handler for directive_call.
FpySequencer_StackOpDirective stackOp
FwIdType FwOpcodeType
The type of a command opcode.
branches based off of the top byte of the stack
void directive_if_internalInterfaceHandler(const Svc::FpySequencer_IfDirective &directive) override
Internal interface handler for directive_if.
FpySequencer_CallDirective call
PlatformSizeType FwSizeType
FpySequencer_GotoDirective gotoDirective
stores a value to an absolute address in the stack (for global variables), offset from stack ...
void directive_loadAbs_internalInterfaceHandler(const Svc::FpySequencer_LoadAbsDirective &directive) override
Internal interface handler for directive_loadAbs.
void directive_stackOp_internalInterfaceHandler(const Svc::FpySequencer_StackOpDirective &directive) override
Internal interface handler for directive_stackOp.
FpySequencer_StoreRelDirective storeRel
bool Svc_FpySequencer_SequencerStateMachine_guard_goalStateIs_RUNNING(SmId smId, Svc_FpySequencer_SequencerStateMachine::Signal signal) const override
void directive_getField_internalInterfaceHandler(const Svc::FpySequencer_GetFieldDirective &directive) override
Internal interface handler for directive_getField.
returns from a function call
U8 bytes[Fpy::MAX_STACK_SIZE]
void pingIn_handler(FwIndexType portNum, U32 key) override
Handler for input port pingIn.
void directive_pushTlmValAndTime_internalInterfaceHandler(const Svc::FpySequencer_PushTlmValAndTimeDirective &directive) override
Internal interface handler for directive_pushTlmValAndTime.
FwIdType FwPrmIdType
The type of a parameter identifier.
stores a value to a local variable at a compile-time-known offset relative to the current stack frame...
void directive_constCmd_internalInterfaceHandler(const Svc::FpySequencer_ConstCmdDirective &directive) override
Internal interface handler for directive_constCmd.
FpySequencer_ConstCmdDirective constCmd
Fpy::StackSizeType currentFrameStart
pop an opcode and arg buf off the stack, send to cmd dispatcher and await response ...
void directive_peek_internalInterfaceHandler(const Svc::FpySequencer_PeekDirective &directive) override
Internal interface handler for directive_peek.
FpySequencer_WaitRelDirective waitRel
SmId
State machine identifiers.
FpySequencer_WaitAbsDirective waitAbs
void directive_loadRel_internalInterfaceHandler(const Svc::FpySequencer_LoadRelDirective &directive) override
Internal interface handler for directive_loadRel.
void directive_memCmp_internalInterfaceHandler(const Svc::FpySequencer_MemCmpDirective &directive) override
Internal interface handler for directive_memCmp.
void directive_pushVal_internalInterfaceHandler(const Svc::FpySequencer_PushValDirective &directive) override
Internal interface handler for directive_pushVal.
FpySequencer_LoadAbsDirective loadAbs
Enum representing a command response.
FpySequencer_PeekDirective peek
void directive_pushPrm_internalInterfaceHandler(const Svc::FpySequencer_PushPrmDirective &directive) override
Internal interface handler for directive_pushPrm.
FpySequencer_PushValDirective pushVal
FpySequencer_PopEventDirective popEvent
pops bytes off the top of the stack and does nothing with them
void directive_pushTime_internalInterfaceHandler(const Svc::FpySequencer_PushTimeDirective &directive) override
Internal interface handler for directive_pushTime.
FpySequencer_IfDirective ifDirective
FpySequencer_NoOpDirective noOp
FpySequencer_PushTimeDirective pushTime
void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename) override
Handler for input port seqRunIn.
FpySequencer_GetFieldDirective getField
FpySequencer_PushTlmValAndTimeDirective pushTlmValAndTime
Fpy::DirectiveErrorCode DirectiveError
void directive_allocate_internalInterfaceHandler(const Svc::FpySequencer_AllocateDirective &directive) override
Internal interface handler for directive_allocate.
FpySequencer_LoadRelDirective loadRel
executes a cmd with const args
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.
loads a value from a local variable at a compile-time-known offset relative to the current stack fram...
void parametersLoaded() override
Called whenever parameters are loaded.
void directive_stackCmd_internalInterfaceHandler(const Svc::FpySequencer_StackCmdDirective &directive) override
Internal interface handler for directive_stackCmd.
void directive_discard_internalInterfaceHandler(const Svc::FpySequencer_DiscardDirective &directive) override
Internal interface handler for directive_discard.
FpySequencer_ReturnDirective returnDirective
FpySequencer_AllocateDirective allocate
pop two byte arrays off the top of the stack, call memcmp, push 1 if they were equal, 0 otherwise
void tlmWrite_handler(FwIndexType portNum, U32 context) override
Handler for input port tlmWrite.
pops a severity and message from the stack and emits an F Prime event
void pushZeroes(Fpy::StackSizeType byteCount)
FpySequencer_StoreAbsDirective storeAbs
void directive_exit_internalInterfaceHandler(const Svc::FpySequencer_ExitDirective &directive) override
Internal interface handler for directive_exit.
stores a value to an absolute address in the stack (for global variables), const offset ...
FpySequencer_DiscardDirective discard
FpySequencer_PushPrmDirective pushPrm
External serialize buffer with no copy semantics.
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.
peeks at N bytes from the stack, starting from an offset relative to the top of the stack ...
bool Svc_FpySequencer_SequencerStateMachine_guard_shouldBreak(SmId smId, Svc_FpySequencer_SequencerStateMachine::Signal signal) const override
void allocateBuffer(FwEnumStoreType identifier, Fw::MemAllocator &allocator, FwSizeType bytes)
FpySequencer_MemCmpDirective memCmp
FpySequencer_StackCmdDirective stackCmd
void copy(Fpy::StackSizeType destOffset, Fpy::StackSizeType srcOffset, Fpy::StackSizeType copySize)
void directive_storeAbsConstOffset_internalInterfaceHandler(const Svc::FpySequencer_StoreAbsConstOffsetDirective &directive) override
Internal interface handler for directive_storeAbsConstOffset.
sleeps for a relative duration from the current time
uint8_t U8
8-bit unsigned integer
FpySequencer_PushTlmValDirective pushTlmVal
friend class FpySequencerTester
void directive_popEvent_internalInterfaceHandler(const Svc::FpySequencer_PopEventDirective &directive) override
Internal interface handler for directive_popEvent.
generic stack operation handler
Memory Allocation base class.
sleeps until an absolute time
void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) override
Handler for input port cmdResponseIn.
void checkTimers_handler(FwIndexType portNum, U32 context) override
Handler for input port checkTimers.
FpySequencer_StoreAbsConstOffsetDirective storeAbsConstOffset
loads a value from an absolute address in the stack (for global variables)
bool Svc_FpySequencer_SequencerStateMachine_guard_breakOnce(SmId smId, Svc_FpySequencer_SequencerStateMachine::Signal signal) const override
PlatformIndexType FwIndexType
Svc::FpySequencer_SequencerStateMachine_State State
The state type.
pushes a const byte array onto stack
stores a value to a local variable at a runtime-determined offset relative to the current stack frame...
RateGroupDivider component implementation.
void directive_storeAbs_internalInterfaceHandler(const Svc::FpySequencer_StoreAbsDirective &directive) override
Internal interface handler for directive_storeAbs.
Defines a base class for a memory allocator for classes.
pushes a prm buf to the stack
void move(Fpy::StackSizeType destOffset, Fpy::StackSizeType srcOffset, Fpy::StackSizeType moveSize)
Declares F Prime string base class.
void deallocateBuffer(Fw::MemAllocator &allocator)
pushes the current Fw.Time struct to the stack
FpySequencer_StoreRelConstOffsetDirective storeRelConstOffset
Auto-generated base for FpySequencer component.
pushes some empty bytes to the stack
FpySequencer_ExitDirective exit
FpySequencer_SequencerStateMachineStateMachineBase::Signal Signal
pushes a tlm buf to the stack
U32 StackSizeType
the type which everything referencing a size or offset on the stack is represented in ...
void directive_pushTlmVal_internalInterfaceHandler(const Svc::FpySequencer_PushTlmValDirective &directive) override
Internal interface handler for directive_pushTlmVal.
FpySequencer(const char *const compName)