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 
12 #include "Fw/Types/StringBase.hpp"
14 #include "Fw/Types/WaitEnumAc.hpp"
15 #include "Os/File.hpp"
26 
27 static_assert(Svc::Fpy::MAX_SEQUENCE_ARG_COUNT <= std::numeric_limits<U8>::max(),
28  "Sequence arg count must be below U8 max");
29 static_assert(Svc::Fpy::MAX_SEQUENCE_STATEMENT_COUNT <= std::numeric_limits<U16>::max(),
30  "Sequence statement count must be below U16 max");
31 static_assert(Svc::Fpy::MAX_STACK_SIZE <= std::numeric_limits<Svc::Fpy::StackSizeType>::max(),
32  "Max stack size must be below Svc::Fpy::StackSizeType max");
33 static_assert(Svc::Fpy::MAX_STACK_SIZE >= static_cast<FwSizeType>(FW_TLM_BUFFER_MAX_SIZE),
34  "Max stack size must be greater than max tlm buffer size");
35 static_assert(Svc::Fpy::MAX_STACK_SIZE >= static_cast<FwSizeType>(FW_PARAM_BUFFER_MAX_SIZE),
36  "Max stack size must be greater than max prm buffer size");
37 
38 namespace Svc {
39 
43 
45  friend class FpySequencerTester;
46 
47  public:
77 
80  };
81 
82  class Stack {
83  public:
84  // the byte array of the program stack, storing lvars, operands and function calls
86  // how many bytes high the stack is
88  // the byte offset from the start of the stack where the current function's local variables begin.
89  // analogous to a 'frame pointer'.
91 
92  // pops a value off of the top of the stack
93  // converts it from big endian
94  template <typename T>
95  T pop();
96 
97  // pushes a value onto the top of the stack
98  // converts it to big endian
99  template <typename T>
100  void push(T val);
101 
102  // pops a byte array from the top of the stack into the destination array
103  // does not convert endianness
104  void pop(U8* dest, Fpy::StackSizeType size);
105 
106  // pushes a byte array to the top of the stack from the source array
107  // leaves the source array unmodified
108  // does not convert endianness
109  void push(const U8* src, Fpy::StackSizeType size);
110 
111  // pushes zero bytes to the stack
112  void pushZeroes(Fpy::StackSizeType byteCount);
113 
114  // returns a pointer to the next unused byte at the top of the stack
115  U8* top();
116 
117  // Copies data from one region of the stack to another
118  // Asserts that both regions are within bounds and do not overlap
119  // Does not modify stack size
120  void copy(Fpy::StackSizeType destOffset, Fpy::StackSizeType srcOffset, Fpy::StackSizeType copySize);
121 
122  // Moves data within the stack (handles overlapping regions)
123  // Asserts that both source and destination are within bounds
124  // Does not modify stack size
125  void move(Fpy::StackSizeType destOffset, Fpy::StackSizeType srcOffset, Fpy::StackSizeType moveSize);
126  };
127 
128  // ----------------------------------------------------------------------
129  // Construction, initialization, and destruction
130  // ----------------------------------------------------------------------
131 
134  FpySequencer(const char* const compName
135  );
136 
139  ~FpySequencer();
140 
141  private:
145  void RUN_cmdHandler(FwOpcodeType opCode,
146  U32 cmdSeq,
147  const Fw::CmdStringArg& fileName,
148  Svc::BlockState block
149  ) override;
150 
152  void RUN_ARGS_cmdHandler(FwOpcodeType opCode,
153  U32 cmdSeq,
154  const Fw::CmdStringArg& fileName,
155  Svc::BlockState block,
156  Svc::SeqArgs args
157  ) override;
158 
162  void VALIDATE_cmdHandler(FwOpcodeType opCode,
163  U32 cmdSeq,
164  const Fw::CmdStringArg& fileName
165  ) override;
166 
170  void VALIDATE_ARGS_cmdHandler(FwOpcodeType opCode,
171  U32 cmdSeq,
172  const Fw::CmdStringArg& fileName,
173  Svc::SeqArgs buffer
174  ) override;
175 
179  void RUN_VALIDATED_cmdHandler(FwOpcodeType opCode,
180  U32 cmdSeq,
181  Svc::BlockState block
182  ) override;
183 
187  void CANCEL_cmdHandler(FwOpcodeType opCode,
188  U32 cmdSeq
189  ) override;
190 
197  void SET_BREAKPOINT_cmdHandler(FwOpcodeType opCode,
198  U32 cmdSeq,
199  U32 stmtIdx,
200  bool breakOnce
201  ) override;
202 
208  void BREAK_cmdHandler(FwOpcodeType opCode,
209  U32 cmdSeq
210  ) override;
211 
216  void CONTINUE_cmdHandler(FwOpcodeType opCode,
217  U32 cmdSeq
218  ) override;
219 
224  void CLEAR_BREAKPOINT_cmdHandler(FwOpcodeType opCode,
225  U32 cmdSeq
226  ) override;
227 
233  void STEP_cmdHandler(FwOpcodeType opCode,
234  U32 cmdSeq
235  ) override;
236 
240  void DUMP_STACK_TO_FILE_cmdHandler(FwOpcodeType opCode,
241  U32 cmdSeq,
242  const Fw::CmdStringArg& fileName
243  ) override;
244 
245  // ----------------------------------------------------------------------
246  // Functions to implement for internal state machine actions
247  // ----------------------------------------------------------------------
248 
252  void Svc_FpySequencer_SequencerStateMachine_action_signalEntered(
253  SmId smId,
255  ) override;
256 
260  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceFilePath(
261  SmId smId,
264  ) override;
265 
269  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceBlockState(
270  SmId smId,
273  ) override;
274 
278  void Svc_FpySequencer_SequencerStateMachine_action_setSequenceArguments(
279  SmId smId,
282  ) override;
283 
287  void Svc_FpySequencer_SequencerStateMachine_action_validate(
288  SmId smId,
290  ) override;
291 
295  void Svc_FpySequencer_SequencerStateMachine_action_report_seqSucceeded(
296  SmId smId,
298  ) override;
299 
303  void Svc_FpySequencer_SequencerStateMachine_action_report_seqCancelled(
304  SmId smId,
306  ) override;
307 
311  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_RUNNING(
312  SmId smId,
314  ) override;
315 
319  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_VALID(
320  SmId smId,
322  ) override;
323 
327  void Svc_FpySequencer_SequencerStateMachine_action_setGoalState_IDLE(
328  SmId smId,
330  ) override;
331 
335  void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_OK(
336  SmId smId,
338  ) override;
339 
344  void Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_EXECUTION_ERROR(
345  SmId smId,
347  ) override;
348 
352  void Svc_FpySequencer_SequencerStateMachine_action_dispatchStatement(
353  SmId smId,
355  ) override;
356 
360  void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceFile(
361  SmId smId,
363  ) override;
364 
368  void Svc_FpySequencer_SequencerStateMachine_action_clearSequenceArguments(
369  SmId smId,
371  ) override;
372 
376  void Svc_FpySequencer_SequencerStateMachine_action_checkShouldWake(
377  SmId smId,
379  ) override;
380 
384  void Svc_FpySequencer_SequencerStateMachine_action_resetRuntime(
385  SmId smId,
387  ) override;
388 
392  void Svc_FpySequencer_SequencerStateMachine_action_checkStatementTimeout(
393  SmId smId,
395  ) override;
396 
400  void Svc_FpySequencer_SequencerStateMachine_action_incrementSequenceCounter(
401  SmId smId,
403  ) override;
404 
408  void Svc_FpySequencer_SequencerStateMachine_action_pushArgsToStack(
409  SmId smId,
411  ) override;
412 
416  void Svc_FpySequencer_SequencerStateMachine_action_clearBreakpoint(
417  SmId smId,
419  ) override;
420 
424  void Svc_FpySequencer_SequencerStateMachine_action_report_seqBroken(
425  SmId smId,
427  ) override;
428 
432  void Svc_FpySequencer_SequencerStateMachine_action_setBreakpoint(
433  SmId smId,
436  ) override;
437 
441  void Svc_FpySequencer_SequencerStateMachine_action_setBreakBeforeNextLine(
442  SmId smId,
444  ) override;
445 
449  void Svc_FpySequencer_SequencerStateMachine_action_clearBreakBeforeNextLine(
450  SmId smId,
452  ) override;
453 
457  void Svc_FpySequencer_SequencerStateMachine_action_report_seqFailed(
458  SmId smId,
460  ) override;
461 
465  void Svc_FpySequencer_SequencerStateMachine_action_report_seqStarted(
466  SmId smId,
468  ) override;
469 
470  protected:
471  // ----------------------------------------------------------------------
472  // Functions to implement for internal state machine guards
473  // ----------------------------------------------------------------------
474 
479  SmId smId,
481  ) const override;
482 
488  SmId smId,
490  ) const override;
491 
496  SmId smId,
498  ) const override;
499 
500  // ----------------------------------------------------------------------
501  // Handlers to implement for typed input ports
502  // ----------------------------------------------------------------------
503 
505  void checkTimers_handler(FwIndexType portNum,
506  U32 context
507  ) override;
508 
510  void cmdResponseIn_handler(FwIndexType portNum,
511  FwOpcodeType opCode,
512  U32 cmdSeq,
513  const Fw::CmdResponse& response
514  ) override;
515 
517  void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename, const Svc::SeqArgs& args) override;
518 
522  void seqCancelIn_handler(FwIndexType portNum
523  ) override;
524 
526  void pingIn_handler(FwIndexType portNum,
527  U32 key
528  ) override;
529 
531  void tlmWrite_handler(FwIndexType portNum,
532  U32 context
533  ) override;
534 
537 
540 
543 
546 
549 
552 
555  const Svc::FpySequencer_PushTlmValAndTimeDirective& directive) override;
556 
559 
562 
565 
568 
571 
574  const Svc::FpySequencer_StoreRelConstOffsetDirective& directive) override;
575 
578 
581 
584 
587 
590 
593 
596 
599 
602 
605 
608 
611 
614 
617  const Svc::FpySequencer_StoreAbsConstOffsetDirective& directive) override;
618 
621 
622  void parametersLoaded() override;
623  void parameterUpdated(FwPrmIdType id) override;
624 
625  public:
626  void allocateBuffer(FwEnumStoreType identifier, Fw::MemAllocator& allocator, FwSizeType bytes);
627 
628  void deallocateBuffer(Fw::MemAllocator& allocator);
629 
630  private:
631  static constexpr U32 CRC_INITIAL_VALUE = 0xFFFFFFFFU;
632 
633  // allocated at startup
634  Fw::ExternalSerializeBuffer m_sequenceBuffer;
635  // id of allocator that gave us m_sequenceBuffer
636  FwEnumStoreType m_allocatorId;
637 
638  // assigned by the user via cmd
639  // length is FileNameStringSize
640  Fw::FileNameString m_sequenceFilePath;
641  // the sequence, loaded in memory
642  Fpy::Sequence m_sequenceObj;
643  // live running computation of CRC (updated as we read)
644  U32 m_computedCRC;
645 
646  // Size of arguments read in current sequence. Used for validation between
647  // User provided arguments and what is requested of the sequence.
648  Fpy::StackSizeType m_totalExpectedArgSize;
649 
650  // whether or not the sequence we're about to run should return immediately or
651  // block on completion
652  Svc::BlockState m_sequenceBlockState;
653  // if we are to block on completion, save the opCode and cmdSeq we should
654  // return
655  FwOpcodeType m_savedOpCode;
656  U32 m_savedCmdSeq;
657 
658  // sequence arguments to push to stack when entering RUNNING state
659  Svc::SeqArgs m_sequenceArgs{};
660 
661  // the goal state is the state that we're trying to reach in the sequencer
662  // if it's RUNNING, then we should promptly go to RUNNING once we validate the
663  // sequence. if it's VALID, we should wait after VALIDATING
664  FpySequencer_GoalState m_goalState;
665 
666  // the total number of sequences this sequencer has started since construction
667  U64 m_sequencesStarted;
668  // the total number of statements this sequencer has dispatched, successfully or
669  // otherwise, since construction
670  U64 m_statementsDispatched;
671 
672  // the runtime state of the sequence. encapsulates all state
673  // needed to run the sequence.
674  // this is distinct from the state of the sequencer. the
675  // sequencer and all its state is really just a shell to load
676  // and execute this runtime.
677  struct Runtime {
678  // the index of the next statement to be executed
679  U32 nextStatementIndex = 0;
680 
681  // the opcode of the statement that is currently executing
682  U8 currentStatementOpcode = Fpy::DirectiveId::INVALID;
683  // the opcode of the command that we are currently awaiting, or 0 if we are executing a directive
684  FwOpcodeType currentCmdOpcode = 0;
685  // the time we dispatched the statement that is currently executing
686  Fw::Time currentStatementDispatchTime = Fw::Time();
687 
688  // the absolute time we should wait for until returning
689  // a statement response
690  Fw::Time wakeupTime = Fw::Time();
691 
692  Stack stack = Stack();
693  } m_runtime;
694 
695  // the state of the debugger. debugger is separate from runtime
696  // because it can be set up before running the sequence.
697  struct BreakpointInfo {
698  // whether or not to break at the debug breakpoint index
699  bool breakpointInUse = false;
700  // whether or not to remove the breakpoint after breaking on it
701  bool breakOnlyOnceOnBreakpoint = false;
702  // the statement index at which to break, before dispatching
703  U32 breakpointIndex = 0;
704  // whether or not to break before dispatching the next line,
705  // independent of what line it is.
706  // can be used in combination with breakpointIndex
707  bool breakBeforeNextLine = false;
708  } m_breakpoint;
709 
710  // debug information about the sequence. only valid in the PAUSED state
711  // which you can access via BREAK or SET_BREAKPOINT cmds
712  struct DebugInfo {
713  // true if there are no statements remaining in the sequence file
714  bool reachedEndOfFile = false;
715  // true if we were able to deserialize the next statement successfully
716  bool nextStatementReadSuccess = false;
717  // the opcode of the next statement to dispatch.
718  U8 nextStatementOpcode = 0;
719  // if the next statement is a cmd directive, the opcode of that cmd
720  FwOpcodeType nextCmdOpcode = 0;
721  // the index of the next statement we're going to execute
722  U32 nextStatementIndex = 0;
723  // the size of the stack. store this separately from the real stack size
724  // so we can avoid changing this during runtime, only modify it during
725  // debug
726  Fpy::StackSizeType stackSize = 0;
727  } m_debug;
728 
729  struct Telemetry {
730  // the number of statements that failed to execute
731  U64 statementsFailed = 0;
732  // the number of sequences successfully completed
733  U64 sequencesSucceeded = 0;
734  // the number of sequences that failed to validate or execute
735  U64 sequencesFailed = 0;
736  // the number of sequences that have been cancelled
737  U64 sequencesCancelled = 0;
738 
739  // the error code of the last directive that ran
740  DirectiveError lastDirectiveError = DirectiveError::NO_ERROR;
741  // the index of the last directive that errored
742  U64 directiveErrorIndex = 0;
743  // the opcode of the last directive that errored
744  Fpy::DirectiveId directiveErrorId = Fpy::DirectiveId::INVALID;
745  } m_tlm;
746 
747  // ----------------------------------------------------------------------
748  // Validation state
749  // ----------------------------------------------------------------------
750 
751  static void updateCrc(U32& crc,
752  const U8* buffer,
753  FwSizeType bufferSize
754  );
755 
756  // loads the sequence in memory, and does header/crc/integrity checks.
757  // return SUCCESS if sequence is valid, FAILURE otherwise
758  Fw::Success validate();
759  // reads and validates the header from the m_sequenceBuffer
760  // return SUCCESS if sequence is valid, FAILURE otherwise
761  Fw::Success readHeader();
762  // reads and validates the body from the m_sequenceBuffer
763  // return SUCCESS if sequence is valid, FAILURE otherwise
764  Fw::Success readBody();
765  // reads and validates the footer from the m_sequenceBuffer
766  // return SUCCESS if sequence is valid, FAILURE otherwise
767  Fw::Success readFooter();
768 
769  // reads some bytes from the open file into the m_sequenceBuffer.
770  // updates the CRC by default, but can be turned off if the contents
771  // aren't included in CRC.
772  // return success if successful
773  Fw::Success readBytes(Os::File& file,
774  FwSizeType readLen,
775  const FpySequencer_FileReadStage& readStage,
776  bool updateCrc = true);
777 
778  // ----------------------------------------------------------------------
779  // Run state
780  // ----------------------------------------------------------------------
781 
782  // utility method for updating telemetry based on a directive error code
783  void handleDirectiveErrorCode(Fpy::DirectiveId id, DirectiveError err);
784 
785  // dispatches the next statement
786  Signal dispatchStatement();
787 
788  // deserializes a directive from bytes into the Fpy type
789  // returns success if able to deserialize, and returns the Fpy type object
790  // as a reference, in a union of all the possible directive type objects
791  Fw::Success deserializeDirective(const Fpy::Statement& stmt, DirectiveUnion& deserializedDirective);
792 
793  // dispatches a deserialized sequencer directive to the right handler.
794  void dispatchDirective(const DirectiveUnion& directive, const Fpy::DirectiveId& id);
795 
796  // checks whether the currently executing statement timed out
797  Signal checkStatementTimeout();
798 
799  // checks whether the sequencer should wake from sleeping
800  Signal checkShouldWake();
801 
802  // return true if state is a substate of RUNNING
803  bool isRunningState(State state);
804 
805  // update a struct containing debug telemetry, or defaults if not in debug break
806  void updateDebugTelemetryStruct();
807 
808  // ----------------------------------------------------------------------
809  // Directives
810  // ----------------------------------------------------------------------
811 
812  // sends a signal based on a signal id
813  void sendSignal(Signal signal);
814 
815  // dispatches a command, returns whether successful or not
816  Fw::Success sendCmd(FwOpcodeType opcode, const U8* argBuf, FwSizeType argBufSize);
817 
818  // returns the index of the current statement
819  U32 currentStatementIdx();
820 
821  // we split these functions up into the internalInterfaceInvoke and these custom member funcs
822  // so that we can unit test them easier
823  Signal waitRel_directiveHandler(const FpySequencer_WaitRelDirective& directive, DirectiveError& error);
824  Signal waitAbs_directiveHandler(const FpySequencer_WaitAbsDirective& directive, DirectiveError& error);
825  Signal goto_directiveHandler(const FpySequencer_GotoDirective& directive, DirectiveError& error);
826  Signal if_directiveHandler(const FpySequencer_IfDirective& directive, DirectiveError& error);
827  Signal noOp_directiveHandler(const FpySequencer_NoOpDirective& directive, DirectiveError& error);
828  Signal pushTlmVal_directiveHandler(const FpySequencer_PushTlmValDirective& directive, DirectiveError& error);
829  Signal pushTlmValAndTime_directiveHandler(const FpySequencer_PushTlmValAndTimeDirective& directive,
830  DirectiveError& error);
831  Signal pushPrm_directiveHandler(const FpySequencer_PushPrmDirective& directive, DirectiveError& error);
832  Signal constCmd_directiveHandler(const FpySequencer_ConstCmdDirective& directive, DirectiveError& error);
833  Signal stackOp_directiveHandler(const FpySequencer_StackOpDirective& directive, DirectiveError& error);
834 
835  DirectiveError op_or();
836  DirectiveError op_and();
837  DirectiveError op_ieq();
838  DirectiveError op_ine();
839  DirectiveError op_ult();
840  DirectiveError op_ule();
841  DirectiveError op_ugt();
842  DirectiveError op_uge();
843  DirectiveError op_slt();
844  DirectiveError op_sle();
845  DirectiveError op_sgt();
846  DirectiveError op_sge();
847  DirectiveError op_feq();
848  DirectiveError op_fne();
849  DirectiveError op_flt();
850  DirectiveError op_fle();
851  DirectiveError op_fgt();
852  DirectiveError op_fge();
853  DirectiveError op_not();
854  DirectiveError op_fpext();
855  DirectiveError op_fptrunc();
856  DirectiveError op_fptoui();
857  DirectiveError op_fptosi();
858  DirectiveError op_sitofp();
859  DirectiveError op_uitofp();
860  DirectiveError op_add();
861  DirectiveError op_sub();
862  DirectiveError op_mul();
863  DirectiveError op_udiv();
864  DirectiveError op_sdiv();
865  DirectiveError op_umod();
866  DirectiveError op_smod();
867  DirectiveError op_fadd();
868  DirectiveError op_fsub();
869  DirectiveError op_fmul();
870  DirectiveError op_fdiv();
871  DirectiveError op_float_floor_div();
872  DirectiveError op_fpow();
873  DirectiveError op_flog();
874  DirectiveError op_fmod();
875  DirectiveError op_siext_8_64();
876  DirectiveError op_siext_16_64();
877  DirectiveError op_siext_32_64();
878  DirectiveError op_ziext_8_64();
879  DirectiveError op_ziext_16_64();
880  DirectiveError op_ziext_32_64();
881  DirectiveError op_itrunc_64_8();
882  DirectiveError op_itrunc_64_16();
883  DirectiveError op_itrunc_64_32();
884 
885  Signal exit_directiveHandler(const FpySequencer_ExitDirective& directive, DirectiveError& error);
886  Signal allocate_directiveHandler(const FpySequencer_AllocateDirective& directive, DirectiveError& error);
888  Signal storeHelper(Fpy::StackSizeType destOffset, Fpy::StackSizeType size, DirectiveError& error);
890  Signal loadHelper(Fpy::StackSizeType srcOffset, Fpy::StackSizeType size, DirectiveError& error);
891  Signal storeRelConstOffset_directiveHandler(const FpySequencer_StoreRelConstOffsetDirective& directive,
892  DirectiveError& error);
893  Signal loadRel_directiveHandler(const FpySequencer_LoadRelDirective& directive, DirectiveError& error);
894  Signal pushVal_directiveHandler(const FpySequencer_PushValDirective& directive, DirectiveError& error);
895  Signal discard_directiveHandler(const FpySequencer_DiscardDirective& directive, DirectiveError& error);
896  Signal memCmp_directiveHandler(const FpySequencer_MemCmpDirective& directive, DirectiveError& error);
897  Signal stackCmd_directiveHandler(const FpySequencer_StackCmdDirective& directive, DirectiveError& error);
898  Signal pushTime_directiveHandler(const FpySequencer_PushTimeDirective& directive, DirectiveError& error);
899  Signal getField_directiveHandler(const FpySequencer_GetFieldDirective& directive, DirectiveError& error);
900  Signal peek_directiveHandler(const FpySequencer_PeekDirective& directive, DirectiveError& error);
901  Signal storeRel_directiveHandler(const FpySequencer_StoreRelDirective& directive, DirectiveError& error);
902  Signal call_directiveHandler(const FpySequencer_CallDirective& directive, DirectiveError& error);
903  Signal return_directiveHandler(const FpySequencer_ReturnDirective& directive, DirectiveError& error);
904  Signal loadAbs_directiveHandler(const FpySequencer_LoadAbsDirective& directive, DirectiveError& error);
905  Signal storeAbs_directiveHandler(const FpySequencer_StoreAbsDirective& directive, DirectiveError& error);
906  Signal storeAbsConstOffset_directiveHandler(const FpySequencer_StoreAbsConstOffsetDirective& directive,
907  DirectiveError& error);
908  Signal popEvent_directiveHandler(const FpySequencer_PopEventDirective& directive, DirectiveError& error);
909 };
910 
911 } // namespace Svc
912 
913 #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.
Sequencer blocking state.
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.
void seqCancelIn_handler(FwIndexType portNum) override
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