F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FpySequencer.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FpySequencer.hpp
3 // \author zimri.leisher
4 // \brief hpp file for FpySequencer component implementation class
5 // ======================================================================
6 
7 #ifndef FpySequencer_HPP
8 #define FpySequencer_HPP
9 
11 #include "Fw/Types/StringBase.hpp"
13 #include "Fw/Types/WaitEnumAc.hpp"
14 #include "Os/File.hpp"
24 
25 static_assert(Svc::Fpy::MAX_SEQUENCE_ARG_COUNT <= std::numeric_limits<U8>::max(),
26  "Sequence arg count must be below U8 max");
27 static_assert(Svc::Fpy::MAX_SEQUENCE_STATEMENT_COUNT <= std::numeric_limits<U16>::max(),
28  "Sequence statement count must be below U16 max");
29 static_assert(Svc::Fpy::MAX_STACK_SIZE <= std::numeric_limits<Svc::Fpy::StackSizeType>::max(),
30  "Max stack size must be below Svc::Fpy::StackSizeType max");
31 static_assert(Svc::Fpy::MAX_STACK_SIZE >= static_cast<FwSizeType>(FW_TLM_BUFFER_MAX_SIZE),
32  "Max stack size must be greater than max tlm buffer size");
33 static_assert(Svc::Fpy::MAX_STACK_SIZE >= static_cast<FwSizeType>(FW_PARAM_BUFFER_MAX_SIZE),
34  "Max stack size must be greater than max prm buffer size");
35 
36 namespace Svc {
37 
41 
43  friend class FpySequencerTester;
44 
45  public:
75 
78  };
79 
80  class Stack {
81  public:
82  // the byte array of the program stack, storing lvars, operands and function calls
84  // how many bytes high the stack is
86  // the byte offset from the start of the stack where the current function's local variables begin.
87  // analogous to a 'frame pointer'.
89 
90  // pops a value off of the top of the stack
91  // converts it from big endian
92  template <typename T>
93  T pop();
94 
95  // pushes a value onto the top of the stack
96  // converts it to big endian
97  template <typename T>
98  void push(T val);
99 
100  // pops a byte array from the top of the stack into the destination array
101  // does not convert endianness
102  void pop(U8* dest, Fpy::StackSizeType size);
103 
104  // pushes a byte array to the top of the stack from the source array
105  // leaves the source array unmodified
106  // does not convert endianness
107  void push(U8* src, Fpy::StackSizeType size);
108 
109  // pushes zero bytes to the stack
110  void pushZeroes(Fpy::StackSizeType byteCount);
111 
112  // returns a pointer to the next unused byte at the top of the stack
113  U8* top();
114 
115  // Copies data from one region of the stack to another
116  // Asserts that both regions are within bounds and do not overlap
117  // Does not modify stack size
118  void copy(Fpy::StackSizeType destOffset, Fpy::StackSizeType srcOffset, Fpy::StackSizeType copySize);
119 
120  // Moves data within the stack (handles overlapping regions)
121  // Asserts that both source and destination are within bounds
122  // Does not modify stack size
123  void move(Fpy::StackSizeType destOffset, Fpy::StackSizeType srcOffset, Fpy::StackSizeType moveSize);
124  };
125 
126  // ----------------------------------------------------------------------
127  // Construction, initialization, and destruction
128  // ----------------------------------------------------------------------
129 
132  FpySequencer(const char* const compName
133  );
134 
137  ~FpySequencer();
138 
139  private:
143  void RUN_cmdHandler(FwOpcodeType opCode,
144  U32 cmdSeq,
145  const Fw::CmdStringArg& fileName,
147  ) override;
148 
152  void VALIDATE_cmdHandler(FwOpcodeType opCode,
153  U32 cmdSeq,
154  const Fw::CmdStringArg& fileName
155  ) override;
156 
160  void RUN_VALIDATED_cmdHandler(FwOpcodeType opCode,
161  U32 cmdSeq,
163  ) override;
164 
168  void CANCEL_cmdHandler(FwOpcodeType opCode,
169  U32 cmdSeq
170  ) override;
171 
178  void SET_BREAKPOINT_cmdHandler(FwOpcodeType opCode,
179  U32 cmdSeq,
180  U32 stmtIdx,
181  bool breakOnce
182  ) override;
183 
189  void BREAK_cmdHandler(FwOpcodeType opCode,
190  U32 cmdSeq
191  ) override;
192 
197  void CONTINUE_cmdHandler(FwOpcodeType opCode,
198  U32 cmdSeq
199  ) override;
200 
205  void CLEAR_BREAKPOINT_cmdHandler(FwOpcodeType opCode,
206  U32 cmdSeq
207  ) override;
208 
214  void STEP_cmdHandler(FwOpcodeType opCode,
215  U32 cmdSeq
216  ) override;
217 
221  void DUMP_STACK_TO_FILE_cmdHandler(FwOpcodeType opCode,
222  U32 cmdSeq,
223  const Fw::CmdStringArg& fileName
224  ) override;
225 
226  // ----------------------------------------------------------------------
227  // Functions to implement for internal state machine actions
228  // ----------------------------------------------------------------------
229 
233  void Svc_FpySequencer_SequencerStateMachine_action_signalEntered(
234  SmId smId,
236  ) override;
237 
241  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceFilePath(
242  SmId smId,
245  ) override;
246 
250  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceBlockState(
251  SmId smId,
254  ) override;
255 
259  void Svc_FpySequencer_SequencerStateMachine_action_validate(
260  SmId smId,
262  ) override;
263 
267  void Svc_FpySequencer_SequencerStateMachine_action_report_seqSucceeded(
268  SmId smId,
270  ) override;
271 
275  void Svc_FpySequencer_SequencerStateMachine_action_report_seqCancelled(
276  SmId smId,
278  ) override;
279 
283  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_RUNNING(
284  SmId smId,
286  ) override;
287 
291  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_VALID(
292  SmId smId,
294  ) override;
295 
299  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_IDLE(
300  SmId smId,
302  ) override;
303 
307  void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_OK(
308  SmId smId,
310  ) override;
311 
316  void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_EXECUTION_ERROR(
317  SmId smId,
319  ) override;
320 
324  void Svc_FpySequencer_SequencerStateMachine_action_dispatchStatement(
325  SmId smId,
327  ) override;
328 
332  void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceFile(
333  SmId smId,
335  ) override;
336 
340  void Svc_FpySequencer_SequencerStateMachine_action_checkShouldWake(
341  SmId smId,
343  ) override;
344 
348  void Svc_FpySequencer_SequencerStateMachine_action_resetRuntime(
349  SmId smId,
351  ) override;
352 
356  void Svc_FpySequencer_SequencerStateMachine_action_checkStatementTimeout(
357  SmId smId,
359  ) override;
360 
364  void Svc_FpySequencer_SequencerStateMachine_action_incrementSequenceCounter(
365  SmId smId,
367  ) override;
368 
372  void Svc_FpySequencer_SequencerStateMachine_action_clearBreakpoint(
373  SmId smId,
375  ) override;
376 
380  void Svc_FpySequencer_SequencerStateMachine_action_report_seqBroken(
381  SmId smId,
383  ) override;
384 
388  void Svc_FpySequencer_SequencerStateMachine_action_setBreakpoint(
389  SmId smId,
392  ) override;
393 
397  void Svc_FpySequencer_SequencerStateMachine_action_setBreakBeforeNextLine(
398  SmId smId,
400  ) override;
401 
405  void Svc_FpySequencer_SequencerStateMachine_action_clearBreakBeforeNextLine(
406  SmId smId,
408  ) override;
409 
413  void Svc_FpySequencer_SequencerStateMachine_action_report_seqFailed(
414  SmId smId,
416  ) override;
417 
421  void Svc_FpySequencer_SequencerStateMachine_action_report_seqStarted(
422  SmId smId,
424  ) override;
425 
426  protected:
427  // ----------------------------------------------------------------------
428  // Functions to implement for internal state machine guards
429  // ----------------------------------------------------------------------
430 
435  SmId smId,
437  ) const override;
438 
444  SmId smId,
446  ) const override;
447 
452  SmId smId,
454  ) const override;
455 
456  // ----------------------------------------------------------------------
457  // Handlers to implement for typed input ports
458  // ----------------------------------------------------------------------
459 
461  void checkTimers_handler(FwIndexType portNum,
462  U32 context
463  ) override;
464 
466  void cmdResponseIn_handler(FwIndexType portNum,
467  FwOpcodeType opCode,
468  U32 cmdSeq,
469  const Fw::CmdResponse& response
470  ) override;
471 
473  void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename) override;
474 
476  void pingIn_handler(FwIndexType portNum,
477  U32 key
478  ) override;
479 
481  void tlmWrite_handler(FwIndexType portNum,
482  U32 context
483  ) override;
484 
487 
490 
493 
496 
499 
502 
505  const Svc::FpySequencer_PushTlmValAndTimeDirective& directive) override;
506 
509 
512 
515 
518 
521 
524  const Svc::FpySequencer_StoreRelConstOffsetDirective& directive) override;
525 
528 
531 
534 
537 
540 
543 
546 
549 
552 
555 
558 
561 
564 
567  const Svc::FpySequencer_StoreAbsConstOffsetDirective& directive) override;
568 
571 
572  void parametersLoaded() override;
573  void parameterUpdated(FwPrmIdType id) override;
574 
575  public:
576  void allocateBuffer(FwEnumStoreType identifier, Fw::MemAllocator& allocator, FwSizeType bytes);
577 
578  void deallocateBuffer(Fw::MemAllocator& allocator);
579 
580  private:
581  static constexpr U32 CRC_INITIAL_VALUE = 0xFFFFFFFFU;
582 
583  // allocated at startup
584  Fw::ExternalSerializeBuffer m_sequenceBuffer;
585  // id of allocator that gave us m_sequenceBuffer
586  FwEnumStoreType m_allocatorId;
587 
588  // assigned by the user via cmd
589  Fw::String m_sequenceFilePath;
590  // the sequence, loaded in memory
591  Fpy::Sequence m_sequenceObj;
592  // live running computation of CRC (updated as we read)
593  U32 m_computedCRC;
594 
595  // whether or not the sequence we're about to run should return immediately or
596  // block on completion
597  FpySequencer_BlockState m_sequenceBlockState;
598  // if we are to block on completion, save the opCode and cmdSeq we should
599  // return
600  FwOpcodeType m_savedOpCode;
601  U32 m_savedCmdSeq;
602 
603  // the goal state is the state that we're trying to reach in the sequencer
604  // if it's RUNNING, then we should promptly go to RUNNING once we validate the
605  // sequence. if it's VALID, we should wait after VALIDATING
606  FpySequencer_GoalState m_goalState;
607 
608  // the total number of sequences this sequencer has started since construction
609  U64 m_sequencesStarted;
610  // the total number of statements this sequencer has dispatched, successfully or
611  // otherwise, since construction
612  U64 m_statementsDispatched;
613 
614  // the runtime state of the sequence. encapsulates all state
615  // needed to run the sequence.
616  // this is distinct from the state of the sequencer. the
617  // sequencer and all its state is really just a shell to load
618  // and execute this runtime.
619  struct Runtime {
620  // the index of the next statement to be executed
621  U32 nextStatementIndex = 0;
622 
623  // the opcode of the statement that is currently executing
624  U8 currentStatementOpcode = Fpy::DirectiveId::INVALID;
625  // the opcode of the command that we are currently awaiting, or 0 if we are executing a directive
626  FwOpcodeType currentCmdOpcode = 0;
627  // the time we dispatched the statement that is currently executing
628  Fw::Time currentStatementDispatchTime = Fw::Time();
629 
630  // the absolute time we should wait for until returning
631  // a statement response
632  Fw::Time wakeupTime = Fw::Time();
633 
634  Stack stack = Stack();
635  } m_runtime;
636 
637  // the state of the debugger. debugger is separate from runtime
638  // because it can be set up before running the sequence.
639  struct BreakpointInfo {
640  // whether or not to break at the debug breakpoint index
641  bool breakpointInUse = false;
642  // whether or not to remove the breakpoint after breaking on it
643  bool breakOnlyOnceOnBreakpoint = false;
644  // the statement index at which to break, before dispatching
645  U32 breakpointIndex = 0;
646  // whether or not to break before dispatching the next line,
647  // independent of what line it is.
648  // can be used in combination with breakpointIndex
649  bool breakBeforeNextLine = false;
650  } m_breakpoint;
651 
652  // debug information about the sequence. only valid in the PAUSED state
653  // which you can access via BREAK or SET_BREAKPOINT cmds
654  struct DebugInfo {
655  // true if there are no statements remaining in the sequence file
656  bool reachedEndOfFile = false;
657  // true if we were able to deserialize the next statement successfully
658  bool nextStatementReadSuccess = false;
659  // the opcode of the next statement to dispatch.
660  U8 nextStatementOpcode = 0;
661  // if the next statement is a cmd directive, the opcode of that cmd
662  FwOpcodeType nextCmdOpcode = 0;
663  // the index of the next statement we're going to execute
664  U32 nextStatementIndex = 0;
665  // the size of the stack. store this separately from the real stack size
666  // so we can avoid changing this during runtime, only modify it during
667  // debug
668  Fpy::StackSizeType stackSize = 0;
669  } m_debug;
670 
671  struct Telemetry {
672  // the number of statements that failed to execute
673  U64 statementsFailed = 0;
674  // the number of sequences successfully completed
675  U64 sequencesSucceeded = 0;
676  // the number of sequences that failed to validate or execute
677  U64 sequencesFailed = 0;
678  // the number of sequences that have been cancelled
679  U64 sequencesCancelled = 0;
680 
681  // the error code of the last directive that ran
682  DirectiveError lastDirectiveError = DirectiveError::NO_ERROR;
683  // the index of the last directive that errored
684  U64 directiveErrorIndex = 0;
685  // the opcode of the last directive that errored
686  Fpy::DirectiveId directiveErrorId = Fpy::DirectiveId::INVALID;
687  } m_tlm;
688 
689  // ----------------------------------------------------------------------
690  // Validation state
691  // ----------------------------------------------------------------------
692 
693  static void updateCrc(U32& crc,
694  const U8* buffer,
695  FwSizeType bufferSize
696  );
697 
698  // loads the sequence in memory, and does header/crc/integrity checks.
699  // return SUCCESS if sequence is valid, FAILURE otherwise
700  Fw::Success validate();
701  // reads and validates the header from the m_sequenceBuffer
702  // return SUCCESS if sequence is valid, FAILURE otherwise
703  Fw::Success readHeader();
704  // reads and validates the body from the m_sequenceBuffer
705  // return SUCCESS if sequence is valid, FAILURE otherwise
706  Fw::Success readBody();
707  // reads and validates the footer from the m_sequenceBuffer
708  // return SUCCESS if sequence is valid, FAILURE otherwise
709  Fw::Success readFooter();
710 
711  // reads some bytes from the open file into the m_sequenceBuffer.
712  // updates the CRC by default, but can be turned off if the contents
713  // aren't included in CRC.
714  // return success if successful
715  Fw::Success readBytes(Os::File& file,
716  FwSizeType readLen,
717  const FpySequencer_FileReadStage& readStage,
718  bool updateCrc = true);
719 
720  // ----------------------------------------------------------------------
721  // Run state
722  // ----------------------------------------------------------------------
723 
724  // utility method for updating telemetry based on a directive error code
725  void handleDirectiveErrorCode(Fpy::DirectiveId id, DirectiveError err);
726 
727  // dispatches the next statement
728  Signal dispatchStatement();
729 
730  // deserializes a directive from bytes into the Fpy type
731  // returns success if able to deserialize, and returns the Fpy type object
732  // as a reference, in a union of all the possible directive type objects
733  Fw::Success deserializeDirective(const Fpy::Statement& stmt, DirectiveUnion& deserializedDirective);
734 
735  // dispatches a deserialized sequencer directive to the right handler.
736  void dispatchDirective(const DirectiveUnion& directive, const Fpy::DirectiveId& id);
737 
738  // checks whether the currently executing statement timed out
739  Signal checkStatementTimeout();
740 
741  // checks whether the sequencer should wake from sleeping
742  Signal checkShouldWake();
743 
744  // return true if state is a substate of RUNNING
745  bool isRunningState(State state);
746 
747  // update a struct containing debug telemetry, or defaults if not in debug break
748  void updateDebugTelemetryStruct();
749 
750  // ----------------------------------------------------------------------
751  // Directives
752  // ----------------------------------------------------------------------
753 
754  // sends a signal based on a signal id
755  void sendSignal(Signal signal);
756 
757  // dispatches a command, returns whether successful or not
758  Fw::Success sendCmd(FwOpcodeType opcode, const U8* argBuf, FwSizeType argBufSize);
759 
760  // returns the index of the current statement
761  U32 currentStatementIdx();
762 
763  // we split these functions up into the internalInterfaceInvoke and these custom member funcs
764  // so that we can unit test them easier
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);
768  Signal if_directiveHandler(const FpySequencer_IfDirective& 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,
772  DirectiveError& error);
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);
776 
777  DirectiveError op_or();
778  DirectiveError op_and();
779  DirectiveError op_ieq();
780  DirectiveError op_ine();
781  DirectiveError op_ult();
782  DirectiveError op_ule();
783  DirectiveError op_ugt();
784  DirectiveError op_uge();
785  DirectiveError op_slt();
786  DirectiveError op_sle();
787  DirectiveError op_sgt();
788  DirectiveError op_sge();
789  DirectiveError op_feq();
790  DirectiveError op_fne();
791  DirectiveError op_flt();
792  DirectiveError op_fle();
793  DirectiveError op_fgt();
794  DirectiveError op_fge();
795  DirectiveError op_not();
796  DirectiveError op_fpext();
797  DirectiveError op_fptrunc();
798  DirectiveError op_fptoui();
799  DirectiveError op_fptosi();
800  DirectiveError op_sitofp();
801  DirectiveError op_uitofp();
802  DirectiveError op_add();
803  DirectiveError op_sub();
804  DirectiveError op_mul();
805  DirectiveError op_udiv();
806  DirectiveError op_sdiv();
807  DirectiveError op_umod();
808  DirectiveError op_smod();
809  DirectiveError op_fadd();
810  DirectiveError op_fsub();
811  DirectiveError op_fmul();
812  DirectiveError op_fdiv();
813  DirectiveError op_float_floor_div();
814  DirectiveError op_fpow();
815  DirectiveError op_flog();
816  DirectiveError op_fmod();
817  DirectiveError op_siext_8_64();
818  DirectiveError op_siext_16_64();
819  DirectiveError op_siext_32_64();
820  DirectiveError op_ziext_8_64();
821  DirectiveError op_ziext_16_64();
822  DirectiveError op_ziext_32_64();
823  DirectiveError op_itrunc_64_8();
824  DirectiveError op_itrunc_64_16();
825  DirectiveError op_itrunc_64_32();
826 
827  Signal exit_directiveHandler(const FpySequencer_ExitDirective& directive, DirectiveError& error);
828  Signal allocate_directiveHandler(const FpySequencer_AllocateDirective& directive, DirectiveError& error);
830  Signal storeHelper(Fpy::StackSizeType destOffset, Fpy::StackSizeType size, DirectiveError& error);
832  Signal loadHelper(Fpy::StackSizeType srcOffset, Fpy::StackSizeType size, DirectiveError& error);
833  Signal storeRelConstOffset_directiveHandler(const FpySequencer_StoreRelConstOffsetDirective& directive,
834  DirectiveError& error);
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,
849  DirectiveError& error);
850  Signal popEvent_directiveHandler(const FpySequencer_PopEventDirective& directive, DirectiveError& error);
851 };
852 
853 } // namespace Svc
854 
855 #endif
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.
I32 FwEnumStoreType
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.
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
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
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
Definition: BasicTypes.h:53
FpySequencer_PushTlmValDirective pushTlmVal
friend class FpySequencerTester
void directive_popEvent_internalInterfaceHandler(const Svc::FpySequencer_PopEventDirective &directive) override
Internal interface handler for directive_popEvent.
Memory Allocation base class.
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
Fpy::StackSizeType size
Svc::FpySequencer_SequencerStateMachine_State State
The state type.
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.
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.
FpySequencer_ExitDirective exit
FpySequencer_SequencerStateMachineStateMachineBase::Signal Signal
Success/Failure.
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)
#define U64(C)
Definition: sha.h:181