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"
25 
26 static_assert(Svc::Fpy::MAX_SEQUENCE_ARG_COUNT <= std::numeric_limits<U8>::max(),
27  "Sequence arg count must be below U8 max");
28 static_assert(Svc::Fpy::MAX_SEQUENCE_STATEMENT_COUNT <= std::numeric_limits<U16>::max(),
29  "Sequence statement count must be below U16 max");
30 static_assert(Svc::Fpy::MAX_STACK_SIZE <= std::numeric_limits<Svc::Fpy::StackSizeType>::max(),
31  "Max stack size must be below Svc::Fpy::StackSizeType max");
32 static_assert(Svc::Fpy::MAX_STACK_SIZE >= static_cast<FwSizeType>(FW_TLM_BUFFER_MAX_SIZE),
33  "Max stack size must be greater than max tlm buffer size");
34 static_assert(Svc::Fpy::MAX_STACK_SIZE >= static_cast<FwSizeType>(FW_PARAM_BUFFER_MAX_SIZE),
35  "Max stack size must be greater than max prm buffer size");
36 static_assert(Svc::Fpy::FLAG_COUNT < std::numeric_limits<U8>::max(), "Flag count must be less than U8 max");
37 
38 namespace Svc {
39 
43 
45  friend class FpySequencerTester;
46 
47  public:
78 
81  };
82 
83  class Stack {
84  public:
85  // the byte array of the program stack, storing lvars, operands and function calls
87  // how many bytes high the stack is
89  // the byte offset from the start of the stack where the current function's local variables begin.
90  // analogous to a 'frame pointer'.
92 
93  // pops a value off of the top of the stack
94  // converts it from big endian
95  template <typename T>
96  T pop();
97 
98  // pushes a value onto the top of the stack
99  // converts it to big endian
100  template <typename T>
101  void push(T val);
102 
103  // pops a byte array from the top of the stack into the destination array
104  // does not convert endianness
105  void pop(U8* dest, Fpy::StackSizeType size);
106 
107  // pushes a byte array to the top of the stack from the source array
108  // leaves the source array unmodified
109  // does not convert endianness
110  void push(U8* src, Fpy::StackSizeType size);
111 
112  // pushes zero bytes to the stack
113  void pushZeroes(Fpy::StackSizeType byteCount);
114 
115  // returns a pointer to the next unused byte at the top of the stack
116  U8* top();
117 
118  // Copies data from one region of the stack to another
119  // Asserts that both regions are within bounds and do not overlap
120  // Does not modify stack size
121  void copy(Fpy::StackSizeType destOffset, Fpy::StackSizeType srcOffset, Fpy::StackSizeType copySize);
122 
123  // Moves data within the stack (handles overlapping regions)
124  // Asserts that both source and destination are within bounds
125  // Does not modify stack size
126  void move(Fpy::StackSizeType destOffset, Fpy::StackSizeType srcOffset, Fpy::StackSizeType moveSize);
127  };
128 
129  // ----------------------------------------------------------------------
130  // Construction, initialization, and destruction
131  // ----------------------------------------------------------------------
132 
135  FpySequencer(const char* const compName
136  );
137 
140  ~FpySequencer();
141 
142  private:
146  void RUN_cmdHandler(FwOpcodeType opCode,
147  U32 cmdSeq,
148  const Fw::CmdStringArg& fileName,
150  ) override;
151 
155  void VALIDATE_cmdHandler(FwOpcodeType opCode,
156  U32 cmdSeq,
157  const Fw::CmdStringArg& fileName
158  ) override;
159 
163  void RUN_VALIDATED_cmdHandler(FwOpcodeType opCode,
164  U32 cmdSeq,
166  ) override;
167 
171  void CANCEL_cmdHandler(FwOpcodeType opCode,
172  U32 cmdSeq
173  ) override;
174 
181  void SET_BREAKPOINT_cmdHandler(FwOpcodeType opCode,
182  U32 cmdSeq,
183  U32 stmtIdx,
184  bool breakOnce
185  ) override;
186 
192  void BREAK_cmdHandler(FwOpcodeType opCode,
193  U32 cmdSeq
194  ) override;
195 
200  void CONTINUE_cmdHandler(FwOpcodeType opCode,
201  U32 cmdSeq
202  ) override;
203 
208  void CLEAR_BREAKPOINT_cmdHandler(FwOpcodeType opCode,
209  U32 cmdSeq
210  ) override;
211 
217  void STEP_cmdHandler(FwOpcodeType opCode,
218  U32 cmdSeq
219  ) override;
220 
225  void SET_FLAG_cmdHandler(FwOpcodeType opCode,
226  U32 cmdSeq,
227  Svc::Fpy::FlagId flag,
228  bool value) override;
232  void DUMP_STACK_TO_FILE_cmdHandler(FwOpcodeType opCode,
233  U32 cmdSeq,
234  const Fw::CmdStringArg& fileName
235  ) override;
236 
237  // ----------------------------------------------------------------------
238  // Functions to implement for internal state machine actions
239  // ----------------------------------------------------------------------
240 
244  void Svc_FpySequencer_SequencerStateMachine_action_signalEntered(
245  SmId smId,
247  ) override;
248 
252  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceFilePath(
253  SmId smId,
256  ) override;
257 
261  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceBlockState(
262  SmId smId,
265  ) override;
266 
270  void Svc_FpySequencer_SequencerStateMachine_action_validate(
271  SmId smId,
273  ) override;
274 
278  void Svc_FpySequencer_SequencerStateMachine_action_report_seqSucceeded(
279  SmId smId,
281  ) override;
282 
286  void Svc_FpySequencer_SequencerStateMachine_action_report_seqCancelled(
287  SmId smId,
289  ) override;
290 
294  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_RUNNING(
295  SmId smId,
297  ) override;
298 
302  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_VALID(
303  SmId smId,
305  ) override;
306 
310  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_IDLE(
311  SmId smId,
313  ) override;
314 
318  void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_OK(
319  SmId smId,
321  ) override;
322 
327  void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_EXECUTION_ERROR(
328  SmId smId,
330  ) override;
331 
335  void Svc_FpySequencer_SequencerStateMachine_action_dispatchStatement(
336  SmId smId,
338  ) override;
339 
343  void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceFile(
344  SmId smId,
346  ) override;
347 
351  void Svc_FpySequencer_SequencerStateMachine_action_checkShouldWake(
352  SmId smId,
354  ) override;
355 
359  void Svc_FpySequencer_SequencerStateMachine_action_resetRuntime(
360  SmId smId,
362  ) override;
363 
367  void Svc_FpySequencer_SequencerStateMachine_action_checkStatementTimeout(
368  SmId smId,
370  ) override;
371 
375  void Svc_FpySequencer_SequencerStateMachine_action_incrementSequenceCounter(
376  SmId smId,
378  ) override;
379 
383  void Svc_FpySequencer_SequencerStateMachine_action_clearBreakpoint(
384  SmId smId,
386  ) override;
387 
391  void Svc_FpySequencer_SequencerStateMachine_action_report_seqBroken(
392  SmId smId,
394  ) override;
395 
399  void Svc_FpySequencer_SequencerStateMachine_action_setBreakpoint(
400  SmId smId,
403  ) override;
404 
408  void Svc_FpySequencer_SequencerStateMachine_action_setBreakBeforeNextLine(
409  SmId smId,
411  ) override;
412 
416  void Svc_FpySequencer_SequencerStateMachine_action_clearBreakBeforeNextLine(
417  SmId smId,
419  ) override;
420 
424  void Svc_FpySequencer_SequencerStateMachine_action_report_seqFailed(
425  SmId smId,
427  ) override;
428 
432  void Svc_FpySequencer_SequencerStateMachine_action_report_seqStarted(
433  SmId smId,
435  ) override;
436 
437  protected:
438  // ----------------------------------------------------------------------
439  // Functions to implement for internal state machine guards
440  // ----------------------------------------------------------------------
441 
446  SmId smId,
448  ) const override;
449 
455  SmId smId,
457  ) const override;
458 
463  SmId smId,
465  ) const override;
466 
467  // ----------------------------------------------------------------------
468  // Handlers to implement for typed input ports
469  // ----------------------------------------------------------------------
470 
472  void checkTimers_handler(FwIndexType portNum,
473  U32 context
474  ) override;
475 
477  void cmdResponseIn_handler(FwIndexType portNum,
478  FwOpcodeType opCode,
479  U32 cmdSeq,
480  const Fw::CmdResponse& response
481  ) override;
482 
484  void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename) override;
485 
487  void pingIn_handler(FwIndexType portNum,
488  U32 key
489  ) override;
490 
492  void tlmWrite_handler(FwIndexType portNum,
493  U32 context
494  ) override;
495 
498 
501 
504 
507 
510 
513 
516  const Svc::FpySequencer_PushTlmValAndTimeDirective& directive) override;
517 
520 
523 
526 
529 
532 
535  const Svc::FpySequencer_StoreRelConstOffsetDirective& directive) override;
536 
539 
542 
545 
548 
551 
554 
557 
560 
563 
566 
569 
572 
575 
578 
581 
584  const Svc::FpySequencer_StoreAbsConstOffsetDirective& directive) override;
585 
586  void parametersLoaded() override;
587  void parameterUpdated(FwPrmIdType id) override;
588 
589  public:
590  void allocateBuffer(FwEnumStoreType identifier, Fw::MemAllocator& allocator, FwSizeType bytes);
591 
592  void deallocateBuffer(Fw::MemAllocator& allocator);
593 
594  private:
595  static constexpr U32 CRC_INITIAL_VALUE = 0xFFFFFFFFU;
596 
597  // allocated at startup
598  Fw::ExternalSerializeBuffer m_sequenceBuffer;
599  // id of allocator that gave us m_sequenceBuffer
600  FwEnumStoreType m_allocatorId;
601 
602  // assigned by the user via cmd
603  Fw::String m_sequenceFilePath;
604  // the sequence, loaded in memory
605  Fpy::Sequence m_sequenceObj;
606  // live running computation of CRC (updated as we read)
607  U32 m_computedCRC;
608 
609  // whether or not the sequence we're about to run should return immediately or
610  // block on completion
611  FpySequencer_BlockState m_sequenceBlockState;
612  // if we are to block on completion, save the opCode and cmdSeq we should
613  // return
614  FwOpcodeType m_savedOpCode;
615  U32 m_savedCmdSeq;
616 
617  // the goal state is the state that we're trying to reach in the sequencer
618  // if it's RUNNING, then we should promptly go to RUNNING once we validate the
619  // sequence. if it's VALID, we should wait after VALIDATING
620  FpySequencer_GoalState m_goalState;
621 
622  // the total number of sequences this sequencer has started since construction
623  U64 m_sequencesStarted;
624  // the total number of statements this sequencer has dispatched, successfully or
625  // otherwise, since construction
626  U64 m_statementsDispatched;
627 
628  // the runtime state of the sequence. encapsulates all state
629  // needed to run the sequence.
630  // this is distinct from the state of the sequencer. the
631  // sequencer and all its state is really just a shell to load
632  // and execute this runtime.
633  struct Runtime {
634  // the index of the next statement to be executed
635  U32 nextStatementIndex = 0;
636 
637  // the opcode of the statement that is currently executing
638  U8 currentStatementOpcode = Fpy::DirectiveId::INVALID;
639  // the opcode of the command that we are currently awaiting, or 0 if we are executing a directive
640  FwOpcodeType currentCmdOpcode = 0;
641  // the time we dispatched the statement that is currently executing
642  Fw::Time currentStatementDispatchTime = Fw::Time();
643 
644  // the absolute time we should wait for until returning
645  // a statement response
646  Fw::Time wakeupTime = Fw::Time();
647 
648  Stack stack = Stack();
649 
650  // the sequencer runtime flags. these are modifiable by the sequence and control
651  // various aspects of the sequencer.
652  // these get set to a default value from FpySequencerCfg
653  bool flags[Fpy::FLAG_COUNT] = {0};
654  } m_runtime;
655 
656  // the state of the debugger. debugger is separate from runtime
657  // because it can be set up before running the sequence.
658  struct BreakpointInfo {
659  // whether or not to break at the debug breakpoint index
660  bool breakpointInUse = false;
661  // whether or not to remove the breakpoint after breaking on it
662  bool breakOnlyOnceOnBreakpoint = false;
663  // the statement index at which to break, before dispatching
664  U32 breakpointIndex = 0;
665  // whether or not to break before dispatching the next line,
666  // independent of what line it is.
667  // can be used in combination with breakpointIndex
668  bool breakBeforeNextLine = false;
669  } m_breakpoint;
670 
671  // debug information about the sequence. only valid in the PAUSED state
672  // which you can access via BREAK or SET_BREAKPOINT cmds
673  struct DebugInfo {
674  // true if there are no statements remaining in the sequence file
675  bool reachedEndOfFile = false;
676  // true if we were able to deserialize the next statement successfully
677  bool nextStatementReadSuccess = false;
678  // the opcode of the next statement to dispatch.
679  U8 nextStatementOpcode = 0;
680  // if the next statement is a cmd directive, the opcode of that cmd
681  FwOpcodeType nextCmdOpcode = 0;
682  // the size of the stack. store this separately from the real stack size
683  // so we can avoid changing this during runtime, only modify it during
684  // debug
685  Fpy::StackSizeType stackSize = 0;
686  } m_debug;
687 
688  struct Telemetry {
689  // the number of statements that failed to execute
690  U64 statementsFailed = 0;
691  // the number of sequences successfully completed
692  U64 sequencesSucceeded = 0;
693  // the number of sequences that failed to validate or execute
694  U64 sequencesFailed = 0;
695  // the number of sequences that have been cancelled
696  U64 sequencesCancelled = 0;
697 
698  // the error code of the last directive that ran
699  DirectiveError lastDirectiveError = DirectiveError::NO_ERROR;
700  // the index of the last directive that errored
701  U64 directiveErrorIndex = 0;
702  // the opcode of the last directive that errored
703  Fpy::DirectiveId directiveErrorId = Fpy::DirectiveId::INVALID;
704  } m_tlm;
705 
706  // ----------------------------------------------------------------------
707  // Validation state
708  // ----------------------------------------------------------------------
709 
710  static void updateCrc(U32& crc,
711  const U8* buffer,
712  FwSizeType bufferSize
713  );
714 
715  // loads the sequence in memory, and does header/crc/integrity checks.
716  // return SUCCESS if sequence is valid, FAILURE otherwise
717  Fw::Success validate();
718  // reads and validates the header from the m_sequenceBuffer
719  // return SUCCESS if sequence is valid, FAILURE otherwise
720  Fw::Success readHeader();
721  // reads and validates the body from the m_sequenceBuffer
722  // return SUCCESS if sequence is valid, FAILURE otherwise
723  Fw::Success readBody();
724  // reads and validates the footer from the m_sequenceBuffer
725  // return SUCCESS if sequence is valid, FAILURE otherwise
726  Fw::Success readFooter();
727 
728  // reads some bytes from the open file into the m_sequenceBuffer.
729  // updates the CRC by default, but can be turned off if the contents
730  // aren't included in CRC.
731  // return success if successful
732  Fw::Success readBytes(Os::File& file,
733  FwSizeType readLen,
734  const FpySequencer_FileReadStage& readStage,
735  bool updateCrc = true);
736 
737  // ----------------------------------------------------------------------
738  // Run state
739  // ----------------------------------------------------------------------
740 
741  // utility method for updating telemetry based on a directive error code
742  void handleDirectiveErrorCode(Fpy::DirectiveId id, DirectiveError err);
743 
744  // dispatches the next statement
745  Signal dispatchStatement();
746 
747  // deserializes a directive from bytes into the Fpy type
748  // returns success if able to deserialize, and returns the Fpy type object
749  // as a reference, in a union of all the possible directive type objects
750  Fw::Success deserializeDirective(const Fpy::Statement& stmt, DirectiveUnion& deserializedDirective);
751 
752  // dispatches a deserialized sequencer directive to the right handler.
753  void dispatchDirective(const DirectiveUnion& directive, const Fpy::DirectiveId& id);
754 
755  // checks whether the currently executing statement timed out
756  Signal checkStatementTimeout();
757 
758  // checks whether the sequencer should wake from sleeping
759  Signal checkShouldWake();
760 
761  // return true if state is a substate of RUNNING
762  bool isRunningState(State state);
763 
764  // update a struct containing debug telemetry, or defaults if not in debug break
765  void updateDebugTelemetryStruct();
766 
767  // ----------------------------------------------------------------------
768  // Directives
769  // ----------------------------------------------------------------------
770 
771  // sends a signal based on a signal id
772  void sendSignal(Signal signal);
773 
774  // dispatches a command, returns whether successful or not
775  Fw::Success sendCmd(FwOpcodeType opcode, const U8* argBuf, FwSizeType argBufSize);
776 
777  // returns the index of the current statement
778  U32 currentStatementIdx();
779 
780  // we split these functions up into the internalInterfaceInvoke and these custom member funcs
781  // so that we can unit test them easier
782  Signal waitRel_directiveHandler(const FpySequencer_WaitRelDirective& directive, DirectiveError& error);
783  Signal waitAbs_directiveHandler(const FpySequencer_WaitAbsDirective& directive, DirectiveError& error);
784  Signal goto_directiveHandler(const FpySequencer_GotoDirective& directive, DirectiveError& error);
785  Signal if_directiveHandler(const FpySequencer_IfDirective& directive, DirectiveError& error);
786  Signal noOp_directiveHandler(const FpySequencer_NoOpDirective& directive, DirectiveError& error);
787  Signal pushTlmVal_directiveHandler(const FpySequencer_PushTlmValDirective& directive, DirectiveError& error);
788  Signal pushTlmValAndTime_directiveHandler(const FpySequencer_PushTlmValAndTimeDirective& directive,
789  DirectiveError& error);
790  Signal pushPrm_directiveHandler(const FpySequencer_PushPrmDirective& directive, DirectiveError& error);
791  Signal constCmd_directiveHandler(const FpySequencer_ConstCmdDirective& directive, DirectiveError& error);
792  Signal stackOp_directiveHandler(const FpySequencer_StackOpDirective& directive, DirectiveError& error);
793 
794  DirectiveError op_or();
795  DirectiveError op_and();
796  DirectiveError op_ieq();
797  DirectiveError op_ine();
798  DirectiveError op_ult();
799  DirectiveError op_ule();
800  DirectiveError op_ugt();
801  DirectiveError op_uge();
802  DirectiveError op_slt();
803  DirectiveError op_sle();
804  DirectiveError op_sgt();
805  DirectiveError op_sge();
806  DirectiveError op_feq();
807  DirectiveError op_fne();
808  DirectiveError op_flt();
809  DirectiveError op_fle();
810  DirectiveError op_fgt();
811  DirectiveError op_fge();
812  DirectiveError op_not();
813  DirectiveError op_fpext();
814  DirectiveError op_fptrunc();
815  DirectiveError op_fptoui();
816  DirectiveError op_fptosi();
817  DirectiveError op_sitofp();
818  DirectiveError op_uitofp();
819  DirectiveError op_add();
820  DirectiveError op_sub();
821  DirectiveError op_mul();
822  DirectiveError op_udiv();
823  DirectiveError op_sdiv();
824  DirectiveError op_umod();
825  DirectiveError op_smod();
826  DirectiveError op_fadd();
827  DirectiveError op_fsub();
828  DirectiveError op_fmul();
829  DirectiveError op_fdiv();
830  DirectiveError op_float_floor_div();
831  DirectiveError op_fpow();
832  DirectiveError op_flog();
833  DirectiveError op_fmod();
834  DirectiveError op_siext_8_64();
835  DirectiveError op_siext_16_64();
836  DirectiveError op_siext_32_64();
837  DirectiveError op_ziext_8_64();
838  DirectiveError op_ziext_16_64();
839  DirectiveError op_ziext_32_64();
840  DirectiveError op_itrunc_64_8();
841  DirectiveError op_itrunc_64_16();
842  DirectiveError op_itrunc_64_32();
843 
844  Signal exit_directiveHandler(const FpySequencer_ExitDirective& directive, DirectiveError& error);
845  Signal allocate_directiveHandler(const FpySequencer_AllocateDirective& directive, DirectiveError& error);
847  Signal storeHelper(Fpy::StackSizeType destOffset, Fpy::StackSizeType size, DirectiveError& error);
849  Signal loadHelper(Fpy::StackSizeType srcOffset, Fpy::StackSizeType size, DirectiveError& error);
850  Signal storeRelConstOffset_directiveHandler(const FpySequencer_StoreRelConstOffsetDirective& directive,
851  DirectiveError& error);
852  Signal loadRel_directiveHandler(const FpySequencer_LoadRelDirective& directive, DirectiveError& error);
853  Signal pushVal_directiveHandler(const FpySequencer_PushValDirective& directive, DirectiveError& error);
854  Signal discard_directiveHandler(const FpySequencer_DiscardDirective& directive, DirectiveError& error);
855  Signal memCmp_directiveHandler(const FpySequencer_MemCmpDirective& directive, DirectiveError& error);
856  Signal stackCmd_directiveHandler(const FpySequencer_StackCmdDirective& directive, DirectiveError& error);
857  Signal pushTime_directiveHandler(const FpySequencer_PushTimeDirective& directive, DirectiveError& error);
858  Signal setFlag_directiveHandler(const FpySequencer_SetFlagDirective& directive, DirectiveError& error);
859  Signal getFlag_directiveHandler(const FpySequencer_GetFlagDirective& directive, DirectiveError& error);
860  Signal getField_directiveHandler(const FpySequencer_GetFieldDirective& directive, DirectiveError& error);
861  Signal peek_directiveHandler(const FpySequencer_PeekDirective& directive, DirectiveError& error);
862  Signal storeRel_directiveHandler(const FpySequencer_StoreRelDirective& directive, DirectiveError& error);
863  Signal call_directiveHandler(const FpySequencer_CallDirective& directive, DirectiveError& error);
864  Signal return_directiveHandler(const FpySequencer_ReturnDirective& directive, DirectiveError& error);
865  Signal loadAbs_directiveHandler(const FpySequencer_LoadAbsDirective& directive, DirectiveError& error);
866  Signal storeAbs_directiveHandler(const FpySequencer_StoreAbsDirective& directive, DirectiveError& error);
867  Signal storeAbsConstOffset_directiveHandler(const FpySequencer_StoreAbsConstOffsetDirective& directive,
868  DirectiveError& error);
869 };
870 
871 } // namespace Svc
872 
873 #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
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.
void pushZeroes(Fpy::StackSizeType byteCount)
FpySequencer_GetFlagDirective getFlag
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 directive_getFlag_internalInterfaceHandler(const Svc::FpySequencer_GetFlagDirective &directive) override
Internal interface handler for directive_getFlag.
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
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
stores a value to a local variable at a runtime-determined offset relative to the current stack frame...
RateGroupDivider component implementation.
FpySequencer_SetFlagDirective setFlag
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 directive_setFlag_internalInterfaceHandler(const Svc::FpySequencer_SetFlagDirective &directive) override
Internal interface handler for directive_setFlag.
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.
pops a bool off the stack, sets a flag with a specific index to that bool
FpySequencer_ExitDirective exit
gets a flag and pushes its value as a U8 to the stack
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