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(const 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 
150  void RUN_ARGS_cmdHandler(FwOpcodeType opCode,
151  U32 cmdSeq,
152  const Fw::CmdStringArg& fileName,
154  Svc::SeqArgs args
155  ) override;
156 
160  void VALIDATE_cmdHandler(FwOpcodeType opCode,
161  U32 cmdSeq,
162  const Fw::CmdStringArg& fileName
163  ) override;
164 
168  void VALIDATE_ARGS_cmdHandler(FwOpcodeType opCode,
169  U32 cmdSeq,
170  const Fw::CmdStringArg& fileName,
171  Svc::SeqArgs buffer
172  ) override;
173 
177  void RUN_VALIDATED_cmdHandler(FwOpcodeType opCode,
178  U32 cmdSeq,
180  ) override;
181 
185  void CANCEL_cmdHandler(FwOpcodeType opCode,
186  U32 cmdSeq
187  ) override;
188 
195  void SET_BREAKPOINT_cmdHandler(FwOpcodeType opCode,
196  U32 cmdSeq,
197  U32 stmtIdx,
198  bool breakOnce
199  ) override;
200 
206  void BREAK_cmdHandler(FwOpcodeType opCode,
207  U32 cmdSeq
208  ) override;
209 
214  void CONTINUE_cmdHandler(FwOpcodeType opCode,
215  U32 cmdSeq
216  ) override;
217 
222  void CLEAR_BREAKPOINT_cmdHandler(FwOpcodeType opCode,
223  U32 cmdSeq
224  ) override;
225 
231  void STEP_cmdHandler(FwOpcodeType opCode,
232  U32 cmdSeq
233  ) override;
234 
238  void DUMP_STACK_TO_FILE_cmdHandler(FwOpcodeType opCode,
239  U32 cmdSeq,
240  const Fw::CmdStringArg& fileName
241  ) override;
242 
243  // ----------------------------------------------------------------------
244  // Functions to implement for internal state machine actions
245  // ----------------------------------------------------------------------
246 
250  void Svc_FpySequencer_SequencerStateMachine_action_signalEntered(
251  SmId smId,
253  ) override;
254 
258  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceFilePath(
259  SmId smId,
262  ) override;
263 
267  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceBlockState(
268  SmId smId,
271  ) override;
272 
276  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceArguments(
277  SmId smId,
280  ) override;
281 
285  void Svc_FpySequencer_SequencerStateMachine_action_validate(
286  SmId smId,
288  ) override;
289 
293  void Svc_FpySequencer_SequencerStateMachine_action_report_seqSucceeded(
294  SmId smId,
296  ) override;
297 
301  void Svc_FpySequencer_SequencerStateMachine_action_report_seqCancelled(
302  SmId smId,
304  ) override;
305 
309  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_RUNNING(
310  SmId smId,
312  ) override;
313 
317  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_VALID(
318  SmId smId,
320  ) override;
321 
325  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_IDLE(
326  SmId smId,
328  ) override;
329 
333  void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_OK(
334  SmId smId,
336  ) override;
337 
342  void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_EXECUTION_ERROR(
343  SmId smId,
345  ) override;
346 
350  void Svc_FpySequencer_SequencerStateMachine_action_dispatchStatement(
351  SmId smId,
353  ) override;
354 
358  void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceFile(
359  SmId smId,
361  ) override;
362 
366  void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceArguments(
367  SmId smId,
369  ) override;
370 
374  void Svc_FpySequencer_SequencerStateMachine_action_checkShouldWake(
375  SmId smId,
377  ) override;
378 
382  void Svc_FpySequencer_SequencerStateMachine_action_resetRuntime(
383  SmId smId,
385  ) override;
386 
390  void Svc_FpySequencer_SequencerStateMachine_action_checkStatementTimeout(
391  SmId smId,
393  ) override;
394 
398  void Svc_FpySequencer_SequencerStateMachine_action_incrementSequenceCounter(
399  SmId smId,
401  ) override;
402 
406  void Svc_FpySequencer_SequencerStateMachine_action_pushArgsToStack(
407  SmId smId,
409  ) override;
410 
414  void Svc_FpySequencer_SequencerStateMachine_action_clearBreakpoint(
415  SmId smId,
417  ) override;
418 
422  void Svc_FpySequencer_SequencerStateMachine_action_report_seqBroken(
423  SmId smId,
425  ) override;
426 
430  void Svc_FpySequencer_SequencerStateMachine_action_setBreakpoint(
431  SmId smId,
434  ) override;
435 
439  void Svc_FpySequencer_SequencerStateMachine_action_setBreakBeforeNextLine(
440  SmId smId,
442  ) override;
443 
447  void Svc_FpySequencer_SequencerStateMachine_action_clearBreakBeforeNextLine(
448  SmId smId,
450  ) override;
451 
455  void Svc_FpySequencer_SequencerStateMachine_action_report_seqFailed(
456  SmId smId,
458  ) override;
459 
463  void Svc_FpySequencer_SequencerStateMachine_action_report_seqStarted(
464  SmId smId,
466  ) override;
467 
468  protected:
469  // ----------------------------------------------------------------------
470  // Functions to implement for internal state machine guards
471  // ----------------------------------------------------------------------
472 
477  SmId smId,
479  ) const override;
480 
486  SmId smId,
488  ) const override;
489 
494  SmId smId,
496  ) const override;
497 
498  // ----------------------------------------------------------------------
499  // Handlers to implement for typed input ports
500  // ----------------------------------------------------------------------
501 
503  void checkTimers_handler(FwIndexType portNum,
504  U32 context
505  ) override;
506 
508  void cmdResponseIn_handler(FwIndexType portNum,
509  FwOpcodeType opCode,
510  U32 cmdSeq,
511  const Fw::CmdResponse& response
512  ) override;
513 
515  void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename, const Svc::SeqArgs& args) override;
516 
518  void pingIn_handler(FwIndexType portNum,
519  U32 key
520  ) override;
521 
523  void tlmWrite_handler(FwIndexType portNum,
524  U32 context
525  ) override;
526 
529 
532 
535 
538 
541 
544 
547  const Svc::FpySequencer_PushTlmValAndTimeDirective& directive) override;
548 
551 
554 
557 
560 
563 
566  const Svc::FpySequencer_StoreRelConstOffsetDirective& directive) override;
567 
570 
573 
576 
579 
582 
585 
588 
591 
594 
597 
600 
603 
606 
609  const Svc::FpySequencer_StoreAbsConstOffsetDirective& directive) override;
610 
613 
614  void parametersLoaded() override;
615  void parameterUpdated(FwPrmIdType id) override;
616 
617  public:
618  void allocateBuffer(FwEnumStoreType identifier, Fw::MemAllocator& allocator, FwSizeType bytes);
619 
620  void deallocateBuffer(Fw::MemAllocator& allocator);
621 
622  private:
623  static constexpr U32 CRC_INITIAL_VALUE = 0xFFFFFFFFU;
624 
625  // allocated at startup
626  Fw::ExternalSerializeBuffer m_sequenceBuffer;
627  // id of allocator that gave us m_sequenceBuffer
628  FwEnumStoreType m_allocatorId;
629 
630  // assigned by the user via cmd
631  Fw::String m_sequenceFilePath;
632  // the sequence, loaded in memory
633  Fpy::Sequence m_sequenceObj;
634  // live running computation of CRC (updated as we read)
635  U32 m_computedCRC;
636 
637  // whether or not the sequence we're about to run should return immediately or
638  // block on completion
639  FpySequencer_BlockState m_sequenceBlockState;
640  // if we are to block on completion, save the opCode and cmdSeq we should
641  // return
642  FwOpcodeType m_savedOpCode;
643  U32 m_savedCmdSeq;
644 
645  // sequence arguments to push to stack when entering RUNNING state
646  Svc::SeqArgs m_sequenceArgs{};
647 
648  // the goal state is the state that we're trying to reach in the sequencer
649  // if it's RUNNING, then we should promptly go to RUNNING once we validate the
650  // sequence. if it's VALID, we should wait after VALIDATING
651  FpySequencer_GoalState m_goalState;
652 
653  // the total number of sequences this sequencer has started since construction
654  U64 m_sequencesStarted;
655  // the total number of statements this sequencer has dispatched, successfully or
656  // otherwise, since construction
657  U64 m_statementsDispatched;
658 
659  // the runtime state of the sequence. encapsulates all state
660  // needed to run the sequence.
661  // this is distinct from the state of the sequencer. the
662  // sequencer and all its state is really just a shell to load
663  // and execute this runtime.
664  struct Runtime {
665  // the index of the next statement to be executed
666  U32 nextStatementIndex = 0;
667 
668  // the opcode of the statement that is currently executing
669  U8 currentStatementOpcode = Fpy::DirectiveId::INVALID;
670  // the opcode of the command that we are currently awaiting, or 0 if we are executing a directive
671  FwOpcodeType currentCmdOpcode = 0;
672  // the time we dispatched the statement that is currently executing
673  Fw::Time currentStatementDispatchTime = Fw::Time();
674 
675  // the absolute time we should wait for until returning
676  // a statement response
677  Fw::Time wakeupTime = Fw::Time();
678 
679  Stack stack = Stack();
680  } m_runtime;
681 
682  // the state of the debugger. debugger is separate from runtime
683  // because it can be set up before running the sequence.
684  struct BreakpointInfo {
685  // whether or not to break at the debug breakpoint index
686  bool breakpointInUse = false;
687  // whether or not to remove the breakpoint after breaking on it
688  bool breakOnlyOnceOnBreakpoint = false;
689  // the statement index at which to break, before dispatching
690  U32 breakpointIndex = 0;
691  // whether or not to break before dispatching the next line,
692  // independent of what line it is.
693  // can be used in combination with breakpointIndex
694  bool breakBeforeNextLine = false;
695  } m_breakpoint;
696 
697  // debug information about the sequence. only valid in the PAUSED state
698  // which you can access via BREAK or SET_BREAKPOINT cmds
699  struct DebugInfo {
700  // true if there are no statements remaining in the sequence file
701  bool reachedEndOfFile = false;
702  // true if we were able to deserialize the next statement successfully
703  bool nextStatementReadSuccess = false;
704  // the opcode of the next statement to dispatch.
705  U8 nextStatementOpcode = 0;
706  // if the next statement is a cmd directive, the opcode of that cmd
707  FwOpcodeType nextCmdOpcode = 0;
708  // the index of the next statement we're going to execute
709  U32 nextStatementIndex = 0;
710  // the size of the stack. store this separately from the real stack size
711  // so we can avoid changing this during runtime, only modify it during
712  // debug
713  Fpy::StackSizeType stackSize = 0;
714  } m_debug;
715 
716  struct Telemetry {
717  // the number of statements that failed to execute
718  U64 statementsFailed = 0;
719  // the number of sequences successfully completed
720  U64 sequencesSucceeded = 0;
721  // the number of sequences that failed to validate or execute
722  U64 sequencesFailed = 0;
723  // the number of sequences that have been cancelled
724  U64 sequencesCancelled = 0;
725 
726  // the error code of the last directive that ran
727  DirectiveError lastDirectiveError = DirectiveError::NO_ERROR;
728  // the index of the last directive that errored
729  U64 directiveErrorIndex = 0;
730  // the opcode of the last directive that errored
731  Fpy::DirectiveId directiveErrorId = Fpy::DirectiveId::INVALID;
732  } m_tlm;
733 
734  // ----------------------------------------------------------------------
735  // Validation state
736  // ----------------------------------------------------------------------
737 
738  static void updateCrc(U32& crc,
739  const U8* buffer,
740  FwSizeType bufferSize
741  );
742 
743  // loads the sequence in memory, and does header/crc/integrity checks.
744  // return SUCCESS if sequence is valid, FAILURE otherwise
745  Fw::Success validate();
746  // reads and validates the header from the m_sequenceBuffer
747  // return SUCCESS if sequence is valid, FAILURE otherwise
748  Fw::Success readHeader();
749  // reads and validates the body from the m_sequenceBuffer
750  // return SUCCESS if sequence is valid, FAILURE otherwise
751  Fw::Success readBody();
752  // reads and validates the footer from the m_sequenceBuffer
753  // return SUCCESS if sequence is valid, FAILURE otherwise
754  Fw::Success readFooter();
755 
756  // reads some bytes from the open file into the m_sequenceBuffer.
757  // updates the CRC by default, but can be turned off if the contents
758  // aren't included in CRC.
759  // return success if successful
760  Fw::Success readBytes(Os::File& file,
761  FwSizeType readLen,
762  const FpySequencer_FileReadStage& readStage,
763  bool updateCrc = true);
764 
765  // ----------------------------------------------------------------------
766  // Run state
767  // ----------------------------------------------------------------------
768 
769  // utility method for updating telemetry based on a directive error code
770  void handleDirectiveErrorCode(Fpy::DirectiveId id, DirectiveError err);
771 
772  // dispatches the next statement
773  Signal dispatchStatement();
774 
775  // deserializes a directive from bytes into the Fpy type
776  // returns success if able to deserialize, and returns the Fpy type object
777  // as a reference, in a union of all the possible directive type objects
778  Fw::Success deserializeDirective(const Fpy::Statement& stmt, DirectiveUnion& deserializedDirective);
779 
780  // dispatches a deserialized sequencer directive to the right handler.
781  void dispatchDirective(const DirectiveUnion& directive, const Fpy::DirectiveId& id);
782 
783  // checks whether the currently executing statement timed out
784  Signal checkStatementTimeout();
785 
786  // checks whether the sequencer should wake from sleeping
787  Signal checkShouldWake();
788 
789  // return true if state is a substate of RUNNING
790  bool isRunningState(State state);
791 
792  // update a struct containing debug telemetry, or defaults if not in debug break
793  void updateDebugTelemetryStruct();
794 
795  // ----------------------------------------------------------------------
796  // Directives
797  // ----------------------------------------------------------------------
798 
799  // sends a signal based on a signal id
800  void sendSignal(Signal signal);
801 
802  // dispatches a command, returns whether successful or not
803  Fw::Success sendCmd(FwOpcodeType opcode, const U8* argBuf, FwSizeType argBufSize);
804 
805  // returns the index of the current statement
806  U32 currentStatementIdx();
807 
808  // we split these functions up into the internalInterfaceInvoke and these custom member funcs
809  // so that we can unit test them easier
810  Signal waitRel_directiveHandler(const FpySequencer_WaitRelDirective& directive, DirectiveError& error);
811  Signal waitAbs_directiveHandler(const FpySequencer_WaitAbsDirective& directive, DirectiveError& error);
812  Signal goto_directiveHandler(const FpySequencer_GotoDirective& directive, DirectiveError& error);
813  Signal if_directiveHandler(const FpySequencer_IfDirective& directive, DirectiveError& error);
814  Signal noOp_directiveHandler(const FpySequencer_NoOpDirective& directive, DirectiveError& error);
815  Signal pushTlmVal_directiveHandler(const FpySequencer_PushTlmValDirective& directive, DirectiveError& error);
816  Signal pushTlmValAndTime_directiveHandler(const FpySequencer_PushTlmValAndTimeDirective& directive,
817  DirectiveError& error);
818  Signal pushPrm_directiveHandler(const FpySequencer_PushPrmDirective& directive, DirectiveError& error);
819  Signal constCmd_directiveHandler(const FpySequencer_ConstCmdDirective& directive, DirectiveError& error);
820  Signal stackOp_directiveHandler(const FpySequencer_StackOpDirective& directive, DirectiveError& error);
821 
822  DirectiveError op_or();
823  DirectiveError op_and();
824  DirectiveError op_ieq();
825  DirectiveError op_ine();
826  DirectiveError op_ult();
827  DirectiveError op_ule();
828  DirectiveError op_ugt();
829  DirectiveError op_uge();
830  DirectiveError op_slt();
831  DirectiveError op_sle();
832  DirectiveError op_sgt();
833  DirectiveError op_sge();
834  DirectiveError op_feq();
835  DirectiveError op_fne();
836  DirectiveError op_flt();
837  DirectiveError op_fle();
838  DirectiveError op_fgt();
839  DirectiveError op_fge();
840  DirectiveError op_not();
841  DirectiveError op_fpext();
842  DirectiveError op_fptrunc();
843  DirectiveError op_fptoui();
844  DirectiveError op_fptosi();
845  DirectiveError op_sitofp();
846  DirectiveError op_uitofp();
847  DirectiveError op_add();
848  DirectiveError op_sub();
849  DirectiveError op_mul();
850  DirectiveError op_udiv();
851  DirectiveError op_sdiv();
852  DirectiveError op_umod();
853  DirectiveError op_smod();
854  DirectiveError op_fadd();
855  DirectiveError op_fsub();
856  DirectiveError op_fmul();
857  DirectiveError op_fdiv();
858  DirectiveError op_float_floor_div();
859  DirectiveError op_fpow();
860  DirectiveError op_flog();
861  DirectiveError op_fmod();
862  DirectiveError op_siext_8_64();
863  DirectiveError op_siext_16_64();
864  DirectiveError op_siext_32_64();
865  DirectiveError op_ziext_8_64();
866  DirectiveError op_ziext_16_64();
867  DirectiveError op_ziext_32_64();
868  DirectiveError op_itrunc_64_8();
869  DirectiveError op_itrunc_64_16();
870  DirectiveError op_itrunc_64_32();
871 
872  Signal exit_directiveHandler(const FpySequencer_ExitDirective& directive, DirectiveError& error);
873  Signal allocate_directiveHandler(const FpySequencer_AllocateDirective& directive, DirectiveError& error);
875  Signal storeHelper(Fpy::StackSizeType destOffset, Fpy::StackSizeType size, DirectiveError& error);
877  Signal loadHelper(Fpy::StackSizeType srcOffset, Fpy::StackSizeType size, DirectiveError& error);
878  Signal storeRelConstOffset_directiveHandler(const FpySequencer_StoreRelConstOffsetDirective& directive,
879  DirectiveError& error);
880  Signal loadRel_directiveHandler(const FpySequencer_LoadRelDirective& directive, DirectiveError& error);
881  Signal pushVal_directiveHandler(const FpySequencer_PushValDirective& directive, DirectiveError& error);
882  Signal discard_directiveHandler(const FpySequencer_DiscardDirective& directive, DirectiveError& error);
883  Signal memCmp_directiveHandler(const FpySequencer_MemCmpDirective& directive, DirectiveError& error);
884  Signal stackCmd_directiveHandler(const FpySequencer_StackCmdDirective& directive, DirectiveError& error);
885  Signal pushTime_directiveHandler(const FpySequencer_PushTimeDirective& directive, DirectiveError& error);
886  Signal getField_directiveHandler(const FpySequencer_GetFieldDirective& directive, DirectiveError& error);
887  Signal peek_directiveHandler(const FpySequencer_PeekDirective& directive, DirectiveError& error);
888  Signal storeRel_directiveHandler(const FpySequencer_StoreRelDirective& directive, DirectiveError& error);
889  Signal call_directiveHandler(const FpySequencer_CallDirective& directive, DirectiveError& error);
890  Signal return_directiveHandler(const FpySequencer_ReturnDirective& directive, DirectiveError& error);
891  Signal loadAbs_directiveHandler(const FpySequencer_LoadAbsDirective& directive, DirectiveError& error);
892  Signal storeAbs_directiveHandler(const FpySequencer_StoreAbsDirective& directive, DirectiveError& error);
893  Signal storeAbsConstOffset_directiveHandler(const FpySequencer_StoreAbsConstOffsetDirective& directive,
894  DirectiveError& error);
895  Signal popEvent_directiveHandler(const FpySequencer_PopEventDirective& directive, DirectiveError& error);
896 };
897 
898 } // namespace Svc
899 
900 #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
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 seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args) override
Handler for input port seqRunIn.
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