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->storeRelConstOffset_directiveHandler(directive, error));
172 this->sendSignal(this->pushVal_directiveHandler(directive, error));
179 this->sendSignal(this->loadRel_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->storeRel_directiveHandler(directive, error));
249 this->sendSignal(this->call_directiveHandler(directive, error));
256 this->sendSignal(this->return_directiveHandler(directive, error));
263 this->sendSignal(this->loadAbs_directiveHandler(directive, error));
270 this->sendSignal(this->storeAbs_directiveHandler(directive, error));
278 this->sendSignal(this->storeAbsConstOffset_directiveHandler(directive, error));
284 if (this->m_runtime.stack.size < 8) {
291 U32 uSeconds = this->m_runtime.stack.pop<U32>();
292 U32 seconds = this->m_runtime.stack.pop<U32>();
294 wakeupTime.
add(seconds, uSeconds);
295 this->m_runtime.wakeupTime = wakeupTime;
300 Signal FpySequencer::waitAbs_directiveHandler(
const FpySequencer_WaitAbsDirective& directive,
DirectiveError& error) {
306 U32 uSeconds = this->m_runtime.stack.pop<U32>();
307 U32 seconds = this->m_runtime.stack.pop<U32>();
309 U16 base = this->m_runtime.stack.pop<U16>();
311 this->m_runtime.wakeupTime =
Fw::Time(static_cast<TimeBase::T>(base), ctx, seconds, uSeconds);
316 Signal FpySequencer::goto_directiveHandler(
const FpySequencer_GotoDirective& directive,
DirectiveError& error) {
322 m_runtime.nextStatementIndex = directive.get_statementIndex();
327 Signal FpySequencer::if_directiveHandler(
const FpySequencer_IfDirective& directive,
DirectiveError& error) {
328 if (this->m_runtime.stack.size < 1) {
338 if (this->m_runtime.stack.pop<
U8>() != 0) {
344 this->m_runtime.nextStatementIndex = directive.get_falseGotoStmtIndex();
348 Signal FpySequencer::noOp_directiveHandler(
const FpySequencer_NoOpDirective& directive,
DirectiveError& error) {
352 Signal FpySequencer::pushTlmVal_directiveHandler(
const FpySequencer_PushTlmValDirective& directive,
376 Signal FpySequencer::pushTlmValAndTime_directiveHandler(
const FpySequencer_PushTlmValAndTimeDirective& directive,
409 this->m_runtime.stack.push(timeEsb.getBuffAddr(),
static_cast<Fpy::StackSizeType>(timeEsb.getSize()));
413 Signal FpySequencer::pushPrm_directiveHandler(
const FpySequencer_PushPrmDirective& directive,
DirectiveError& error) {
437 Signal FpySequencer::constCmd_directiveHandler(
const FpySequencer_ConstCmdDirective& directive,
DirectiveError& error) {
438 if (this->sendCmd(directive.get_opCode(), directive.get_argBuf(), directive.get__argBufSize()) ==
449 if (this->m_runtime.stack.size <
sizeof(
U8) * 2) {
452 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() | this->m_runtime.stack.pop<
U8>()));
456 if (this->m_runtime.stack.size <
sizeof(
U8) * 2) {
459 this->m_runtime.stack.push(static_cast<U8>(this->m_runtime.stack.pop<
U8>() & this->m_runtime.stack.pop<
U8>()));
463 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
466 this->m_runtime.stack.push(static_cast<U8>((this->m_runtime.stack.pop<I64>() == this->m_runtime.stack.pop<I64>())
472 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
475 this->m_runtime.stack.push(static_cast<U8>((this->m_runtime.stack.pop<I64>() != this->m_runtime.stack.pop<I64>())
481 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
484 U64 rhs = this->m_runtime.stack.pop<
U64>();
485 U64 lhs = this->m_runtime.stack.pop<
U64>();
491 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
494 U64 rhs = this->m_runtime.stack.pop<
U64>();
495 U64 lhs = this->m_runtime.stack.pop<
U64>();
501 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
504 U64 rhs = this->m_runtime.stack.pop<
U64>();
505 U64 lhs = this->m_runtime.stack.pop<
U64>();
511 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
514 U64 rhs = this->m_runtime.stack.pop<
U64>();
515 U64 lhs = this->m_runtime.stack.pop<
U64>();
521 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
524 I64 rhs = this->m_runtime.stack.pop<I64>();
525 I64 lhs = this->m_runtime.stack.pop<I64>();
531 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
534 I64 rhs = this->m_runtime.stack.pop<I64>();
535 I64 lhs = this->m_runtime.stack.pop<I64>();
541 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
544 I64 rhs = this->m_runtime.stack.pop<I64>();
545 I64 lhs = this->m_runtime.stack.pop<I64>();
551 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
554 I64 rhs = this->m_runtime.stack.pop<I64>();
555 I64 lhs = this->m_runtime.stack.pop<I64>();
561 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
564 F64 rhs = this->m_runtime.stack.pop<
F64>();
565 F64 lhs = this->m_runtime.stack.pop<
F64>();
572 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
575 F64 rhs = this->m_runtime.stack.pop<
F64>();
576 F64 lhs = this->m_runtime.stack.pop<
F64>();
583 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
586 F64 rhs = this->m_runtime.stack.pop<
F64>();
587 F64 lhs = this->m_runtime.stack.pop<
F64>();
593 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
596 F64 rhs = this->m_runtime.stack.pop<
F64>();
597 F64 lhs = this->m_runtime.stack.pop<
F64>();
598 this->m_runtime.stack.push(static_cast<U8>(std::islessequal(lhs, rhs) ? static_cast<U8>(
FW_SERIALIZE_TRUE_VALUE)
603 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
606 F64 rhs = this->m_runtime.stack.pop<
F64>();
607 F64 lhs = this->m_runtime.stack.pop<
F64>();
613 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
616 F64 rhs = this->m_runtime.stack.pop<
F64>();
617 F64 lhs = this->m_runtime.stack.pop<
F64>();
618 this->m_runtime.stack.push(static_cast<U8>(std::isgreaterequal(lhs, rhs)
624 if (this->m_runtime.stack.size <
sizeof(
U8)) {
627 this->m_runtime.stack.push(static_cast<U8>((this->m_runtime.stack.pop<
U8>() == 0)
634 if (this->m_runtime.stack.size <
sizeof(
F32)) {
637 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<
F32>()));
642 if (this->m_runtime.stack.size <
sizeof(
F64)) {
645 this->m_runtime.stack.push(static_cast<F32>(this->m_runtime.stack.pop<
F64>()));
649 if (this->m_runtime.stack.size <
sizeof(
F64)) {
652 this->m_runtime.stack.push(static_cast<I64>(this->m_runtime.stack.pop<
F64>()));
656 if (this->m_runtime.stack.size <
sizeof(I64)) {
659 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<I64>()));
663 if (this->m_runtime.stack.size <
sizeof(
F64)) {
666 this->m_runtime.stack.push(static_cast<U64>(this->m_runtime.stack.pop<
F64>()));
670 if (this->m_runtime.stack.size <
sizeof(
U64)) {
673 this->m_runtime.stack.push(static_cast<F64>(this->m_runtime.stack.pop<
U64>()));
677 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
680 I64 rhs = this->m_runtime.stack.pop<I64>();
681 I64 lhs = this->m_runtime.stack.pop<I64>();
685 if ((rhs > 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() - rhs) < lhs)) {
693 this->m_runtime.stack.push(static_cast<I64>(lhs + rhs));
697 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
700 I64 rhs = this->m_runtime.stack.pop<I64>();
701 I64 lhs = this->m_runtime.stack.pop<I64>();
706 if ((rhs < 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() + rhs) < lhs)) {
715 this->m_runtime.stack.push(static_cast<I64>(lhs - rhs));
719 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
722 I64 rhs = this->m_runtime.stack.pop<I64>();
723 I64 lhs = this->m_runtime.stack.pop<I64>();
728 if ((rhs > 0) && (lhs > 0) && ((std::numeric_limits<I64>::max() / rhs) < lhs)) {
732 else if ((rhs < 0) && (lhs < 0) && ((std::numeric_limits<I64>::max() / (-1 * rhs)) < (-1 * lhs))) {
745 this->m_runtime.stack.push(static_cast<I64>(lhs * rhs));
749 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
752 U64 rhs = this->m_runtime.stack.pop<
U64>();
753 U64 lhs = this->m_runtime.stack.pop<
U64>();
758 this->m_runtime.stack.push(static_cast<U64>(lhs / rhs));
762 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
766 I64 rhs = this->m_runtime.stack.pop<I64>();
767 I64 lhs = this->m_runtime.stack.pop<I64>();
772 this->m_runtime.stack.push(static_cast<I64>(lhs / rhs));
776 if (this->m_runtime.stack.size <
sizeof(
U64) * 2) {
779 U64 rhs = this->m_runtime.stack.pop<
U64>();
783 U64 lhs = this->m_runtime.stack.pop<
U64>();
784 this->m_runtime.stack.push(static_cast<U64>(lhs % rhs));
788 if (this->m_runtime.stack.size <
sizeof(I64) * 2) {
791 I64 rhs = this->m_runtime.stack.pop<I64>();
795 I64 lhs = this->m_runtime.stack.pop<I64>();
796 I64 res =
static_cast<I64
>(lhs % rhs);
801 if ((res > 0 && rhs < 0) || (res < 0 && rhs > 0)) {
804 this->m_runtime.stack.push(res);
808 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
811 F64 rhs = this->m_runtime.stack.pop<
F64>();
812 F64 lhs = this->m_runtime.stack.pop<
F64>();
813 this->m_runtime.stack.push(static_cast<F64>(lhs + rhs));
817 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
820 F64 rhs = this->m_runtime.stack.pop<
F64>();
821 F64 lhs = this->m_runtime.stack.pop<
F64>();
822 this->m_runtime.stack.push(static_cast<F64>(lhs - rhs));
826 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
829 F64 rhs = this->m_runtime.stack.pop<
F64>();
830 F64 lhs = this->m_runtime.stack.pop<
F64>();
831 this->m_runtime.stack.push(static_cast<F64>(lhs * rhs));
835 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
838 F64 rhs = this->m_runtime.stack.pop<
F64>();
839 F64 lhs = this->m_runtime.stack.pop<
F64>();
840 this->m_runtime.stack.push(static_cast<F64>(lhs / rhs));
844 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
847 F64 rhs = this->m_runtime.stack.pop<
F64>();
848 F64 lhs = this->m_runtime.stack.pop<
F64>();
849 this->m_runtime.stack.push(static_cast<F64>(pow(lhs, rhs)));
853 if (this->m_runtime.stack.size <
sizeof(
F64)) {
856 F64 val = this->m_runtime.stack.pop<
F64>();
860 this->m_runtime.stack.push(static_cast<F64>(log(val)));
864 if (this->m_runtime.stack.size <
sizeof(
F64) * 2) {
867 F64 rhs = this->m_runtime.stack.pop<
F64>();
871 F64 lhs = this->m_runtime.stack.pop<
F64>();
872 this->m_runtime.stack.push(static_cast<F64>(lhs - rhs * std::floor(lhs / rhs)));
876 if (this->m_runtime.stack.size <
sizeof(
I8)) {
879 I8 src = this->m_runtime.stack.pop<
I8>();
880 this->m_runtime.stack.push(static_cast<I64>(src));
884 if (this->m_runtime.stack.size <
sizeof(I16)) {
887 I16 src = this->m_runtime.stack.pop<I16>();
888 this->m_runtime.stack.push(static_cast<I64>(src));
892 if (this->m_runtime.stack.size <
sizeof(I32)) {
895 I32 src = this->m_runtime.stack.pop<I32>();
896 this->m_runtime.stack.push(static_cast<I64>(src));
900 if (this->m_runtime.stack.size <
sizeof(
U8)) {
903 U8 src = this->m_runtime.stack.pop<
U8>();
904 this->m_runtime.stack.push(static_cast<U64>(src));
908 if (this->m_runtime.stack.size <
sizeof(U16)) {
911 U16 src = this->m_runtime.stack.pop<U16>();
912 this->m_runtime.stack.push(static_cast<U64>(src));
916 if (this->m_runtime.stack.size <
sizeof(U32)) {
919 U32 src = this->m_runtime.stack.pop<U32>();
920 this->m_runtime.stack.push(static_cast<U64>(src));
924 if (this->m_runtime.stack.size <
sizeof(
U64)) {
927 U64 src = this->m_runtime.stack.pop<
U64>();
928 this->m_runtime.stack.push(static_cast<U8>(src));
932 if (this->m_runtime.stack.size <
sizeof(
U64)) {
935 U64 src = this->m_runtime.stack.pop<
U64>();
936 this->m_runtime.stack.push(static_cast<U16>(src));
940 if (this->m_runtime.stack.size <
sizeof(
U64)) {
943 U64 src = this->m_runtime.stack.pop<
U64>();
944 this->m_runtime.stack.push(static_cast<U32>(src));
947 Signal FpySequencer::stackOp_directiveHandler(
const FpySequencer_StackOpDirective& directive,
DirectiveError& error) {
952 switch (directive.get__op()) {
954 error = this->op_or();
957 error = this->op_and();
960 error = this->op_ieq();
963 error = this->op_ine();
966 error = this->op_ult();
969 error = this->op_ule();
972 error = this->op_ugt();
975 error = this->op_uge();
978 error = this->op_slt();
981 error = this->op_sle();
984 error = this->op_sgt();
987 error = this->op_sge();
990 error = this->op_feq();
993 error = this->op_fne();
996 error = this->op_flt();
999 error = this->op_fle();
1002 error = this->op_fgt();
1005 error = this->op_fge();
1008 error = this->op_not();
1011 error = this->op_fpext();
1014 error = this->op_fptrunc();
1017 error = this->op_fptosi();
1020 error = this->op_fptoui();
1023 error = this->op_sitofp();
1026 error = this->op_uitofp();
1029 error = this->op_add();
1032 error = this->op_sub();
1035 error = this->op_mul();
1038 error = this->op_udiv();
1041 error = this->op_sdiv();
1044 error = this->op_umod();
1047 error = this->op_smod();
1050 error = this->op_fadd();
1053 error = this->op_fsub();
1056 error = this->op_fmul();
1059 error = this->op_fdiv();
1062 error = this->op_fpow();
1065 error = this->op_flog();
1068 error = this->op_fmod();
1071 error = this->op_siext_8_64();
1074 error = this->op_siext_16_64();
1077 error = this->op_siext_32_64();
1080 error = this->op_ziext_8_64();
1083 error = this->op_ziext_16_64();
1086 error = this->op_ziext_32_64();
1089 error = this->op_itrunc_64_8();
1092 error = this->op_itrunc_64_16();
1095 error = this->op_itrunc_64_32();
1107 Signal FpySequencer::exit_directiveHandler(
const FpySequencer_ExitDirective& directive,
DirectiveError& error) {
1108 if (this->m_runtime.stack.size < 1) {
1112 U8 errorCode = this->m_runtime.stack.pop<
U8>();
1114 if (errorCode == 0) {
1126 Signal FpySequencer::allocate_directiveHandler(
const FpySequencer_AllocateDirective& directive,
DirectiveError& error) {
1131 this->m_runtime.stack.pushZeroes(directive.get_size());
1137 if (this->m_runtime.stack.size < size) {
1145 if (destOffset > newStackSize || size > newStackSize - destOffset) {
1150 this->m_runtime.stack.copy(destOffset, this->m_runtime.stack.size - size, size);
1151 this->m_runtime.stack.size = newStackSize;
1163 if (srcOffset > this->m_runtime.stack.size || size > this->m_runtime.stack.size - srcOffset) {
1168 this->m_runtime.stack.copy(this->m_runtime.stack.size, srcOffset, size);
1169 this->m_runtime.stack.size += size;
1173 Signal FpySequencer::storeRelConstOffset_directiveHandler(
const FpySequencer_StoreRelConstOffsetDirective& directive,
1175 I64 addr =
static_cast<I64
>(this->m_runtime.stack.currentFrameStart) + directive.get_lvarOffset();
1180 return this->storeHelper(static_cast<Fpy::StackSizeType>(addr), directive.get_size(), error);
1183 Signal FpySequencer::loadRel_directiveHandler(
const FpySequencer_LoadRelDirective& directive,
DirectiveError& error) {
1184 I64 addr =
static_cast<I64
>(this->m_runtime.stack.currentFrameStart) + directive.get_lvarOffset();
1189 return this->loadHelper(static_cast<Fpy::StackSizeType>(addr), directive.get_size(), error);
1192 Signal FpySequencer::pushVal_directiveHandler(
const FpySequencer_PushValDirective& directive,
DirectiveError& error) {
1198 this->m_runtime.stack.push(const_cast<U8*>(directive.get_val()),
1199 static_cast<Fpy::StackSizeType>(directive.get__valSize()));
1203 Signal FpySequencer::discard_directiveHandler(
const FpySequencer_DiscardDirective& directive,
DirectiveError& error) {
1204 if (this->m_runtime.stack.size < directive.get_size()) {
1209 this->m_runtime.stack.size -= directive.get_size();
1213 Signal FpySequencer::memCmp_directiveHandler(
const FpySequencer_MemCmpDirective& directive,
DirectiveError& error) {
1222 if (this->m_runtime.stack.size < directive.get_size() * 2) {
1228 U64 lhsOffset = this->m_runtime.stack.size - directive.get_size() * 2;
1229 U64 rhsOffset = this->m_runtime.stack.size - directive.get_size();
1234 this->m_runtime.stack.size -= directive.get_size() * 2;
1237 if (memcmp(this->m_runtime.stack.bytes + lhsOffset, this->m_runtime.stack.bytes + rhsOffset,
1238 directive.get_size()) == 0) {
1246 Signal FpySequencer::stackCmd_directiveHandler(
const FpySequencer_StackCmdDirective& directive,
DirectiveError& error) {
1249 if (this->m_runtime.stack.size <
sizeof(
FwOpcodeType) ||
1250 this->m_runtime.stack.size -
sizeof(
FwOpcodeType) < directive.get_argsSize()) {
1259 U64 argBufOffset = this->m_runtime.stack.size - directive.get_argsSize();
1262 this->m_runtime.currentCmdOpcode = opcode;
1265 this->m_runtime.stack.size -= directive.get_argsSize();
1267 if (this->sendCmd(opcode, this->m_runtime.stack.bytes + argBufOffset, directive.get_argsSize()) ==
1279 Signal FpySequencer::pushTime_directiveHandler(
const FpySequencer_PushTimeDirective& directive,
DirectiveError& error) {
1295 this->m_runtime.stack.push(timeEsb.getBuffAddr(),
static_cast<Fpy::StackSizeType>(timeEsb.getSize()));
1299 Signal FpySequencer::setFlag_directiveHandler(
const FpySequencer_SetFlagDirective& directive,
DirectiveError& error) {
1300 if (this->m_runtime.stack.size < 1) {
1310 U8 flagVal = this->m_runtime.stack.pop<
U8>() != 0;
1312 this->m_runtime.flags[directive.get_flagIdx()] = flagVal == 1;
1316 Signal FpySequencer::getFlag_directiveHandler(
const FpySequencer_GetFlagDirective& directive,
DirectiveError& error) {
1326 bool flagVal = this->m_runtime.flags[directive.get_flagIdx()];
1332 Signal FpySequencer::getField_directiveHandler(
const FpySequencer_GetFieldDirective& directive,
DirectiveError& error) {
1340 if (this->m_runtime.stack.size -
sizeof(
Fpy::StackSizeType) < directive.get_parentSize()) {
1349 if (offset > directive.get_parentSize() || directive.get_memberSize() > directive.get_parentSize() - offset) {
1360 Fpy::StackSizeType parentStartOffset = this->m_runtime.stack.size - directive.get_parentSize();
1363 this->m_runtime.stack.move(parentStartOffset, parentStartOffset + offset, directive.get_memberSize());
1365 this->m_runtime.stack.size -= (directive.get_parentSize() - directive.get_memberSize());
1369 Signal FpySequencer::peek_directiveHandler(
const FpySequencer_PeekDirective& directive,
DirectiveError& error) {
1380 if (offset > this->m_runtime.stack.size) {
1393 if (byteCount > this->m_runtime.stack.size - offset) {
1399 U8* src = this->m_runtime.stack.top() - offset - byteCount;
1400 this->m_runtime.stack.push(src, byteCount);
1404 Signal FpySequencer::storeRel_directiveHandler(
const FpySequencer_StoreRelDirective& directive,
DirectiveError& error) {
1417 I64 addr =
static_cast<I64
>(this->m_runtime.stack.currentFrameStart) + lvarOffset;
1422 return this->storeHelper(static_cast<Fpy::StackSizeType>(addr), directive.get_size(), error);
1425 Signal FpySequencer::call_directiveHandler(
const FpySequencer_CallDirective& directive,
DirectiveError& error) {
1427 if (this->m_runtime.stack.size <
sizeof(U32)) {
1433 U32 target = this->m_runtime.stack.pop<U32>();
1448 U32 returnAddr = this->m_runtime.nextStatementIndex;
1451 this->m_runtime.nextStatementIndex = target;
1454 this->m_runtime.stack.push<U32>(returnAddr);
1457 this->m_runtime.stack.push<
Fpy::StackSizeType>(this->m_runtime.stack.currentFrameStart);
1460 this->m_runtime.stack.currentFrameStart = this->m_runtime.stack.size;
1465 Signal FpySequencer::return_directiveHandler(
const FpySequencer_ReturnDirective& directive,
DirectiveError& error) {
1470 if (this->m_runtime.stack.size < returnValSize) {
1480 if (returnValSize > 0) {
1481 memcpy(returnValue, this->m_runtime.stack.top() - returnValSize, returnValSize);
1485 if (this->m_runtime.stack.currentFrameStart > this->m_runtime.stack.size) {
1489 this->m_runtime.stack.size = this->m_runtime.stack.currentFrameStart;
1501 U32 returnAddr = this->m_runtime.stack.pop<U32>();
1504 if (savedFramePtr > this->m_runtime.stack.size) {
1508 this->m_runtime.stack.currentFrameStart = savedFramePtr;
1517 this->m_runtime.nextStatementIndex = returnAddr;
1520 if (this->m_runtime.stack.size < callArgsSize) {
1525 this->m_runtime.stack.size -= callArgsSize;
1532 this->m_runtime.stack.push(returnValue, returnValSize);
1537 Signal FpySequencer::loadAbs_directiveHandler(
const FpySequencer_LoadAbsDirective& directive,
DirectiveError& error) {
1538 return this->loadHelper(directive.get_globalOffset(), directive.get_size(), error);
1541 Signal FpySequencer::storeAbs_directiveHandler(
const FpySequencer_StoreAbsDirective& directive,
DirectiveError& error) {
1555 return this->storeHelper(globalOffset, size, error);
1558 Signal FpySequencer::storeAbsConstOffset_directiveHandler(
const FpySequencer_StoreAbsConstOffsetDirective& directive,
1560 return this->storeHelper(directive.get_globalOffset(), directive.get_size(), error);
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.
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.
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
Fw::TlmValid getTlmChan_out(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke output port getTlmChan.
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.
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.
U8 FwTimeContextStoreType
The type used to serialize a time context value.
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 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_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 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.
void directive_getFlag_internalInterfaceHandler(const Svc::FpySequencer_GetFlagDirective &directive) override
Internal interface handler for directive_getFlag.
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
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...
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.
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
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 directive_storeAbs_internalInterfaceHandler(const Svc::FpySequencer_StoreAbsDirective &directive) override
Internal interface handler for directive_storeAbs.
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.