9 void FpySequencer::sendSignal(
Signal signal) {
28 FW_ASSERT(0, static_cast<FwAssertArgType>(signal));
34 void FpySequencer::handleDirectiveErrorCode(Fpy::DirectiveId
id,
DirectiveError err) {
35 this->m_tlm.lastDirectiveError = err;
37 this->m_tlm.directiveErrorIndex = this->currentStatementIdx();
38 this->m_tlm.directiveErrorId = id;
45 cmdBuf.
serializeFrom(static_cast<FwPacketDescriptorType>(Fw::ComPacketType::FW_PACKET_COMMAND));
68 static_cast<U32
>(((this->m_sequencesStarted & 0xFFFF) << 16) | (this->m_statementsDispatched & 0xFFFF));
78 this->sendSignal(this->waitRel_directiveHandler(directive, error));
85 this->sendSignal(this->waitAbs_directiveHandler(directive, error));
92 this->sendSignal(this->goto_directiveHandler(directive, error));
99 this->sendSignal(this->if_directiveHandler(directive, error));
106 this->sendSignal(this->noOp_directiveHandler(directive, error));
114 this->sendSignal(this->pushTlmVal_directiveHandler(directive, error));
122 this->sendSignal(this->pushTlmValAndTime_directiveHandler(directive, error));
129 this->sendSignal(this->pushPrm_directiveHandler(directive, error));
136 this->sendSignal(this->constCmd_directiveHandler(directive, error));
143 this->sendSignal(this->stackOp_directiveHandler(directive, error));
144 handleDirectiveErrorCode(directive.
get__op(), error);
150 this->sendSignal(this->exit_directiveHandler(directive, error));
157 this->sendSignal(this->allocate_directiveHandler(directive, error));
165 this->sendSignal(this->storeConstOffset_directiveHandler(directive, error));
172 this->sendSignal(this->pushVal_directiveHandler(directive, error));
179 this->sendSignal(this->load_directiveHandler(directive, error));
186 this->sendSignal(this->discard_directiveHandler(directive, error));
193 this->sendSignal(this->memCmp_directiveHandler(directive, error));
200 this->sendSignal(this->stackCmd_directiveHandler(directive, error));
207 this->sendSignal(this->pushTime_directiveHandler(directive, error));
214 this->sendSignal(this->setFlag_directiveHandler(directive, error));
221 this->sendSignal(this->getFlag_directiveHandler(directive, error));
228 this->sendSignal(this->getField_directiveHandler(directive, error));
235 this->sendSignal(this->peek_directiveHandler(directive, error));
242 this->sendSignal(this->store_directiveHandler(directive, error));
248 if (this->m_runtime.stack.size < 8) {
255 U32 uSeconds = this->m_runtime.stack.pop<U32>();
256 U32 seconds = this->m_runtime.stack.pop<U32>();
258 wakeupTime.
add(seconds, uSeconds);
259 this->m_runtime.wakeupTime = wakeupTime;
264 Signal FpySequencer::waitAbs_directiveHandler(
const FpySequencer_WaitAbsDirective& directive,
DirectiveError& error) {
270 U32 uSeconds = this->m_runtime.stack.pop<U32>();
271 U32 seconds = this->m_runtime.stack.pop<U32>();
273 U16 base = this->m_runtime.stack.pop<U16>();
275 this->m_runtime.wakeupTime =
Fw::Time(static_cast<TimeBase::T>(base), ctx, seconds, uSeconds);
280 Signal FpySequencer::goto_directiveHandler(
const FpySequencer_GotoDirective& directive,
DirectiveError& error) {
286 m_runtime.nextStatementIndex = directive.get_statementIndex();
291 Signal FpySequencer::if_directiveHandler(
const FpySequencer_IfDirective& directive,
DirectiveError& error) {
292 if (this->m_runtime.stack.size < 1) {
302 if (this->m_runtime.stack.pop<
U8>() != 0) {
308 this->m_runtime.nextStatementIndex = directive.get_falseGotoStmtIndex();
312 Signal FpySequencer::noOp_directiveHandler(
const FpySequencer_NoOpDirective& directive,
DirectiveError& error) {
316 Signal FpySequencer::pushTlmVal_directiveHandler(
const FpySequencer_PushTlmValDirective& directive,
340 Signal FpySequencer::pushTlmValAndTime_directiveHandler(
const FpySequencer_PushTlmValAndTimeDirective& directive,
373 this->m_runtime.stack.push(timeEsb.getBuffAddr(),
static_cast<Fpy::StackSizeType>(timeEsb.getSize()));
377 Signal FpySequencer::pushPrm_directiveHandler(
const FpySequencer_PushPrmDirective& directive,
DirectiveError& error) {
401 Signal FpySequencer::constCmd_directiveHandler(
const FpySequencer_ConstCmdDirective& directive,
DirectiveError& error) {
402 if (this->sendCmd(directive.get_opCode(), directive.get_argBuf(), directive.get__argBufSize()) ==
413 if (this->m_runtime.stack.size <
sizeof(
U8) * 2) {
416 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() | this->m_runtime.stack.pop<
U8>()));
420 if (this->m_runtime.stack.size <
sizeof(
U8) * 2) {
423 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() & this->m_runtime.stack.pop<
U8>()));
427 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
430 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<I64>() == this->m_runtime.stack.pop<I64>()));
434 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
437 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<I64>() != this->m_runtime.stack.pop<I64>()));
441 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
444 U64 rhs = this->m_runtime.stack.pop<
U64>();
445 U64 lhs = this->m_runtime.stack.pop<
U64>();
446 this->m_runtime.stack.push(static_cast<U8>(lhs < rhs));
450 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
453 U64 rhs = this->m_runtime.stack.pop<
U64>();
454 U64 lhs = this->m_runtime.stack.pop<
U64>();
455 this->m_runtime.stack.push(static_cast<U8>(lhs <= rhs));
459 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
462 U64 rhs = this->m_runtime.stack.pop<
U64>();
463 U64 lhs = this->m_runtime.stack.pop<
U64>();
464 this->m_runtime.stack.push(static_cast<U8>(lhs > rhs));
468 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
471 U64 rhs = this->m_runtime.stack.pop<
U64>();
472 U64 lhs = this->m_runtime.stack.pop<
U64>();
473 this->m_runtime.stack.push(static_cast<U8>(lhs >= rhs));
477 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
480 I64 rhs = this->m_runtime.stack.pop<I64>();
481 I64 lhs = this->m_runtime.stack.pop<I64>();
482 this->m_runtime.stack.push(static_cast<U8>(lhs < rhs));
486 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
489 I64 rhs = this->m_runtime.stack.pop<I64>();
490 I64 lhs = this->m_runtime.stack.pop<I64>();
491 this->m_runtime.stack.push(static_cast<U8>(lhs <= rhs));
495 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
498 I64 rhs = this->m_runtime.stack.pop<I64>();
499 I64 lhs = this->m_runtime.stack.pop<I64>();
500 this->m_runtime.stack.push(static_cast<U8>(lhs > rhs));
504 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
507 I64 rhs = this->m_runtime.stack.pop<I64>();
508 I64 lhs = this->m_runtime.stack.pop<I64>();
509 this->m_runtime.stack.push(static_cast<U8>(lhs >= rhs));
513 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
516 F64 rhs = this->m_runtime.stack.pop<
F64>();
517 F64 lhs = this->m_runtime.stack.pop<
F64>();
519 this->m_runtime.stack.push(static_cast<U8>((lhs == rhs) ? 1 : 0));
523 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
526 F64 rhs = this->m_runtime.stack.pop<
F64>();
527 F64 lhs = this->m_runtime.stack.pop<
F64>();
529 this->m_runtime.stack.push(static_cast<U8>((lhs != rhs) ? 1 : 0));
533 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
536 F64 rhs = this->m_runtime.stack.pop<
F64>();
537 F64 lhs = this->m_runtime.stack.pop<
F64>();
538 this->m_runtime.stack.push(static_cast<U8>(std::isless(lhs, rhs)));
542 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
545 F64 rhs = this->m_runtime.stack.pop<
F64>();
546 F64 lhs = this->m_runtime.stack.pop<
F64>();
547 this->m_runtime.stack.push(static_cast<U8>(std::islessequal(lhs, rhs)));
551 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
554 F64 rhs = this->m_runtime.stack.pop<
F64>();
555 F64 lhs = this->m_runtime.stack.pop<
F64>();
556 this->m_runtime.stack.push(static_cast<U8>(std::isgreater(lhs, rhs)));
560 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
563 F64 rhs = this->m_runtime.stack.pop<
F64>();
564 F64 lhs = this->m_runtime.stack.pop<
F64>();
565 this->m_runtime.stack.push(static_cast<U8>(std::isgreaterequal(lhs, rhs)));
569 if (this->m_runtime.stack.size <
sizeof(
U8)) {
572 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() == 0));
577 if (this->m_runtime.stack.size <
sizeof(
F32)) {
580 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<
F32>()));
585 if (this->m_runtime.stack.size <
sizeof(
F64)) {
588 this->m_runtime.stack.push(static_cast<F32>(this->m_runtime.stack.pop<
F64>()));
592 if (this->m_runtime.stack.size <
sizeof(
F64)) {
595 this->m_runtime.stack.push(static_cast<I64>(this->m_runtime.stack.pop<
F64>()));
599 if (this->m_runtime.stack.size <
sizeof(I64)) {
602 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<I64>()));
606 if (this->m_runtime.stack.size <
sizeof(
F64)) {
609 this->m_runtime.stack.push(static_cast<U64>(this->m_runtime.stack.pop<
F64>()));
613 if (this->m_runtime.stack.size <
sizeof(
U64)) {
616 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<
U64>()));
620 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
623 I64 rhs = this->m_runtime.stack.pop<I64>();
624 I64 lhs = this->m_runtime.stack.pop<I64>();
628 if ((rhs > 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() - rhs) < lhs)) {
636 this->m_runtime.stack.push(static_cast<I64>(lhs + rhs));
640 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
643 I64 rhs = this->m_runtime.stack.pop<I64>();
644 I64 lhs = this->m_runtime.stack.pop<I64>();
649 if ((rhs < 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() + rhs) < lhs)) {
658 this->m_runtime.stack.push(static_cast<I64>(lhs - rhs));
662 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
665 I64 rhs = this->m_runtime.stack.pop<I64>();
666 I64 lhs = this->m_runtime.stack.pop<I64>();
671 if ((rhs > 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() / rhs) < lhs)) {
675 else if ((rhs < 0) && (lhs < 0) && ((std::numeric_limits<I64>::max() / (-1 * rhs)) < (-1 * lhs))) {
688 this->m_runtime.stack.push(static_cast<I64>(lhs * rhs));
692 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
695 U64 rhs = this->m_runtime.stack.pop<
U64>();
696 U64 lhs = this->m_runtime.stack.pop<
U64>();
701 this->m_runtime.stack.push(static_cast<U64>(lhs / rhs));
705 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
709 I64 rhs = this->m_runtime.stack.pop<I64>();
710 I64 lhs = this->m_runtime.stack.pop<I64>();
715 this->m_runtime.stack.push(static_cast<I64>(lhs / rhs));
719 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
722 U64 rhs = this->m_runtime.stack.pop<
U64>();
726 U64 lhs = this->m_runtime.stack.pop<
U64>();
727 this->m_runtime.stack.push(static_cast<U64>(lhs % rhs));
731 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
734 I64 rhs = this->m_runtime.stack.pop<I64>();
738 I64 lhs = this->m_runtime.stack.pop<I64>();
739 I64 res =
static_cast<I64
>(lhs % rhs);
744 if ((res > 0 && rhs < 0) || (res < 0 && rhs > 0)) {
747 this->m_runtime.stack.push(res);
751 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
754 F64 rhs = this->m_runtime.stack.pop<
F64>();
755 F64 lhs = this->m_runtime.stack.pop<
F64>();
756 this->m_runtime.stack.push(static_cast<F64>(lhs + rhs));
760 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
763 F64 rhs = this->m_runtime.stack.pop<
F64>();
764 F64 lhs = this->m_runtime.stack.pop<
F64>();
765 this->m_runtime.stack.push(static_cast<F64>(lhs - rhs));
769 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
772 F64 rhs = this->m_runtime.stack.pop<
F64>();
773 F64 lhs = this->m_runtime.stack.pop<
F64>();
774 this->m_runtime.stack.push(static_cast<F64>(lhs * rhs));
778 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
781 F64 rhs = this->m_runtime.stack.pop<
F64>();
782 F64 lhs = this->m_runtime.stack.pop<
F64>();
783 this->m_runtime.stack.push(static_cast<F64>(lhs / rhs));
787 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
790 F64 rhs = this->m_runtime.stack.pop<
F64>();
791 F64 lhs = this->m_runtime.stack.pop<
F64>();
792 this->m_runtime.stack.push(static_cast<F64>(pow(lhs, rhs)));
796 if (this->m_runtime.stack.size <
sizeof(
F64)) {
799 F64 val = this->m_runtime.stack.pop<
F64>();
803 this->m_runtime.stack.push(static_cast<F64>(log(val)));
807 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
810 F64 rhs = this->m_runtime.stack.pop<
F64>();
814 F64 lhs = this->m_runtime.stack.pop<
F64>();
815 this->m_runtime.stack.push(static_cast<F64>(lhs - rhs * std::floor(lhs / rhs)));
819 if (this->m_runtime.stack.size <
sizeof(
I8)) {
822 I8 src = this->m_runtime.stack.pop<
I8>();
823 this->m_runtime.stack.push(static_cast<I64>(src));
827 if (this->m_runtime.stack.size <
sizeof(I16)) {
830 I16 src = this->m_runtime.stack.pop<I16>();
831 this->m_runtime.stack.push(static_cast<I64>(src));
835 if (this->m_runtime.stack.size <
sizeof(I32)) {
838 I32 src = this->m_runtime.stack.pop<I32>();
839 this->m_runtime.stack.push(static_cast<I64>(src));
843 if (this->m_runtime.stack.size <
sizeof(
U8)) {
846 U8 src = this->m_runtime.stack.pop<
U8>();
847 this->m_runtime.stack.push(static_cast<U64>(src));
851 if (this->m_runtime.stack.size <
sizeof(U16)) {
854 U16 src = this->m_runtime.stack.pop<U16>();
855 this->m_runtime.stack.push(static_cast<U64>(src));
859 if (this->m_runtime.stack.size <
sizeof(U32)) {
862 U32 src = this->m_runtime.stack.pop<U32>();
863 this->m_runtime.stack.push(static_cast<U64>(src));
867 if (this->m_runtime.stack.size <
sizeof(
U64)) {
870 U64 src = this->m_runtime.stack.pop<
U64>();
871 this->m_runtime.stack.push(static_cast<U8>(src));
875 if (this->m_runtime.stack.size <
sizeof(
U64)) {
878 U64 src = this->m_runtime.stack.pop<
U64>();
879 this->m_runtime.stack.push(static_cast<U16>(src));
883 if (this->m_runtime.stack.size <
sizeof(
U64)) {
886 U64 src = this->m_runtime.stack.pop<
U64>();
887 this->m_runtime.stack.push(static_cast<U32>(src));
890 Signal FpySequencer::stackOp_directiveHandler(
const FpySequencer_StackOpDirective& directive,
DirectiveError& error) {
895 switch (directive.get__op()) {
897 error = this->op_or();
900 error = this->op_and();
903 error = this->op_ieq();
906 error = this->op_ine();
909 error = this->op_ult();
912 error = this->op_ule();
915 error = this->op_ugt();
918 error = this->op_uge();
921 error = this->op_slt();
924 error = this->op_sle();
927 error = this->op_sgt();
930 error = this->op_sge();
933 error = this->op_feq();
936 error = this->op_fne();
939 error = this->op_flt();
942 error = this->op_fle();
945 error = this->op_fgt();
948 error = this->op_fge();
951 error = this->op_not();
954 error = this->op_fpext();
957 error = this->op_fptrunc();
960 error = this->op_fptosi();
963 error = this->op_fptoui();
966 error = this->op_sitofp();
969 error = this->op_uitofp();
972 error = this->op_add();
975 error = this->op_sub();
978 error = this->op_mul();
981 error = this->op_udiv();
984 error = this->op_sdiv();
987 error = this->op_umod();
990 error = this->op_smod();
993 error = this->op_fadd();
996 error = this->op_fsub();
999 error = this->op_fmul();
1002 error = this->op_fdiv();
1005 error = this->op_fpow();
1008 error = this->op_flog();
1011 error = this->op_fmod();
1014 error = this->op_siext_8_64();
1017 error = this->op_siext_16_64();
1020 error = this->op_siext_32_64();
1023 error = this->op_ziext_8_64();
1026 error = this->op_ziext_16_64();
1029 error = this->op_ziext_32_64();
1032 error = this->op_itrunc_64_8();
1035 error = this->op_itrunc_64_16();
1038 error = this->op_itrunc_64_32();
1050 Signal FpySequencer::exit_directiveHandler(
const FpySequencer_ExitDirective& directive,
DirectiveError& error) {
1051 if (this->m_runtime.stack.size < 1) {
1055 U8 errorCode = this->m_runtime.stack.pop<
U8>();
1057 if (errorCode == 0) {
1069 Signal FpySequencer::allocate_directiveHandler(
const FpySequencer_AllocateDirective& directive,
DirectiveError& error) {
1074 this->m_runtime.stack.pushZeroes(directive.get_size());
1078 Signal FpySequencer::storeConstOffset_directiveHandler(
const FpySequencer_StoreConstOffsetDirective& directive,
1080 if (this->m_runtime.stack.size < directive.get_size()) {
1085 Fpy::StackSizeType stackOffset = this->m_runtime.stack.lvarOffset() + directive.get_lvarOffset();
1087 if (stackOffset + directive.get_size() > this->m_runtime.stack.size - directive.get_size()) {
1093 memcpy(this->m_runtime.stack.bytes + stackOffset, this->m_runtime.stack.top() - directive.get_size(),
1094 directive.get_size());
1095 this->m_runtime.stack.size -= directive.get_size();
1099 Signal FpySequencer::load_directiveHandler(
const FpySequencer_LoadDirective& directive,
DirectiveError& error) {
1105 Fpy::StackSizeType stackOffset = this->m_runtime.stack.lvarOffset() + directive.get_lvarOffset();
1107 if (stackOffset + directive.get_size() > this->m_runtime.stack.size) {
1112 memcpy(this->m_runtime.stack.top(), this->m_runtime.stack.bytes + stackOffset, directive.get_size());
1113 this->m_runtime.stack.size += directive.get_size();
1117 Signal FpySequencer::pushVal_directiveHandler(
const FpySequencer_PushValDirective& directive,
DirectiveError& error) {
1123 memcpy(this->m_runtime.stack.top(), directive.get_val(), directive.get__valSize());
1124 this->m_runtime.stack.size +=
static_cast<Fpy::StackSizeType>(directive.get__valSize());
1128 Signal FpySequencer::discard_directiveHandler(
const FpySequencer_DiscardDirective& directive,
DirectiveError& error) {
1129 if (this->m_runtime.stack.size < directive.get_size()) {
1134 this->m_runtime.stack.size -= directive.get_size();
1138 Signal FpySequencer::memCmp_directiveHandler(
const FpySequencer_MemCmpDirective& directive,
DirectiveError& error) {
1140 if (this->m_runtime.stack.size < directive.get_size() * 2) {
1146 U64 lhsOffset = this->m_runtime.stack.size - directive.get_size() * 2;
1147 U64 rhsOffset = this->m_runtime.stack.size - directive.get_size();
1152 this->m_runtime.stack.size -= directive.get_size() * 2;
1155 if (memcmp(this->m_runtime.stack.bytes + lhsOffset, this->m_runtime.stack.bytes + rhsOffset,
1156 directive.get_size()) == 0) {
1157 this->m_runtime.stack.push<
U8>(1);
1159 this->m_runtime.stack.push<
U8>(0);
1164 Signal FpySequencer::stackCmd_directiveHandler(
const FpySequencer_StackCmdDirective& directive,
DirectiveError& error) {
1165 if (this->m_runtime.stack.size < static_cast<U64>(directive.get_argsSize() +
sizeof(
FwOpcodeType))) {
1174 U64 argBufOffset = this->m_runtime.stack.size - directive.get_argsSize();
1177 this->m_runtime.currentCmdOpcode = opcode;
1180 this->m_runtime.stack.size -= directive.get_argsSize();
1182 if (this->sendCmd(opcode, this->m_runtime.stack.bytes + argBufOffset, directive.get_argsSize()) ==
1194 Signal FpySequencer::pushTime_directiveHandler(
const FpySequencer_PushTimeDirective& directive,
DirectiveError& error) {
1210 memcpy(this->m_runtime.stack.bytes + this->m_runtime.stack.size, timeEsb.getBuffAddr(), timeEsb.getSize());
1215 Signal FpySequencer::setFlag_directiveHandler(
const FpySequencer_SetFlagDirective& directive,
DirectiveError& error) {
1216 if (this->m_runtime.stack.size < 1) {
1226 U8 flagVal = this->m_runtime.stack.pop<
U8>() != 0;
1228 this->m_runtime.flags[directive.get_flagIdx()] = flagVal == 1;
1232 Signal FpySequencer::getFlag_directiveHandler(
const FpySequencer_GetFlagDirective& directive,
DirectiveError& error) {
1242 bool flagVal = this->m_runtime.flags[directive.get_flagIdx()];
1243 this->m_runtime.stack.push<
U8>(flagVal);
1247 Signal FpySequencer::getField_directiveHandler(
const FpySequencer_GetFieldDirective& directive,
DirectiveError& error) {
1249 this->m_runtime.stack.size < directive.get_parentSize()) {
1256 if (offset + directive.get_memberSize() > directive.get_parentSize()) {
1267 U8* parentStartPtr = this->m_runtime.stack.top() - directive.get_parentSize();
1269 memmove(parentStartPtr, parentStartPtr + offset, directive.get_memberSize());
1271 this->m_runtime.stack.size -= (directive.get_parentSize() - directive.get_memberSize());
1275 Signal FpySequencer::peek_directiveHandler(
const FpySequencer_PeekDirective& directive,
DirectiveError& error) {
1283 if (offset > this->m_runtime.stack.size) {
1295 if (this->m_runtime.stack.size < byteCount + offset) {
1301 U8* src = this->m_runtime.stack.top() - offset - byteCount;
1302 this->m_runtime.stack.push(src, byteCount);
1306 Signal FpySequencer::store_directiveHandler(
const FpySequencer_StoreDirective& directive,
DirectiveError& error) {
1307 if (this->m_runtime.stack.size < directive.get_size() +
sizeof(
Fpy::StackSizeType)) {
1313 this->m_runtime.stack.lvarOffset() + this->m_runtime.stack.pop<
Fpy::StackSizeType>();
1315 if (stackOffset + directive.get_size() > this->m_runtime.stack.size - directive.get_size()) {
1321 memcpy(this->m_runtime.stack.bytes + stackOffset, this->m_runtime.stack.top() - directive.get_size(),
1322 directive.get_size());
1323 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.