10 void FpySequencer::sendSignal(
Signal signal) {
29 FW_ASSERT(0, static_cast<FwAssertArgType>(signal));
35 void FpySequencer::handleDirectiveErrorCode(Fpy::DirectiveId
id,
DirectiveError err) {
36 this->m_tlm.lastDirectiveError = err;
38 this->m_tlm.directiveErrorIndex = this->currentStatementIdx();
39 this->m_tlm.directiveErrorId = id;
46 cmdBuf.
serializeFrom(static_cast<FwPacketDescriptorType>(Fw::ComPacketType::FW_PACKET_COMMAND));
69 static_cast<U32
>(((this->m_sequencesStarted & 0xFFFF) << 16) | (this->m_statementsDispatched & 0xFFFF));
79 this->sendSignal(this->waitRel_directiveHandler(directive, error));
86 this->sendSignal(this->waitAbs_directiveHandler(directive, error));
93 this->sendSignal(this->goto_directiveHandler(directive, error));
100 this->sendSignal(this->if_directiveHandler(directive, error));
107 this->sendSignal(this->noOp_directiveHandler(directive, error));
115 this->sendSignal(this->pushTlmVal_directiveHandler(directive, error));
123 this->sendSignal(this->pushTlmValAndTime_directiveHandler(directive, error));
130 this->sendSignal(this->pushPrm_directiveHandler(directive, error));
137 this->sendSignal(this->constCmd_directiveHandler(directive, error));
144 this->sendSignal(this->stackOp_directiveHandler(directive, error));
145 handleDirectiveErrorCode(directive.
get__op(), error);
151 this->sendSignal(this->exit_directiveHandler(directive, error));
158 this->sendSignal(this->allocate_directiveHandler(directive, error));
166 this->sendSignal(this->storeRelConstOffset_directiveHandler(directive, error));
173 this->sendSignal(this->pushVal_directiveHandler(directive, error));
180 this->sendSignal(this->loadRel_directiveHandler(directive, error));
187 this->sendSignal(this->discard_directiveHandler(directive, error));
194 this->sendSignal(this->memCmp_directiveHandler(directive, error));
201 this->sendSignal(this->stackCmd_directiveHandler(directive, error));
208 this->sendSignal(this->pushTime_directiveHandler(directive, error));
215 this->sendSignal(this->getField_directiveHandler(directive, error));
222 this->sendSignal(this->peek_directiveHandler(directive, error));
229 this->sendSignal(this->storeRel_directiveHandler(directive, error));
236 this->sendSignal(this->call_directiveHandler(directive, error));
243 this->sendSignal(this->return_directiveHandler(directive, error));
250 this->sendSignal(this->loadAbs_directiveHandler(directive, error));
257 this->sendSignal(this->storeAbs_directiveHandler(directive, error));
265 this->sendSignal(this->storeAbsConstOffset_directiveHandler(directive, error));
271 if (this->m_runtime.stack.size < 8) {
278 U32 uSeconds = this->m_runtime.stack.pop<U32>();
279 U32 seconds = this->m_runtime.stack.pop<U32>();
281 wakeupTime.
add(seconds, uSeconds);
282 this->m_runtime.wakeupTime = wakeupTime;
287 Signal FpySequencer::waitAbs_directiveHandler(
const FpySequencer_WaitAbsDirective& directive,
DirectiveError& error) {
293 U32 uSeconds = this->m_runtime.stack.pop<U32>();
294 U32 seconds = this->m_runtime.stack.pop<U32>();
298 this->m_runtime.wakeupTime =
Fw::Time(static_cast<TimeBase::T>(base), ctx, seconds, uSeconds);
303 Signal FpySequencer::goto_directiveHandler(
const FpySequencer_GotoDirective& directive,
DirectiveError& error) {
309 m_runtime.nextStatementIndex = directive.get_statementIndex();
314 Signal FpySequencer::if_directiveHandler(
const FpySequencer_IfDirective& directive,
DirectiveError& error) {
315 if (this->m_runtime.stack.size < 1) {
325 if (this->m_runtime.stack.pop<
U8>() != 0) {
331 this->m_runtime.nextStatementIndex = directive.get_falseGotoStmtIndex();
335 Signal FpySequencer::noOp_directiveHandler(
const FpySequencer_NoOpDirective& directive,
DirectiveError& error) {
339 Signal FpySequencer::pushTlmVal_directiveHandler(
const FpySequencer_PushTlmValDirective& directive,
363 Signal FpySequencer::pushTlmValAndTime_directiveHandler(
const FpySequencer_PushTlmValAndTimeDirective& directive,
396 this->m_runtime.stack.push(timeEsb.getBuffAddr(),
static_cast<Fpy::StackSizeType>(timeEsb.getSize()));
400 Signal FpySequencer::pushPrm_directiveHandler(
const FpySequencer_PushPrmDirective& directive,
DirectiveError& error) {
424 Signal FpySequencer::constCmd_directiveHandler(
const FpySequencer_ConstCmdDirective& directive,
DirectiveError& error) {
425 if (this->sendCmd(directive.get_opCode(), directive.get_argBuf(), directive.get__argBufSize()) ==
436 if (this->m_runtime.stack.size <
sizeof(
U8) * 2) {
439 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() | this->m_runtime.stack.pop<
U8>()));
443 if (this->m_runtime.stack.size <
sizeof(
U8) * 2) {
446 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() & this->m_runtime.stack.pop<
U8>()));
450 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
453 this->m_runtime.stack.push(static_cast<U8>((this->m_runtime.stack.pop<I64>() == this->m_runtime.stack.pop<I64>())
459 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
462 this->m_runtime.stack.push(static_cast<U8>((this->m_runtime.stack.pop<I64>() != this->m_runtime.stack.pop<I64>())
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>();
478 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
481 U64 rhs = this->m_runtime.stack.pop<
U64>();
482 U64 lhs = this->m_runtime.stack.pop<
U64>();
488 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
491 U64 rhs = this->m_runtime.stack.pop<
U64>();
492 U64 lhs = this->m_runtime.stack.pop<
U64>();
498 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
501 U64 rhs = this->m_runtime.stack.pop<
U64>();
502 U64 lhs = this->m_runtime.stack.pop<
U64>();
508 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
511 I64 rhs = this->m_runtime.stack.pop<I64>();
512 I64 lhs = this->m_runtime.stack.pop<I64>();
518 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
521 I64 rhs = this->m_runtime.stack.pop<I64>();
522 I64 lhs = this->m_runtime.stack.pop<I64>();
528 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
531 I64 rhs = this->m_runtime.stack.pop<I64>();
532 I64 lhs = this->m_runtime.stack.pop<I64>();
538 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
541 I64 rhs = this->m_runtime.stack.pop<I64>();
542 I64 lhs = this->m_runtime.stack.pop<I64>();
548 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
551 F64 rhs = this->m_runtime.stack.pop<
F64>();
552 F64 lhs = this->m_runtime.stack.pop<
F64>();
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>();
570 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
573 F64 rhs = this->m_runtime.stack.pop<
F64>();
574 F64 lhs = this->m_runtime.stack.pop<
F64>();
580 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
583 F64 rhs = this->m_runtime.stack.pop<
F64>();
584 F64 lhs = this->m_runtime.stack.pop<
F64>();
585 this->m_runtime.stack.push(static_cast<U8>(std::islessequal(lhs, rhs) ? static_cast<U8>(
FW_SERIALIZE_TRUE_VALUE)
590 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
593 F64 rhs = this->m_runtime.stack.pop<
F64>();
594 F64 lhs = this->m_runtime.stack.pop<
F64>();
600 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
603 F64 rhs = this->m_runtime.stack.pop<
F64>();
604 F64 lhs = this->m_runtime.stack.pop<
F64>();
605 this->m_runtime.stack.push(static_cast<U8>(std::isgreaterequal(lhs, rhs)
611 if (this->m_runtime.stack.size <
sizeof(
U8)) {
614 this->m_runtime.stack.push(static_cast<U8>((this->m_runtime.stack.pop<
U8>() == 0)
621 if (this->m_runtime.stack.size <
sizeof(
F32)) {
624 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<
F32>()));
629 if (this->m_runtime.stack.size <
sizeof(
F64)) {
632 this->m_runtime.stack.push(static_cast<F32>(this->m_runtime.stack.pop<
F64>()));
636 if (this->m_runtime.stack.size <
sizeof(
F64)) {
639 this->m_runtime.stack.push(static_cast<I64>(this->m_runtime.stack.pop<
F64>()));
643 if (this->m_runtime.stack.size <
sizeof(I64)) {
646 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<I64>()));
650 if (this->m_runtime.stack.size <
sizeof(
F64)) {
653 this->m_runtime.stack.push(static_cast<U64>(this->m_runtime.stack.pop<
F64>()));
657 if (this->m_runtime.stack.size <
sizeof(
U64)) {
660 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<
U64>()));
664 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
667 I64 rhs = this->m_runtime.stack.pop<I64>();
668 I64 lhs = this->m_runtime.stack.pop<I64>();
672 if ((rhs > 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() - rhs) < lhs)) {
680 this->m_runtime.stack.push(static_cast<I64>(lhs + rhs));
684 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
687 I64 rhs = this->m_runtime.stack.pop<I64>();
688 I64 lhs = this->m_runtime.stack.pop<I64>();
693 if ((rhs < 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() + rhs) < lhs)) {
702 this->m_runtime.stack.push(static_cast<I64>(lhs - rhs));
706 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 if ((rhs > 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() / rhs) < lhs)) {
719 else if ((rhs < 0) && (lhs < 0) && ((std::numeric_limits<I64>::max() / (-1 * rhs)) < (-1 * lhs))) {
732 this->m_runtime.stack.push(static_cast<I64>(lhs * rhs));
736 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
739 U64 rhs = this->m_runtime.stack.pop<
U64>();
740 U64 lhs = this->m_runtime.stack.pop<
U64>();
745 this->m_runtime.stack.push(static_cast<U64>(lhs / rhs));
749 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
753 I64 rhs = this->m_runtime.stack.pop<I64>();
754 I64 lhs = this->m_runtime.stack.pop<I64>();
759 this->m_runtime.stack.push(static_cast<I64>(lhs / rhs));
763 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
766 U64 rhs = this->m_runtime.stack.pop<
U64>();
770 U64 lhs = this->m_runtime.stack.pop<
U64>();
771 this->m_runtime.stack.push(static_cast<U64>(lhs % rhs));
775 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
778 I64 rhs = this->m_runtime.stack.pop<I64>();
782 I64 lhs = this->m_runtime.stack.pop<I64>();
783 I64 res =
static_cast<I64
>(lhs % rhs);
788 if ((res > 0 && rhs < 0) || (res < 0 && rhs > 0)) {
791 this->m_runtime.stack.push(res);
795 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
798 F64 rhs = this->m_runtime.stack.pop<
F64>();
799 F64 lhs = this->m_runtime.stack.pop<
F64>();
800 this->m_runtime.stack.push(static_cast<F64>(lhs + rhs));
804 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
807 F64 rhs = this->m_runtime.stack.pop<
F64>();
808 F64 lhs = this->m_runtime.stack.pop<
F64>();
809 this->m_runtime.stack.push(static_cast<F64>(lhs - rhs));
813 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
816 F64 rhs = this->m_runtime.stack.pop<
F64>();
817 F64 lhs = this->m_runtime.stack.pop<
F64>();
818 this->m_runtime.stack.push(static_cast<F64>(lhs * rhs));
822 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
825 F64 rhs = this->m_runtime.stack.pop<
F64>();
826 F64 lhs = this->m_runtime.stack.pop<
F64>();
827 this->m_runtime.stack.push(static_cast<F64>(lhs / rhs));
831 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
834 F64 rhs = this->m_runtime.stack.pop<
F64>();
835 F64 lhs = this->m_runtime.stack.pop<
F64>();
836 this->m_runtime.stack.push(static_cast<F64>(pow(lhs, rhs)));
840 if (this->m_runtime.stack.size <
sizeof(
F64)) {
843 F64 val = this->m_runtime.stack.pop<
F64>();
847 this->m_runtime.stack.push(static_cast<F64>(log(val)));
851 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
854 F64 rhs = this->m_runtime.stack.pop<
F64>();
858 F64 lhs = this->m_runtime.stack.pop<
F64>();
859 this->m_runtime.stack.push(static_cast<F64>(lhs - rhs * std::floor(lhs / rhs)));
863 if (this->m_runtime.stack.size <
sizeof(
I8)) {
866 I8 src = this->m_runtime.stack.pop<
I8>();
867 this->m_runtime.stack.push(static_cast<I64>(src));
871 if (this->m_runtime.stack.size <
sizeof(I16)) {
874 I16 src = this->m_runtime.stack.pop<I16>();
875 this->m_runtime.stack.push(static_cast<I64>(src));
879 if (this->m_runtime.stack.size <
sizeof(I32)) {
882 I32 src = this->m_runtime.stack.pop<I32>();
883 this->m_runtime.stack.push(static_cast<I64>(src));
887 if (this->m_runtime.stack.size <
sizeof(
U8)) {
890 U8 src = this->m_runtime.stack.pop<
U8>();
891 this->m_runtime.stack.push(static_cast<U64>(src));
895 if (this->m_runtime.stack.size <
sizeof(U16)) {
898 U16 src = this->m_runtime.stack.pop<U16>();
899 this->m_runtime.stack.push(static_cast<U64>(src));
903 if (this->m_runtime.stack.size <
sizeof(U32)) {
906 U32 src = this->m_runtime.stack.pop<U32>();
907 this->m_runtime.stack.push(static_cast<U64>(src));
911 if (this->m_runtime.stack.size <
sizeof(
U64)) {
914 U64 src = this->m_runtime.stack.pop<
U64>();
915 this->m_runtime.stack.push(static_cast<U8>(src));
919 if (this->m_runtime.stack.size <
sizeof(
U64)) {
922 U64 src = this->m_runtime.stack.pop<
U64>();
923 this->m_runtime.stack.push(static_cast<U16>(src));
927 if (this->m_runtime.stack.size <
sizeof(
U64)) {
930 U64 src = this->m_runtime.stack.pop<
U64>();
931 this->m_runtime.stack.push(static_cast<U32>(src));
934 Signal FpySequencer::stackOp_directiveHandler(
const FpySequencer_StackOpDirective& directive,
DirectiveError& error) {
939 switch (directive.get__op()) {
941 error = this->op_or();
944 error = this->op_and();
947 error = this->op_ieq();
950 error = this->op_ine();
953 error = this->op_ult();
956 error = this->op_ule();
959 error = this->op_ugt();
962 error = this->op_uge();
965 error = this->op_slt();
968 error = this->op_sle();
971 error = this->op_sgt();
974 error = this->op_sge();
977 error = this->op_feq();
980 error = this->op_fne();
983 error = this->op_flt();
986 error = this->op_fle();
989 error = this->op_fgt();
992 error = this->op_fge();
995 error = this->op_not();
998 error = this->op_fpext();
1001 error = this->op_fptrunc();
1004 error = this->op_fptosi();
1007 error = this->op_fptoui();
1010 error = this->op_sitofp();
1013 error = this->op_uitofp();
1016 error = this->op_add();
1019 error = this->op_sub();
1022 error = this->op_mul();
1025 error = this->op_udiv();
1028 error = this->op_sdiv();
1031 error = this->op_umod();
1034 error = this->op_smod();
1037 error = this->op_fadd();
1040 error = this->op_fsub();
1043 error = this->op_fmul();
1046 error = this->op_fdiv();
1049 error = this->op_fpow();
1052 error = this->op_flog();
1055 error = this->op_fmod();
1058 error = this->op_siext_8_64();
1061 error = this->op_siext_16_64();
1064 error = this->op_siext_32_64();
1067 error = this->op_ziext_8_64();
1070 error = this->op_ziext_16_64();
1073 error = this->op_ziext_32_64();
1076 error = this->op_itrunc_64_8();
1079 error = this->op_itrunc_64_16();
1082 error = this->op_itrunc_64_32();
1094 Signal FpySequencer::exit_directiveHandler(
const FpySequencer_ExitDirective& directive,
DirectiveError& error) {
1095 if (this->m_runtime.stack.size < 1) {
1099 U8 errorCode = this->m_runtime.stack.pop<
U8>();
1101 if (errorCode == 0) {
1113 Signal FpySequencer::allocate_directiveHandler(
const FpySequencer_AllocateDirective& directive,
DirectiveError& error) {
1118 this->m_runtime.stack.pushZeroes(directive.get_size());
1124 if (this->m_runtime.stack.size < size) {
1132 if (destOffset > newStackSize || size > newStackSize - destOffset) {
1137 this->m_runtime.stack.copy(destOffset, this->m_runtime.stack.size - size, size);
1138 this->m_runtime.stack.size = newStackSize;
1150 if (srcOffset > this->m_runtime.stack.size || size > this->m_runtime.stack.size - srcOffset) {
1155 this->m_runtime.stack.copy(this->m_runtime.stack.size, srcOffset, size);
1156 this->m_runtime.stack.size += size;
1160 Signal FpySequencer::storeRelConstOffset_directiveHandler(
const FpySequencer_StoreRelConstOffsetDirective& directive,
1162 I64 addr =
static_cast<I64
>(this->m_runtime.stack.currentFrameStart) + directive.get_lvarOffset();
1167 return this->storeHelper(static_cast<Fpy::StackSizeType>(addr), directive.get_size(), error);
1170 Signal FpySequencer::loadRel_directiveHandler(
const FpySequencer_LoadRelDirective& directive,
DirectiveError& error) {
1171 I64 addr =
static_cast<I64
>(this->m_runtime.stack.currentFrameStart) + directive.get_lvarOffset();
1176 return this->loadHelper(static_cast<Fpy::StackSizeType>(addr), directive.get_size(), error);
1179 Signal FpySequencer::pushVal_directiveHandler(
const FpySequencer_PushValDirective& directive,
DirectiveError& error) {
1185 this->m_runtime.stack.push(const_cast<U8*>(directive.get_val()),
1186 static_cast<Fpy::StackSizeType>(directive.get__valSize()));
1190 Signal FpySequencer::discard_directiveHandler(
const FpySequencer_DiscardDirective& directive,
DirectiveError& error) {
1191 if (this->m_runtime.stack.size < directive.get_size()) {
1196 this->m_runtime.stack.size -= directive.get_size();
1200 Signal FpySequencer::memCmp_directiveHandler(
const FpySequencer_MemCmpDirective& directive,
DirectiveError& error) {
1209 if (this->m_runtime.stack.size < directive.get_size() * 2) {
1215 U64 lhsOffset = this->m_runtime.stack.size - directive.get_size() * 2;
1216 U64 rhsOffset = this->m_runtime.stack.size - directive.get_size();
1221 this->m_runtime.stack.size -= directive.get_size() * 2;
1224 if (memcmp(this->m_runtime.stack.bytes + lhsOffset, this->m_runtime.stack.bytes + rhsOffset,
1225 directive.get_size()) == 0) {
1233 Signal FpySequencer::stackCmd_directiveHandler(
const FpySequencer_StackCmdDirective& directive,
DirectiveError& error) {
1236 if (this->m_runtime.stack.size <
sizeof(
FwOpcodeType) ||
1237 this->m_runtime.stack.size -
sizeof(
FwOpcodeType) < directive.get_argsSize()) {
1246 U64 argBufOffset = this->m_runtime.stack.size - directive.get_argsSize();
1249 this->m_runtime.currentCmdOpcode = opcode;
1252 this->m_runtime.stack.size -= directive.get_argsSize();
1254 if (this->sendCmd(opcode, this->m_runtime.stack.bytes + argBufOffset, directive.get_argsSize()) ==
1266 Signal FpySequencer::pushTime_directiveHandler(
const FpySequencer_PushTimeDirective& directive,
DirectiveError& error) {
1282 this->m_runtime.stack.push(timeEsb.getBuffAddr(),
static_cast<Fpy::StackSizeType>(timeEsb.getSize()));
1286 Signal FpySequencer::getField_directiveHandler(
const FpySequencer_GetFieldDirective& directive,
DirectiveError& error) {
1294 if (this->m_runtime.stack.size -
sizeof(
Fpy::StackSizeType) < directive.get_parentSize()) {
1303 if (offset > directive.get_parentSize() || directive.get_memberSize() > directive.get_parentSize() - offset) {
1314 Fpy::StackSizeType parentStartOffset = this->m_runtime.stack.size - directive.get_parentSize();
1317 this->m_runtime.stack.move(parentStartOffset, parentStartOffset + offset, directive.get_memberSize());
1319 this->m_runtime.stack.size -= (directive.get_parentSize() - directive.get_memberSize());
1323 Signal FpySequencer::peek_directiveHandler(
const FpySequencer_PeekDirective& directive,
DirectiveError& error) {
1334 if (offset > this->m_runtime.stack.size) {
1347 if (byteCount > this->m_runtime.stack.size - offset) {
1353 U8* src = this->m_runtime.stack.top() - offset - byteCount;
1354 this->m_runtime.stack.push(src, byteCount);
1358 Signal FpySequencer::storeRel_directiveHandler(
const FpySequencer_StoreRelDirective& directive,
DirectiveError& error) {
1371 I64 addr =
static_cast<I64
>(this->m_runtime.stack.currentFrameStart) + lvarOffset;
1376 return this->storeHelper(static_cast<Fpy::StackSizeType>(addr), directive.get_size(), error);
1379 Signal FpySequencer::call_directiveHandler(
const FpySequencer_CallDirective& directive,
DirectiveError& error) {
1381 if (this->m_runtime.stack.size <
sizeof(U32)) {
1387 U32 target = this->m_runtime.stack.pop<U32>();
1402 U32 returnAddr = this->m_runtime.nextStatementIndex;
1405 this->m_runtime.nextStatementIndex = target;
1408 this->m_runtime.stack.push<U32>(returnAddr);
1411 this->m_runtime.stack.push<
Fpy::StackSizeType>(this->m_runtime.stack.currentFrameStart);
1414 this->m_runtime.stack.currentFrameStart = this->m_runtime.stack.size;
1419 Signal FpySequencer::return_directiveHandler(
const FpySequencer_ReturnDirective& directive,
DirectiveError& error) {
1424 if (this->m_runtime.stack.size < returnValSize) {
1434 if (returnValSize > 0) {
1435 memcpy(returnValue, this->m_runtime.stack.top() - returnValSize, returnValSize);
1439 if (this->m_runtime.stack.currentFrameStart > this->m_runtime.stack.size) {
1443 this->m_runtime.stack.size = this->m_runtime.stack.currentFrameStart;
1455 U32 returnAddr = this->m_runtime.stack.pop<U32>();
1458 if (savedFramePtr > this->m_runtime.stack.size) {
1462 this->m_runtime.stack.currentFrameStart = savedFramePtr;
1471 this->m_runtime.nextStatementIndex = returnAddr;
1474 if (this->m_runtime.stack.size < callArgsSize) {
1479 this->m_runtime.stack.size -= callArgsSize;
1486 this->m_runtime.stack.push(returnValue, returnValSize);
1491 Signal FpySequencer::loadAbs_directiveHandler(
const FpySequencer_LoadAbsDirective& directive,
DirectiveError& error) {
1492 return this->loadHelper(directive.get_globalOffset(), directive.get_size(), error);
1495 Signal FpySequencer::storeAbs_directiveHandler(
const FpySequencer_StoreAbsDirective& directive,
DirectiveError& error) {
1509 return this->storeHelper(globalOffset, size, error);
1512 Signal FpySequencer::storeAbsConstOffset_directiveHandler(
const FpySequencer_StoreAbsConstOffsetDirective& directive,
1514 return this->storeHelper(directive.get_globalOffset(), directive.get_size(), error);
1520 this->sendSignal(this->popEvent_directiveHandler(directive, error));
1544 if (messageSize > clampedSize) {
1546 this->m_runtime.stack.size -= excess;
1548 this->m_runtime.stack.pop(messageBuf, clampedSize);
1549 messageBuf[clampedSize] =
'\0';
1555 Fw::String messageStr(reinterpret_cast<const char*>(messageBuf));
void directive_storeRelConstOffset_internalInterfaceHandler(const Svc::FpySequencer_StoreRelConstOffsetDirective &directive) override
Internal interface handler for directive_storeRelConstOffset.
void cmdOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port cmdOut.
void directive_storeRel_internalInterfaceHandler(const Svc::FpySequencer_StoreRelDirective &directive) override
Internal interface handler for directive_storeRel.
Serialization/Deserialization operation was successful.
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
U8 * getBuffAddr()
Get buffer address for data filling (non-const version)
void directive_call_internalInterfaceHandler(const Svc::FpySequencer_CallDirective &directive) override
Internal interface handler for directive_call.
bool isConnected_getTlmChan_OutputPort(FwIndexType portNum) const
FwIdType FwOpcodeType
The type of a command opcode.
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
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.
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.
returns from a function call
I32 SignedStackSizeType
signed version of StackSizeType, used for relative offsets that can be negative
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
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.
Fw::ParamValid getParam_out(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke output port getParam.
bool isConnected_prmGet_OutputPort(FwIndexType portNum) const
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_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.
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.
void log_DIAGNOSTIC_LogDiagnostic(const Fw::StringBase &filePath, const Fw::StringBase &message) const
Log event LogDiagnostic.
void log_COMMAND_LogCommand(const Fw::StringBase &filePath, const Fw::StringBase &message) const
Log event LogCommand.
U8 FwTimeContextStoreType
The type used to serialize a time context value.
Software diagnostic events.
void log_ACTIVITY_LO_LogActivityLo(const Fw::StringBase &filePath, const Fw::StringBase &message) const
Log event LogActivityLo.
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.
loads a value from a local variable at a compile-time-known offset relative to the current stack fram...
void directive_stackCmd_internalInterfaceHandler(const Svc::FpySequencer_StackCmdDirective &directive) override
Internal interface handler for directive_stackCmd.
void log_ACTIVITY_HI_LogActivityHi(const Fw::StringBase &filePath, const Fw::StringBase &message) const
Log event LogActivityHi.
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.
Less important informational events.
pops a severity and message from the stack and emits an F Prime event
An activity related to commanding.
A less serious but recoverable event.
Omit length from serialization.
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 ...
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 log_WARNING_HI_LogWarningHi(const Fw::StringBase &filePath, const Fw::StringBase &message) const
Log event LogWarningHi.
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.
A serious but recoverable event.
void sequencer_sendSignal_stmtResponse_beginSleep()
Send signal stmtResponse_beginSleep to state machine sequencer.
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
void directive_popEvent_internalInterfaceHandler(const Svc::FpySequencer_PopEventDirective &directive) override
Internal interface handler for directive_popEvent.
generic stack operation handler
Important informational events.
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...
loads a value from an absolute address in the stack (for global variables)
double F64
64-bit floating point (double). Required for compiler-supplied double promotion.
A fatal non-recoverable event.
void log_WARNING_LO_LogWarningLo(const Fw::StringBase &filePath, const Fw::StringBase &message) const
Log event LogWarningLo.
pushes a const byte array onto stack
stores a value to a local variable at a runtime-determined offset relative to the current stack frame...
RateGroupDivider component implementation.
Enum representing parameter validity.
void log_FATAL_LogFatal(const Fw::StringBase &filePath, const Fw::StringBase &message) const
Log event LogFatal.
void directive_storeAbs_internalInterfaceHandler(const Svc::FpySequencer_StoreAbsDirective &directive) override
Internal interface handler for directive_storeAbs.
pushes a prm buf to the stack
U16 FwTimeBaseStoreType
The type used to serialize a time base value.
pushes the current Fw.Time struct to the stack
pushes some empty bytes to the stack
called when the statement is telling the sequencer to await a later stmt response ...
FpySequencer_SequencerStateMachineStateMachineBase::Signal Signal
Fw::TlmValid getTlmChan_out(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke output port getTlmChan.
a statement is telling the sequencer to go to sleep
pushes a tlm buf to the stack
U8 SerialType
The serial representation type.
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.