8 void FpySequencer::sendSignal(
Signal signal) {
27 FW_ASSERT(0, static_cast<FwAssertArgType>(signal));
33 void FpySequencer::handleDirectiveErrorCode(Fpy::DirectiveId
id,
DirectiveError err) {
34 this->m_tlm.lastDirectiveError = err;
36 this->m_tlm.directiveErrorIndex = this->currentStatementIdx();
37 this->m_tlm.directiveErrorId = id;
44 cmdBuf.
serializeFrom(static_cast<FwPacketDescriptorType>(Fw::ComPacketType::FW_PACKET_COMMAND));
67 static_cast<U32
>(((this->m_sequencesStarted & 0xFFFF) << 16) | (this->m_statementsDispatched & 0xFFFF));
77 this->sendSignal(this->waitRel_directiveHandler(directive, error));
84 this->sendSignal(this->waitAbs_directiveHandler(directive, error));
91 this->sendSignal(this->goto_directiveHandler(directive, error));
98 this->sendSignal(this->if_directiveHandler(directive, error));
105 this->sendSignal(this->noOp_directiveHandler(directive, error));
113 this->sendSignal(this->pushTlmVal_directiveHandler(directive, error));
121 this->sendSignal(this->pushTlmValAndTime_directiveHandler(directive, error));
128 this->sendSignal(this->pushPrm_directiveHandler(directive, error));
135 this->sendSignal(this->constCmd_directiveHandler(directive, error));
142 this->sendSignal(this->stackOp_directiveHandler(directive, error));
143 handleDirectiveErrorCode(directive.
get__op(), error);
149 this->sendSignal(this->exit_directiveHandler(directive, error));
156 this->sendSignal(this->allocate_directiveHandler(directive, error));
164 this->sendSignal(this->storeConstOffset_directiveHandler(directive, error));
171 this->sendSignal(this->pushVal_directiveHandler(directive, error));
178 this->sendSignal(this->load_directiveHandler(directive, error));
185 this->sendSignal(this->discard_directiveHandler(directive, error));
192 this->sendSignal(this->memCmp_directiveHandler(directive, error));
199 this->sendSignal(this->stackCmd_directiveHandler(directive, error));
206 this->sendSignal(this->pushTime_directiveHandler(directive, error));
213 this->sendSignal(this->setFlag_directiveHandler(directive, error));
220 this->sendSignal(this->getFlag_directiveHandler(directive, error));
227 this->sendSignal(this->getField_directiveHandler(directive, error));
234 this->sendSignal(this->peek_directiveHandler(directive, error));
241 this->sendSignal(this->store_directiveHandler(directive, error));
247 if (this->m_runtime.stack.size < 8) {
254 U32 uSeconds = this->m_runtime.stack.pop<U32>();
255 U32 seconds = this->m_runtime.stack.pop<U32>();
257 wakeupTime.
add(seconds, uSeconds);
258 this->m_runtime.wakeupTime = wakeupTime;
263 Signal FpySequencer::waitAbs_directiveHandler(
const FpySequencer_WaitAbsDirective& directive,
DirectiveError& error) {
269 U32 uSeconds = this->m_runtime.stack.pop<U32>();
270 U32 seconds = this->m_runtime.stack.pop<U32>();
272 U16 base = this->m_runtime.stack.pop<U16>();
274 this->m_runtime.wakeupTime =
Fw::Time(static_cast<TimeBase::T>(base), ctx, seconds, uSeconds);
279 Signal FpySequencer::goto_directiveHandler(
const FpySequencer_GotoDirective& directive,
DirectiveError& error) {
285 m_runtime.nextStatementIndex = directive.get_statementIndex();
290 Signal FpySequencer::if_directiveHandler(
const FpySequencer_IfDirective& directive,
DirectiveError& error) {
291 if (this->m_runtime.stack.size < 1) {
301 if (this->m_runtime.stack.pop<
U8>() != 0) {
307 this->m_runtime.nextStatementIndex = directive.get_falseGotoStmtIndex();
311 Signal FpySequencer::noOp_directiveHandler(
const FpySequencer_NoOpDirective& directive,
DirectiveError& error) {
315 Signal FpySequencer::pushTlmVal_directiveHandler(
const FpySequencer_PushTlmValDirective& directive,
339 Signal FpySequencer::pushTlmValAndTime_directiveHandler(
const FpySequencer_PushTlmValAndTimeDirective& directive,
372 this->m_runtime.stack.push(timeEsb.getBuffAddr(),
static_cast<Fpy::StackSizeType>(timeEsb.getSize()));
376 Signal FpySequencer::pushPrm_directiveHandler(
const FpySequencer_PushPrmDirective& directive,
DirectiveError& error) {
400 Signal FpySequencer::constCmd_directiveHandler(
const FpySequencer_ConstCmdDirective& directive,
DirectiveError& error) {
401 if (this->sendCmd(directive.get_opCode(), directive.get_argBuf(), directive.get__argBufSize()) ==
412 if (this->m_runtime.stack.size <
sizeof(
U8) * 2) {
415 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() | this->m_runtime.stack.pop<
U8>()));
419 if (this->m_runtime.stack.size <
sizeof(
U8) * 2) {
422 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() & this->m_runtime.stack.pop<
U8>()));
426 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
429 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<I64>() == this->m_runtime.stack.pop<I64>()));
433 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
436 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<I64>() != this->m_runtime.stack.pop<I64>()));
440 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
443 U64 rhs = this->m_runtime.stack.pop<
U64>();
444 U64 lhs = this->m_runtime.stack.pop<
U64>();
445 this->m_runtime.stack.push(static_cast<U8>(lhs < rhs));
449 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
452 U64 rhs = this->m_runtime.stack.pop<
U64>();
453 U64 lhs = this->m_runtime.stack.pop<
U64>();
454 this->m_runtime.stack.push(static_cast<U8>(lhs <= rhs));
458 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
461 U64 rhs = this->m_runtime.stack.pop<
U64>();
462 U64 lhs = this->m_runtime.stack.pop<
U64>();
463 this->m_runtime.stack.push(static_cast<U8>(lhs > rhs));
467 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
470 U64 rhs = this->m_runtime.stack.pop<
U64>();
471 U64 lhs = this->m_runtime.stack.pop<
U64>();
472 this->m_runtime.stack.push(static_cast<U8>(lhs >= rhs));
476 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
479 I64 rhs = this->m_runtime.stack.pop<I64>();
480 I64 lhs = this->m_runtime.stack.pop<I64>();
481 this->m_runtime.stack.push(static_cast<U8>(lhs < rhs));
485 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
488 I64 rhs = this->m_runtime.stack.pop<I64>();
489 I64 lhs = this->m_runtime.stack.pop<I64>();
490 this->m_runtime.stack.push(static_cast<U8>(lhs <= rhs));
494 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
497 I64 rhs = this->m_runtime.stack.pop<I64>();
498 I64 lhs = this->m_runtime.stack.pop<I64>();
499 this->m_runtime.stack.push(static_cast<U8>(lhs > rhs));
503 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
506 I64 rhs = this->m_runtime.stack.pop<I64>();
507 I64 lhs = this->m_runtime.stack.pop<I64>();
508 this->m_runtime.stack.push(static_cast<U8>(lhs >= rhs));
512 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
515 F64 rhs = this->m_runtime.stack.pop<
F64>();
516 F64 lhs = this->m_runtime.stack.pop<
F64>();
518 this->m_runtime.stack.push(static_cast<U8>((lhs == rhs) ? 1 : 0));
522 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
525 F64 rhs = this->m_runtime.stack.pop<
F64>();
526 F64 lhs = this->m_runtime.stack.pop<
F64>();
528 this->m_runtime.stack.push(static_cast<U8>((lhs != rhs) ? 1 : 0));
532 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
535 F64 rhs = this->m_runtime.stack.pop<
F64>();
536 F64 lhs = this->m_runtime.stack.pop<
F64>();
537 this->m_runtime.stack.push(static_cast<U8>(std::isless(lhs, rhs)));
541 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
544 F64 rhs = this->m_runtime.stack.pop<
F64>();
545 F64 lhs = this->m_runtime.stack.pop<
F64>();
546 this->m_runtime.stack.push(static_cast<U8>(std::islessequal(lhs, rhs)));
550 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
553 F64 rhs = this->m_runtime.stack.pop<
F64>();
554 F64 lhs = this->m_runtime.stack.pop<
F64>();
555 this->m_runtime.stack.push(static_cast<U8>(std::isgreater(lhs, rhs)));
559 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
562 F64 rhs = this->m_runtime.stack.pop<
F64>();
563 F64 lhs = this->m_runtime.stack.pop<
F64>();
564 this->m_runtime.stack.push(static_cast<U8>(std::isgreaterequal(lhs, rhs)));
568 if (this->m_runtime.stack.size <
sizeof(
U8)) {
571 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() == 0));
576 if (this->m_runtime.stack.size <
sizeof(
F32)) {
579 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<
F32>()));
584 if (this->m_runtime.stack.size <
sizeof(
F64)) {
587 this->m_runtime.stack.push(static_cast<F32>(this->m_runtime.stack.pop<
F64>()));
591 if (this->m_runtime.stack.size <
sizeof(
F64)) {
594 this->m_runtime.stack.push(static_cast<I64>(this->m_runtime.stack.pop<
F64>()));
598 if (this->m_runtime.stack.size <
sizeof(I64)) {
601 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<I64>()));
605 if (this->m_runtime.stack.size <
sizeof(
F64)) {
608 this->m_runtime.stack.push(static_cast<U64>(this->m_runtime.stack.pop<
F64>()));
612 if (this->m_runtime.stack.size <
sizeof(
U64)) {
615 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<
U64>()));
619 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
622 I64 rhs = this->m_runtime.stack.pop<I64>();
623 I64 lhs = this->m_runtime.stack.pop<I64>();
627 if ((rhs > 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() - rhs) < lhs)) {
635 this->m_runtime.stack.push(static_cast<I64>(lhs + rhs));
639 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
642 I64 rhs = this->m_runtime.stack.pop<I64>();
643 I64 lhs = this->m_runtime.stack.pop<I64>();
648 if ((rhs < 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() + rhs) < lhs)) {
657 this->m_runtime.stack.push(static_cast<I64>(lhs - rhs));
661 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
664 I64 rhs = this->m_runtime.stack.pop<I64>();
665 I64 lhs = this->m_runtime.stack.pop<I64>();
670 if ((rhs > 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() / rhs) < lhs)) {
674 else if ((rhs < 0) && (lhs < 0) && ((std::numeric_limits<I64>::max() / (-1 * rhs)) < (-1 * lhs))) {
687 this->m_runtime.stack.push(static_cast<I64>(lhs * rhs));
691 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
694 U64 rhs = this->m_runtime.stack.pop<
U64>();
695 U64 lhs = this->m_runtime.stack.pop<
U64>();
700 this->m_runtime.stack.push(static_cast<U64>(lhs / rhs));
704 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
708 I64 rhs = this->m_runtime.stack.pop<I64>();
709 I64 lhs = this->m_runtime.stack.pop<I64>();
714 this->m_runtime.stack.push(static_cast<I64>(lhs / rhs));
718 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
721 U64 rhs = this->m_runtime.stack.pop<
U64>();
725 U64 lhs = this->m_runtime.stack.pop<
U64>();
726 this->m_runtime.stack.push(static_cast<U64>(lhs % rhs));
730 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
733 I64 rhs = this->m_runtime.stack.pop<I64>();
737 I64 lhs = this->m_runtime.stack.pop<I64>();
738 I64 res =
static_cast<I64
>(lhs % rhs);
743 if ((res > 0 && rhs < 0) || (res < 0 && rhs > 0)) {
746 this->m_runtime.stack.push(res);
750 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
753 F64 rhs = this->m_runtime.stack.pop<
F64>();
754 F64 lhs = this->m_runtime.stack.pop<
F64>();
755 this->m_runtime.stack.push(static_cast<F64>(lhs + rhs));
759 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
762 F64 rhs = this->m_runtime.stack.pop<
F64>();
763 F64 lhs = this->m_runtime.stack.pop<
F64>();
764 this->m_runtime.stack.push(static_cast<F64>(lhs - rhs));
768 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
771 F64 rhs = this->m_runtime.stack.pop<
F64>();
772 F64 lhs = this->m_runtime.stack.pop<
F64>();
773 this->m_runtime.stack.push(static_cast<F64>(lhs * rhs));
777 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
780 F64 rhs = this->m_runtime.stack.pop<
F64>();
781 F64 lhs = this->m_runtime.stack.pop<
F64>();
782 this->m_runtime.stack.push(static_cast<F64>(lhs / rhs));
786 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
789 F64 rhs = this->m_runtime.stack.pop<
F64>();
790 F64 lhs = this->m_runtime.stack.pop<
F64>();
791 this->m_runtime.stack.push(static_cast<F64>(pow(lhs, rhs)));
795 if (this->m_runtime.stack.size <
sizeof(
F64)) {
798 F64 val = this->m_runtime.stack.pop<
F64>();
802 this->m_runtime.stack.push(static_cast<F64>(log(val)));
806 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
809 F64 rhs = this->m_runtime.stack.pop<
F64>();
813 F64 lhs = this->m_runtime.stack.pop<
F64>();
814 this->m_runtime.stack.push(static_cast<F64>(lhs - rhs * std::floor(lhs / rhs)));
818 if (this->m_runtime.stack.size <
sizeof(
I8)) {
821 I8 src = this->m_runtime.stack.pop<
I8>();
822 this->m_runtime.stack.push(static_cast<I64>(src));
826 if (this->m_runtime.stack.size <
sizeof(I16)) {
829 I16 src = this->m_runtime.stack.pop<I16>();
830 this->m_runtime.stack.push(static_cast<I64>(src));
834 if (this->m_runtime.stack.size <
sizeof(I32)) {
837 I32 src = this->m_runtime.stack.pop<I32>();
838 this->m_runtime.stack.push(static_cast<I64>(src));
842 if (this->m_runtime.stack.size <
sizeof(
U8)) {
845 U8 src = this->m_runtime.stack.pop<
U8>();
846 this->m_runtime.stack.push(static_cast<U64>(src));
850 if (this->m_runtime.stack.size <
sizeof(U16)) {
853 U16 src = this->m_runtime.stack.pop<U16>();
854 this->m_runtime.stack.push(static_cast<U64>(src));
858 if (this->m_runtime.stack.size <
sizeof(U32)) {
861 U32 src = this->m_runtime.stack.pop<U32>();
862 this->m_runtime.stack.push(static_cast<U64>(src));
866 if (this->m_runtime.stack.size <
sizeof(
U64)) {
869 U64 src = this->m_runtime.stack.pop<
U64>();
870 this->m_runtime.stack.push(static_cast<U8>(src));
874 if (this->m_runtime.stack.size <
sizeof(
U64)) {
877 U64 src = this->m_runtime.stack.pop<
U64>();
878 this->m_runtime.stack.push(static_cast<U16>(src));
882 if (this->m_runtime.stack.size <
sizeof(
U64)) {
885 U64 src = this->m_runtime.stack.pop<
U64>();
886 this->m_runtime.stack.push(static_cast<U32>(src));
889 Signal FpySequencer::stackOp_directiveHandler(
const FpySequencer_StackOpDirective& directive,
DirectiveError& error) {
894 switch (directive.get__op()) {
896 error = this->op_or();
899 error = this->op_and();
902 error = this->op_ieq();
905 error = this->op_ine();
908 error = this->op_ult();
911 error = this->op_ule();
914 error = this->op_ugt();
917 error = this->op_uge();
920 error = this->op_slt();
923 error = this->op_sle();
926 error = this->op_sgt();
929 error = this->op_sge();
932 error = this->op_feq();
935 error = this->op_fne();
938 error = this->op_flt();
941 error = this->op_fle();
944 error = this->op_fgt();
947 error = this->op_fge();
950 error = this->op_not();
953 error = this->op_fpext();
956 error = this->op_fptrunc();
959 error = this->op_fptosi();
962 error = this->op_fptoui();
965 error = this->op_sitofp();
968 error = this->op_uitofp();
971 error = this->op_add();
974 error = this->op_sub();
977 error = this->op_mul();
980 error = this->op_udiv();
983 error = this->op_sdiv();
986 error = this->op_umod();
989 error = this->op_smod();
992 error = this->op_fadd();
995 error = this->op_fsub();
998 error = this->op_fmul();
1001 error = this->op_fdiv();
1004 error = this->op_fpow();
1007 error = this->op_flog();
1010 error = this->op_fmod();
1013 error = this->op_siext_8_64();
1016 error = this->op_siext_16_64();
1019 error = this->op_siext_32_64();
1022 error = this->op_ziext_8_64();
1025 error = this->op_ziext_16_64();
1028 error = this->op_ziext_32_64();
1031 error = this->op_itrunc_64_8();
1034 error = this->op_itrunc_64_16();
1037 error = this->op_itrunc_64_32();
1049 Signal FpySequencer::exit_directiveHandler(
const FpySequencer_ExitDirective& directive,
DirectiveError& error) {
1050 if (this->m_runtime.stack.size < 1) {
1054 U8 errorCode = this->m_runtime.stack.pop<
U8>();
1056 if (errorCode == 0) {
1068 Signal FpySequencer::allocate_directiveHandler(
const FpySequencer_AllocateDirective& directive,
DirectiveError& error) {
1073 this->m_runtime.stack.pushZeroes(directive.get_size());
1077 Signal FpySequencer::storeConstOffset_directiveHandler(
const FpySequencer_StoreConstOffsetDirective& directive,
1079 if (this->m_runtime.stack.size < directive.get_size()) {
1084 Fpy::StackSizeType stackOffset = this->m_runtime.stack.lvarOffset() + directive.get_lvarOffset();
1086 if (stackOffset + directive.get_size() > this->m_runtime.stack.size - directive.get_size()) {
1092 memcpy(this->m_runtime.stack.bytes + stackOffset, this->m_runtime.stack.top() - directive.get_size(),
1093 directive.get_size());
1094 this->m_runtime.stack.size -= directive.get_size();
1098 Signal FpySequencer::load_directiveHandler(
const FpySequencer_LoadDirective& directive,
DirectiveError& error) {
1104 Fpy::StackSizeType stackOffset = this->m_runtime.stack.lvarOffset() + directive.get_lvarOffset();
1106 if (stackOffset + directive.get_size() > this->m_runtime.stack.size) {
1111 memcpy(this->m_runtime.stack.top(), this->m_runtime.stack.bytes + stackOffset, directive.get_size());
1112 this->m_runtime.stack.size += directive.get_size();
1116 Signal FpySequencer::pushVal_directiveHandler(
const FpySequencer_PushValDirective& directive,
DirectiveError& error) {
1122 memcpy(this->m_runtime.stack.top(), directive.get_val(), directive.get__valSize());
1123 this->m_runtime.stack.size +=
static_cast<Fpy::StackSizeType>(directive.get__valSize());
1127 Signal FpySequencer::discard_directiveHandler(
const FpySequencer_DiscardDirective& directive,
DirectiveError& error) {
1128 if (this->m_runtime.stack.size < directive.get_size()) {
1133 this->m_runtime.stack.size -= directive.get_size();
1137 Signal FpySequencer::memCmp_directiveHandler(
const FpySequencer_MemCmpDirective& directive,
DirectiveError& error) {
1139 if (this->m_runtime.stack.size < directive.get_size() * 2) {
1145 U64 lhsOffset = this->m_runtime.stack.size - directive.get_size() * 2;
1146 U64 rhsOffset = this->m_runtime.stack.size - directive.get_size();
1151 this->m_runtime.stack.size -= directive.get_size() * 2;
1154 if (memcmp(this->m_runtime.stack.bytes + lhsOffset, this->m_runtime.stack.bytes + rhsOffset,
1155 directive.get_size()) == 0) {
1156 this->m_runtime.stack.push<
U8>(1);
1158 this->m_runtime.stack.push<
U8>(0);
1163 Signal FpySequencer::stackCmd_directiveHandler(
const FpySequencer_StackCmdDirective& directive,
DirectiveError& error) {
1164 if (this->m_runtime.stack.size < static_cast<U64>(directive.get_argsSize() +
sizeof(
FwOpcodeType))) {
1173 U64 argBufOffset = this->m_runtime.stack.size - directive.get_argsSize();
1176 this->m_runtime.currentCmdOpcode = opcode;
1179 this->m_runtime.stack.size -= directive.get_argsSize();
1181 if (this->sendCmd(opcode, this->m_runtime.stack.bytes + argBufOffset, directive.get_argsSize()) ==
1193 Signal FpySequencer::pushTime_directiveHandler(
const FpySequencer_PushTimeDirective& directive,
DirectiveError& error) {
1209 memcpy(this->m_runtime.stack.bytes + this->m_runtime.stack.size, timeEsb.getBuffAddr(), timeEsb.getSize());
1214 Signal FpySequencer::setFlag_directiveHandler(
const FpySequencer_SetFlagDirective& directive,
DirectiveError& error) {
1215 if (this->m_runtime.stack.size < 1) {
1225 U8 flagVal = this->m_runtime.stack.pop<
U8>() != 0;
1227 this->m_runtime.flags[directive.get_flagIdx()] = flagVal == 1;
1231 Signal FpySequencer::getFlag_directiveHandler(
const FpySequencer_GetFlagDirective& directive,
DirectiveError& error) {
1241 bool flagVal = this->m_runtime.flags[directive.get_flagIdx()];
1242 this->m_runtime.stack.push<
U8>(flagVal);
1246 Signal FpySequencer::getField_directiveHandler(
const FpySequencer_GetFieldDirective& directive,
DirectiveError& error) {
1248 this->m_runtime.stack.size < directive.get_parentSize()) {
1255 if (offset + directive.get_memberSize() > directive.get_parentSize()) {
1266 U8* parentStartPtr = this->m_runtime.stack.top() - directive.get_parentSize();
1268 memmove(parentStartPtr, parentStartPtr + offset, directive.get_memberSize());
1270 this->m_runtime.stack.size -= (directive.get_parentSize() - directive.get_memberSize());
1274 Signal FpySequencer::peek_directiveHandler(
const FpySequencer_PeekDirective& directive,
DirectiveError& error) {
1282 if (offset > this->m_runtime.stack.size) {
1294 if (this->m_runtime.stack.size < byteCount + offset) {
1300 U8* src = this->m_runtime.stack.top() - offset - byteCount;
1301 this->m_runtime.stack.push(src, byteCount);
1305 Signal FpySequencer::store_directiveHandler(
const FpySequencer_StoreDirective& directive,
DirectiveError& error) {
1306 if (this->m_runtime.stack.size < directive.get_size() +
sizeof(
Fpy::StackSizeType)) {
1312 this->m_runtime.stack.lvarOffset() + this->m_runtime.stack.pop<
Fpy::StackSizeType>();
1314 if (stackOffset + directive.get_size() > this->m_runtime.stack.size - directive.get_size()) {
1320 memcpy(this->m_runtime.stack.bytes + stackOffset, this->m_runtime.stack.top() - directive.get_size(),
1321 directive.get_size());
1322 this->m_runtime.stack.size -= directive.get_size();
Serialization/Deserialization operation was successful.
sets the index of the next directive to execute
U8 * getBuffAddr()
Get buffer address for data filling (non-const version)
FwIdType FwOpcodeType
The type of a command opcode.
void directive_load_internalInterfaceHandler(const Svc::FpySequencer_LoadDirective &directive) override
Internal interface handler for directive_load.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
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.
PlatformSizeType FwSizeType
void directive_stackOp_internalInterfaceHandler(const Svc::FpySequencer_StackOpDirective &directive) override
Internal interface handler for directive_stackOp.
called when statement successfully executed. only raised in the RUNNING.AWAITING_CMD_RESPONSE state ...
void directive_getField_internalInterfaceHandler(const Svc::FpySequencer_GetFieldDirective &directive) override
Internal interface handler for directive_getField.
Fw::TlmValid getTlmChan_out(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke output port getTlmChan.
Serializable::SizeType getSize() const override
Get current buffer size.
void log_WARNING_HI_SequenceExitedWithError(const Fw::StringBase &filePath, U8 errorCode) const
Log event SequenceExitedWithError.
void directive_pushTlmValAndTime_internalInterfaceHandler(const Svc::FpySequencer_PushTlmValAndTimeDirective &directive) override
Internal interface handler for directive_pushTlmValAndTime.
int8_t I8
8-bit signed integer
void directive_constCmd_internalInterfaceHandler(const Svc::FpySequencer_ConstCmdDirective &directive) override
Internal interface handler for directive_constCmd.
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.
void sequencer_sendSignal_stmtResponse_success()
Send signal stmtResponse_success to state machine sequencer.
void directive_storeConstOffset_internalInterfaceHandler(const Svc::FpySequencer_StoreConstOffsetDirective &directive) override
Internal interface handler for directive_storeConstOffset.
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.
void directive_pushPrm_internalInterfaceHandler(const Svc::FpySequencer_PushPrmDirective &directive) override
Internal interface handler for directive_pushPrm.
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.
U8 FwTimeContextStoreType
The type used to serialize a time context value.
pops some bytes off the stack and puts them in lvar array
SerializeStatus
forward declaration for string
float F32
32-bit floating point
Fpy::DirectiveErrorCode DirectiveError
void directive_allocate_internalInterfaceHandler(const Svc::FpySequencer_AllocateDirective &directive) override
Internal interface handler for directive_allocate.
executes a cmd with const args
void directive_waitRel_internalInterfaceHandler(const FpySequencer_WaitRelDirective &directive) override
Internal interface handler for directive_waitRel.
void directive_noOp_internalInterfaceHandler(const Svc::FpySequencer_NoOpDirective &directive) override
Internal interface handler for directive_noOp.
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.
pop two byte arrays off the top of the stack, call memcmp, push 1 if they were equal, 0 otherwise
Svc::Fpy::Header & get_header()
Get member header.
Omit length from serialization.
void directive_store_internalInterfaceHandler(const Svc::FpySequencer_StoreDirective &directive) override
Internal interface handler for directive_store.
void directive_exit_internalInterfaceHandler(const Svc::FpySequencer_ExitDirective &directive) override
Internal interface handler for directive_exit.
External serialize buffer with no copy semantics.
Svc::Fpy::DirectiveId::T get__op() const
Get member _op.
void directive_waitAbs_internalInterfaceHandler(const FpySequencer_WaitAbsDirective &directive) override
Internal interface handler for directive_waitAbs.
U8 * getBuffAddr()
Get buffer address for data filling (non-const version)
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 ...
void sequencer_sendSignal_stmtResponse_failure()
Send signal stmtResponse_failure to state machine sequencer.
void sequencer_sendSignal_stmtResponse_beginSleep()
Send signal stmtResponse_beginSleep to state machine sequencer.
stores bytes from the top of the stack into a memory location, determined by the stack ...
void directive_getFlag_internalInterfaceHandler(const Svc::FpySequencer_GetFlagDirective &directive) override
Internal interface handler for directive_getFlag.
sleeps for a relative duration from the current time
uint8_t U8
8-bit unsigned integer
gets bytes from lvar array and pushes them to stack
generic stack operation handler
static U32 min(const U32 a, const U32 b)
static Time add(const Time &a, const Time &b)
void sequencer_sendSignal_stmtResponse_keepWaiting()
Send signal stmtResponse_keepWaiting to state machine sequencer.
sleeps until an absolute time
called when the statement unsuccessfully executed. only raised in the RUNNING.AWAITING_CMD_RESPONSE s...
double F64
64-bit floating point (double). Required for compiler-supplied double promotion.
bool isConnected_prmGet_OutputPort(FwIndexType portNum)
void cmdOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port cmdOut.
pushes a const byte array onto stack
RateGroupDivider component implementation.
Enum representing parameter validity.
pushes a prm buf to the stack
void directive_setFlag_internalInterfaceHandler(const Svc::FpySequencer_SetFlagDirective &directive) override
Internal interface handler for directive_setFlag.
Fw::ParamValid getParam_out(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer &val)
Invoke output port getParam.
pushes the current Fw.Time struct to the stack
pushes some empty bytes to the stack
pops a bool off the stack, sets a flag with a specific index to that bool
bool isConnected_getTlmChan_OutputPort(FwIndexType portNum)
called when the statement is telling the sequencer to await a later stmt response ...
gets a flag and pushes its value as a U8 to the stack
FpySequencer_SequencerStateMachineStateMachineBase::Signal Signal
a statement is telling the sequencer to go to sleep
pushes a tlm buf to the stack
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
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.