GCC Code Coverage Report


Directory: Svc/FpySequencer/
File: FpySequencerRunState.cpp
Date: 2026-09-03 21:17:55
Exec Total Coverage
Lines: 369 431 85.6%
Functions: 6 6 100.0%
Branches: 430 596 72.1%

Line Branch Exec Source
1 #include <config/CommandDispatcherImplCfg.hpp>
2 #include <new>
3 #include "Fw/Com/ComPacket.hpp"
4 #include "Fw/Time/Time.hpp"
5 #include "Svc/FpySequencer/FpySequencer.hpp"
6
7 namespace Svc {
8
9 // returns the index of the current statement
10 39 U32 FpySequencer::currentStatementIdx() {
11
2/2
✓ Branch 4 taken 35 times.
✓ Branch 5 taken 4 times.
39 if (this->m_runtime.nextStatementIndex == 0) {
12 // haven't started executing the sequence yet
13 35 return 0;
14 }
15 4 return this->m_runtime.nextStatementIndex - 1;
16 }
17
18 2224 Signal FpySequencer::dispatchStatement() {
19 // check to make sure no array out of bounds, or if it is out of bounds it's only 1 out of bound
20 // as that indicates eof
21 2224 FW_ASSERT(this->m_runtime.nextStatementIndex <= this->m_sequenceObj.get_header().get_statementCount());
22
23
2/2
✓ Branch 14 taken 38 times.
✓ Branch 15 taken 2186 times.
2224 if (this->m_runtime.nextStatementIndex == this->m_sequenceObj.get_header().get_statementCount()) {
24 38 return Signal::result_dispatchStatement_noMoreStatements;
25 }
26
27 2186 const Fpy::Statement& nextStatement = this->m_sequenceObj.get_statements()[this->m_runtime.nextStatementIndex];
28 2186 this->m_runtime.nextStatementIndex++;
29 2186 this->m_runtime.currentStatementOpcode = nextStatement.get_opCode();
30 2186 this->m_runtime.currentCmdOpcode = 0; // we haven't deserialized the directive yet, so we don't know if it's a cmd
31
32
1/1
✓ Branch 2 taken 2186 times.
2186 Fw::Success result;
33 2186 DirectiveUnion directiveUnion;
34
35
2/2
✓ Branch 2 taken 2186 times.
✓ Branch 7 taken 2186 times.
2186 result = this->deserializeDirective(nextStatement, directiveUnion);
36
37
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 2186 times.
2186 if (!result) {
38 return Signal::result_dispatchStatement_failure;
39 }
40
41
2/2
✓ Branch 4 taken 5 times.
✓ Branch 5 taken 2181 times.
2186 if (this->m_runtime.currentStatementOpcode == Fpy::DirectiveId::CONST_CMD) {
42 // update the opcode of the cmd we will await
43 5 this->m_runtime.currentCmdOpcode = directiveUnion.constCmd.get_opCode();
44 }
45
46
1/1
✓ Branch 4 taken 2186 times.
4372 this->dispatchDirective(directiveUnion,
47
1/1
✓ Branch 6 taken 2186 times.
4372 Fpy::DirectiveId(static_cast<Fpy::DirectiveId::T>(nextStatement.get_opCode())));
48 2186 this->m_runtime.currentStatementDispatchTime =
49
2/2
✓ Branch 3 taken 2186 times.
✓ Branch 10 taken 2186 times.
4372 getTime(); // set dispatch time right after we have successfully dispatched
50
51 2186 this->m_statementsDispatched++;
52
53 2186 return Signal::result_dispatchStatement_success;
54 2186 }
55
56 // deserializes a directive from bytes into the Fpy type
57 // returns success if able to deserialize, and returns the Fpy type object
58 // as a reference, in a union of all the possible directive type objects
59 2246 Fw::Success FpySequencer::deserializeDirective(const Fpy::Statement& stmt, DirectiveUnion& deserializedDirective) {
60 Fw::SerializeStatus status;
61 // make our own esb so we can deser from stmt without breaking its constness
62
2/2
✓ Branch 13 taken 2246 times.
✓ Branch 25 taken 2246 times.
2246 Fw::ExternalSerializeBuffer argBuf(const_cast<U8*>(stmt.get_argBuf().getBuffAddr()), stmt.get_argBuf().getSize());
63
2/2
✓ Branch 13 taken 2246 times.
✓ Branch 16 taken 2246 times.
2246 status = argBuf.setBuffLen(stmt.get_argBuf().getSize());
64 2246 FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
65
66
31/33
✓ Branch 4 taken 6 times.
✓ Branch 5 taken 4 times.
✓ Branch 6 taken 5 times.
✓ Branch 7 taken 10 times.
✓ Branch 8 taken 2059 times.
✓ Branch 9 taken 9 times.
✓ Branch 10 taken 4 times.
✓ Branch 11 taken 4 times.
✓ Branch 12 taken 5 times.
✓ Branch 13 taken 8 times.
✓ Branch 14 taken 10 times.
✓ Branch 15 taken 5 times.
✓ Branch 16 taken 1 times.
✓ Branch 17 taken 9 times.
✓ Branch 18 taken 45 times.
✓ Branch 19 taken 21 times.
✓ Branch 20 taken 4 times.
✓ Branch 21 taken 4 times.
✓ Branch 22 taken 1 times.
✓ Branch 23 taken 4 times.
✓ Branch 24 taken 5 times.
✓ Branch 25 taken 4 times.
✓ Branch 26 taken 4 times.
✓ Branch 27 taken 4 times.
✓ Branch 28 taken 1 times.
✓ Branch 29 taken 1 times.
✓ Branch 30 taken 1 times.
✓ Branch 31 taken 1 times.
✓ Branch 32 taken 1 times.
✓ Branch 33 taken 3 times.
✓ Branch 34 taken 3 times.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
2246 switch (stmt.get_opCode()) {
67 6 case Fpy::DirectiveId::WAIT_REL: {
68 // in order to use a type with non trivial ctor in cpp union, have to manually construct and destruct it
69
1/3
✓ Branch 3 taken 6 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
6 new (&deserializedDirective.waitRel) FpySequencer_WaitRelDirective();
70 // wait rel does not need deser
71
3/3
✓ Branch 2 taken 6 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 5 times.
6 if (argBuf.getDeserializeSizeLeft() != 0) {
72
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
73 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
74 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
75
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
76 }
77
1/1
✓ Branch 1 taken 5 times.
5 return Fw::Success::SUCCESS;
78 }
79 4 case Fpy::DirectiveId::WAIT_ABS: {
80
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.waitAbs) FpySequencer_WaitAbsDirective();
81 // wait abs does not need deser
82
3/3
✓ Branch 2 taken 4 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 3 times.
4 if (argBuf.getDeserializeSizeLeft() != 0) {
83
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
84 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
85 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
86
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
87 }
88
1/1
✓ Branch 1 taken 3 times.
3 return Fw::Success::SUCCESS;
89 }
90 5 case Fpy::DirectiveId::GOTO: {
91
1/3
✓ Branch 3 taken 5 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
5 new (&deserializedDirective.gotoDirective) FpySequencer_GotoDirective();
92
1/1
✓ Branch 4 taken 5 times.
5 status = argBuf.deserializeTo(deserializedDirective.gotoDirective);
93
7/7
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 3 times.
5 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
94
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
95 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
96
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
97 }
98
1/1
✓ Branch 1 taken 3 times.
3 return Fw::Success::SUCCESS;
99 }
100 10 case Fpy::DirectiveId::IF: {
101
1/3
✓ Branch 3 taken 10 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
10 new (&deserializedDirective.ifDirective) FpySequencer_IfDirective();
102
1/1
✓ Branch 4 taken 10 times.
10 status = argBuf.deserializeTo(deserializedDirective.ifDirective);
103
7/7
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 9 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 8 times.
10 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
104
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
105 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
106
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
107 }
108
1/1
✓ Branch 1 taken 8 times.
8 return Fw::Success::SUCCESS;
109 }
110 2059 case Fpy::DirectiveId::NO_OP: {
111
1/3
✓ Branch 3 taken 2059 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
2059 new (&deserializedDirective.noOp) FpySequencer_NoOpDirective();
112 // no op does not need deser
113
3/3
✓ Branch 2 taken 2059 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 2058 times.
2059 if (argBuf.getDeserializeSizeLeft() != 0) {
114
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
115 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
116 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
117
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
118 }
119
1/1
✓ Branch 1 taken 2058 times.
2058 return Fw::Success::SUCCESS;
120 }
121 9 case Fpy::DirectiveId::PUSH_TLM_VAL: {
122
1/3
✓ Branch 3 taken 9 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
9 new (&deserializedDirective.pushTlmVal) FpySequencer_PushTlmValDirective();
123
1/1
✓ Branch 4 taken 9 times.
9 status = argBuf.deserializeTo(deserializedDirective.pushTlmVal);
124
7/7
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 8 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 7 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 7 times.
9 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
125
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
126 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
127
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
128 }
129
1/1
✓ Branch 1 taken 7 times.
7 return Fw::Success::SUCCESS;
130 }
131 4 case Fpy::DirectiveId::PUSH_TLM_VAL_AND_TIME: {
132
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.pushTlmValAndTime) FpySequencer_PushTlmValAndTimeDirective();
133
1/1
✓ Branch 4 taken 4 times.
4 status = argBuf.deserializeTo(deserializedDirective.pushTlmValAndTime);
134
7/7
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 2 times.
4 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
135
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
136 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
137
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
138 }
139
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::SUCCESS;
140 }
141 4 case Fpy::DirectiveId::PUSH_PRM: {
142
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.pushPrm) FpySequencer_PushPrmDirective();
143
1/1
✓ Branch 4 taken 4 times.
4 status = argBuf.deserializeTo(deserializedDirective.pushPrm);
144
7/7
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 2 times.
4 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
145
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
146 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
147
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
148 }
149
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::SUCCESS;
150 }
151 5 case Fpy::DirectiveId::CONST_CMD: {
152
1/3
✓ Branch 3 taken 5 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
5 new (&deserializedDirective.constCmd) FpySequencer_ConstCmdDirective();
153
154 // first deserialize the opcode
155 5 FwOpcodeType opcode;
156
1/1
✓ Branch 2 taken 5 times.
5 status = argBuf.deserializeTo(opcode);
157
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
5 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK) {
158 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
159 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
160 return Fw::Success::FAILURE;
161 }
162
163
1/1
✓ Branch 5 taken 5 times.
5 deserializedDirective.constCmd.set_opCode(opcode);
164 // how many bytes are left?
165
1/1
✓ Branch 3 taken 5 times.
5 FwSizeType cmdArgBufSize = argBuf.getDeserializeSizeLeft();
166
167 // check to make sure the value will fit in the FpySequencer_ConstCmdDirective::argBuf
168
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
5 if (cmdArgBufSize > Fpy::MAX_DIRECTIVE_SIZE) {
169 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
170 Fw::SerializeStatus::FW_DESERIALIZE_FORMAT_ERROR,
171 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
172 return Fw::Success::FAILURE;
173 }
174
175 // okay, it will fit. put it in
176
1/1
✓ Branch 7 taken 5 times.
5 status = argBuf.deserializeTo(deserializedDirective.constCmd.get_argBuf(), cmdArgBufSize,
177 Fw::Serialization::OMIT_LENGTH);
178
179
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
5 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK) {
180 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
181 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
182 return Fw::Success::FAILURE;
183 }
184
185 // now there should be nothing left, otherwise coding err
186 5 FW_ASSERT(argBuf.getDeserializeSizeLeft() == 0,
187 static_cast<FwAssertArgType>(argBuf.getDeserializeSizeLeft()));
188
189 // and set the buf size now that we know it
190
1/1
✓ Branch 5 taken 5 times.
5 deserializedDirective.constCmd.set__argBufSize(cmdArgBufSize);
191
1/1
✓ Branch 1 taken 5 times.
5 return Fw::Success::SUCCESS;
192 }
193 // fallthrough on purpose
194 8 case Fpy::DirectiveId::OR:
195 case Fpy::DirectiveId::AND:
196 case Fpy::DirectiveId::IEQ:
197 case Fpy::DirectiveId::INE:
198 case Fpy::DirectiveId::UGT:
199 case Fpy::DirectiveId::ULT:
200 case Fpy::DirectiveId::ULE:
201 case Fpy::DirectiveId::UGE:
202 case Fpy::DirectiveId::SGT:
203 case Fpy::DirectiveId::SLT:
204 case Fpy::DirectiveId::SLE:
205 case Fpy::DirectiveId::SGE:
206 case Fpy::DirectiveId::FEQ:
207 case Fpy::DirectiveId::FNE:
208 case Fpy::DirectiveId::FLT:
209 case Fpy::DirectiveId::FLE:
210 case Fpy::DirectiveId::FGT:
211 case Fpy::DirectiveId::FGE:
212 case Fpy::DirectiveId::NOT:
213 case Fpy::DirectiveId::FPEXT:
214 case Fpy::DirectiveId::FPTRUNC:
215 case Fpy::DirectiveId::FPTOSI:
216 case Fpy::DirectiveId::FPTOUI:
217 case Fpy::DirectiveId::SITOFP:
218 case Fpy::DirectiveId::UITOFP:
219 case Fpy::DirectiveId::ADD:
220 case Fpy::DirectiveId::SUB:
221 case Fpy::DirectiveId::MUL:
222 case Fpy::DirectiveId::UDIV:
223 case Fpy::DirectiveId::SDIV:
224 case Fpy::DirectiveId::UMOD:
225 case Fpy::DirectiveId::SMOD:
226 case Fpy::DirectiveId::FADD:
227 case Fpy::DirectiveId::FSUB:
228 case Fpy::DirectiveId::FMUL:
229 case Fpy::DirectiveId::FDIV:
230 case Fpy::DirectiveId::FPOW:
231 case Fpy::DirectiveId::FLOG:
232 case Fpy::DirectiveId::FMOD:
233 case Fpy::DirectiveId::SIEXT_8_64:
234 case Fpy::DirectiveId::SIEXT_16_64:
235 case Fpy::DirectiveId::SIEXT_32_64:
236 case Fpy::DirectiveId::ZIEXT_8_64:
237 case Fpy::DirectiveId::ZIEXT_16_64:
238 case Fpy::DirectiveId::ZIEXT_32_64:
239 case Fpy::DirectiveId::ITRUNC_64_8:
240 case Fpy::DirectiveId::ITRUNC_64_16:
241 case Fpy::DirectiveId::ITRUNC_64_32:
242 case Fpy::DirectiveId::FFLOOR:
243 case Fpy::DirectiveId::IABS:
244 case Fpy::DirectiveId::FABS: {
245
1/3
✓ Branch 3 taken 8 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
8 new (&deserializedDirective.stackOp) FpySequencer_StackOpDirective();
246
3/3
✓ Branch 2 taken 8 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 7 times.
8 if (argBuf.getDeserializeSizeLeft() != 0) {
247
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
248 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
249 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
250
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
251 }
252
1/1
✓ Branch 9 taken 7 times.
7 deserializedDirective.stackOp.set__op(stmt.get_opCode());
253
1/1
✓ Branch 1 taken 7 times.
7 return Fw::Success::SUCCESS;
254 }
255 10 case Fpy::DirectiveId::EXIT: {
256
1/3
✓ Branch 3 taken 10 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
10 new (&deserializedDirective.exit) FpySequencer_ExitDirective();
257
3/3
✓ Branch 2 taken 10 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 9 times.
10 if (argBuf.getDeserializeSizeLeft() != 0) {
258
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
259 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
260 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
261
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
262 }
263
1/1
✓ Branch 1 taken 9 times.
9 return Fw::Success::SUCCESS;
264 }
265 5 case Fpy::DirectiveId::ALLOCATE: {
266
1/3
✓ Branch 3 taken 5 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
5 new (&deserializedDirective.allocate) FpySequencer_AllocateDirective();
267
1/1
✓ Branch 4 taken 5 times.
5 status = argBuf.deserializeTo(deserializedDirective.allocate);
268
4/7
✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 5 times.
5 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
269 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
270 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
271 return Fw::Success::FAILURE;
272 }
273
1/1
✓ Branch 1 taken 5 times.
5 return Fw::Success::SUCCESS;
274 }
275 1 case Fpy::DirectiveId::STORE_REL_CONST_OFFSET: {
276
1/3
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 new (&deserializedDirective.storeRelConstOffset) FpySequencer_StoreRelConstOffsetDirective();
277
1/1
✓ Branch 4 taken 1 times.
1 status = argBuf.deserializeTo(deserializedDirective.storeRelConstOffset);
278
4/7
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
279 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
280 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
281 return Fw::Success::FAILURE;
282 }
283
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::SUCCESS;
284 }
285 9 case Fpy::DirectiveId::LOAD_REL: {
286
1/3
✓ Branch 3 taken 9 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
9 new (&deserializedDirective.loadRel) FpySequencer_LoadRelDirective();
287
1/1
✓ Branch 4 taken 9 times.
9 status = argBuf.deserializeTo(deserializedDirective.loadRel);
288
4/7
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 9 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 9 times.
9 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
289 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
290 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
291 return Fw::Success::FAILURE;
292 }
293
1/1
✓ Branch 1 taken 9 times.
9 return Fw::Success::SUCCESS;
294 }
295 45 case Fpy::DirectiveId::PUSH_VAL: {
296
1/3
✓ Branch 3 taken 45 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
45 new (&deserializedDirective.pushVal) FpySequencer_PushValDirective();
297
298 // how many bytes are left?
299
1/1
✓ Branch 3 taken 45 times.
45 FwSizeType bufSize = argBuf.getDeserializeSizeLeft();
300
301 // check to make sure the value will fit in the FpySequencer_PushValDirective::val buf
302
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 45 times.
45 if (bufSize > Fpy::MAX_DIRECTIVE_SIZE) {
303 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
304 Fw::SerializeStatus::FW_DESERIALIZE_FORMAT_ERROR,
305 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
306 return Fw::Success::FAILURE;
307 }
308
309 // okay, it will fit. put it in
310 status =
311
1/1
✓ Branch 7 taken 45 times.
45 argBuf.deserializeTo(deserializedDirective.pushVal.get_val(), bufSize, Fw::Serialization::OMIT_LENGTH);
312
313
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 45 times.
45 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK) {
314 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
315 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
316 return Fw::Success::FAILURE;
317 }
318
319 // now there should be nothing left, otherwise coding err
320 45 FW_ASSERT(argBuf.getDeserializeSizeLeft() == 0,
321 static_cast<FwAssertArgType>(argBuf.getDeserializeSizeLeft()));
322
323 // and set the buf size now that we know it
324
1/1
✓ Branch 5 taken 45 times.
45 deserializedDirective.pushVal.set__valSize(bufSize);
325
1/1
✓ Branch 1 taken 45 times.
45 return Fw::Success::SUCCESS;
326 }
327 21 case Fpy::DirectiveId::DISCARD: {
328
1/3
✓ Branch 3 taken 21 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
21 new (&deserializedDirective.discard) FpySequencer_DiscardDirective();
329
1/1
✓ Branch 4 taken 21 times.
21 status = argBuf.deserializeTo(deserializedDirective.discard);
330
7/7
✓ Branch 0 taken 20 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 20 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 19 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 19 times.
21 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
331
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
332 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
333
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
334 }
335
1/1
✓ Branch 1 taken 19 times.
19 return Fw::Success::SUCCESS;
336 }
337 4 case Fpy::DirectiveId::MEMCMP: {
338
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.memCmp) FpySequencer_MemCmpDirective();
339
1/1
✓ Branch 4 taken 4 times.
4 status = argBuf.deserializeTo(deserializedDirective.memCmp);
340
7/7
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 2 times.
4 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
341
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
342 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
343
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
344 }
345
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::SUCCESS;
346 }
347 4 case Fpy::DirectiveId::STACK_CMD: {
348
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.stackCmd) FpySequencer_StackCmdDirective();
349
1/1
✓ Branch 4 taken 4 times.
4 status = argBuf.deserializeTo(deserializedDirective.stackCmd);
350
7/7
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 2 times.
4 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
351
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
352 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
353
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
354 }
355
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::SUCCESS;
356 }
357 1 case Fpy::DirectiveId::PUSH_TIME: {
358
1/3
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 new (&deserializedDirective.pushTime) FpySequencer_PushTimeDirective();
359
2/3
✓ Branch 2 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
1 if (argBuf.getDeserializeSizeLeft() != 0) {
360 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
361 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
362 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
363 return Fw::Success::FAILURE;
364 }
365
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::SUCCESS;
366 }
367 4 case Fpy::DirectiveId::SET_SEED: {
368
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.setSeed) FpySequencer_SetSeedDirective();
369
3/3
✓ Branch 2 taken 4 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 3 times.
4 if (argBuf.getDeserializeSizeLeft() != 0) {
370
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
371 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
372 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
373
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
374 }
375
1/1
✓ Branch 1 taken 3 times.
3 return Fw::Success::SUCCESS;
376 }
377 5 case Fpy::DirectiveId::PUSH_RAND: {
378
1/3
✓ Branch 3 taken 5 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
5 new (&deserializedDirective.pushRand) FpySequencer_PushRandDirective();
379
3/3
✓ Branch 2 taken 5 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 4 times.
5 if (argBuf.getDeserializeSizeLeft() != 0) {
380
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
381 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
382 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
383
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
384 }
385
1/1
✓ Branch 1 taken 4 times.
4 return Fw::Success::SUCCESS;
386 }
387 4 case Fpy::DirectiveId::GET_FIELD: {
388
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.getField) FpySequencer_GetFieldDirective();
389
1/1
✓ Branch 4 taken 4 times.
4 status = argBuf.deserializeTo(deserializedDirective.getField);
390
7/7
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 2 times.
4 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
391
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
392 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
393
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
394 }
395
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::SUCCESS;
396 }
397 4 case Fpy::DirectiveId::PEEK: {
398
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.peek) FpySequencer_PeekDirective();
399
3/3
✓ Branch 2 taken 4 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 3 times.
4 if (argBuf.getDeserializeSizeLeft() != 0) {
400
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
401 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
402 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
403
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
404 }
405
1/1
✓ Branch 1 taken 3 times.
3 return Fw::Success::SUCCESS;
406 }
407 4 case Fpy::DirectiveId::STORE_REL: {
408
1/3
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
4 new (&deserializedDirective.storeRel) FpySequencer_StoreRelDirective();
409
1/1
✓ Branch 4 taken 4 times.
4 status = argBuf.deserializeTo(deserializedDirective.storeRel);
410
7/7
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 2 times.
4 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
411
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
412 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
413
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
414 }
415
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::SUCCESS;
416 }
417 1 case Fpy::DirectiveId::CALL: {
418
1/3
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 new (&deserializedDirective.call) FpySequencer_CallDirective();
419
2/3
✓ Branch 2 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
1 if (argBuf.getDeserializeSizeLeft() != 0) {
420 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
421 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
422 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
423 return Fw::Success::FAILURE;
424 }
425
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::SUCCESS;
426 }
427 1 case Fpy::DirectiveId::RETURN: {
428
1/3
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 new (&deserializedDirective.returnDirective) FpySequencer_ReturnDirective();
429
1/1
✓ Branch 4 taken 1 times.
1 status = argBuf.deserializeTo(deserializedDirective.returnDirective);
430
4/7
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
431 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
432 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
433 return Fw::Success::FAILURE;
434 }
435
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::SUCCESS;
436 }
437 1 case Fpy::DirectiveId::LOAD_ABS: {
438
1/3
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 new (&deserializedDirective.loadAbs) FpySequencer_LoadAbsDirective();
439
1/1
✓ Branch 4 taken 1 times.
1 status = argBuf.deserializeTo(deserializedDirective.loadAbs);
440
4/7
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
441 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
442 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
443 return Fw::Success::FAILURE;
444 }
445
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::SUCCESS;
446 }
447 1 case Fpy::DirectiveId::STORE_ABS: {
448
1/3
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 new (&deserializedDirective.storeAbs) FpySequencer_StoreAbsDirective();
449
1/1
✓ Branch 4 taken 1 times.
1 status = argBuf.deserializeTo(deserializedDirective.storeAbs);
450
4/7
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
451 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
452 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
453 return Fw::Success::FAILURE;
454 }
455
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::SUCCESS;
456 }
457 1 case Fpy::DirectiveId::STORE_ABS_CONST_OFFSET: {
458
1/3
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
1 new (&deserializedDirective.storeAbsConstOffset) FpySequencer_StoreAbsConstOffsetDirective();
459
1/1
✓ Branch 4 taken 1 times.
1 status = argBuf.deserializeTo(deserializedDirective.storeAbsConstOffset);
460
4/7
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
461 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
462 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
463 return Fw::Success::FAILURE;
464 }
465
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::SUCCESS;
466 }
467 3 case Fpy::DirectiveId::POP_EVENT: {
468
1/3
✓ Branch 3 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
3 new (&deserializedDirective.popEvent) FpySequencer_PopEventDirective();
469 // pop event has no hardcoded args
470
3/3
✓ Branch 2 taken 3 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 2 times.
3 if (argBuf.getDeserializeSizeLeft() != 0) {
471
3/3
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 19 taken 1 times.
3 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(),
472 Fw::SerializeStatus::FW_DESERIALIZE_SIZE_MISMATCH,
473 2 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
474
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::FAILURE;
475 }
476
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::SUCCESS;
477 }
478 3 case Fpy::DirectiveId::POP_SERIALIZABLE: {
479
1/3
✓ Branch 3 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
3 new (&deserializedDirective.popSerializable) FpySequencer_PopSerializableDirective();
480
1/1
✓ Branch 4 taken 3 times.
3 status = argBuf.deserializeTo(deserializedDirective.popSerializable);
481
7/7
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 1 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 1 times.
3 if (status != Fw::SerializeStatus::FW_SERIALIZE_OK || argBuf.getDeserializeSizeLeft() != 0) {
482
3/3
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✓ Branch 19 taken 2 times.
6 this->log_WARNING_HI_DirectiveDeserializeError(stmt.get_opCode(), this->currentStatementIdx(), status,
483 4 argBuf.getDeserializeSizeLeft(), argBuf.getSize());
484
1/1
✓ Branch 1 taken 2 times.
2 return Fw::Success::FAILURE;
485 }
486
1/1
✓ Branch 1 taken 1 times.
1 return Fw::Success::SUCCESS;
487 }
488 case Fpy::DirectiveId::INVALID: {
489 // unsure what this opcode is. check compiler version matches sequencer
490 break;
491 }
492 // ommited default case to throw compile error on unhandled directives.
493 }
494 this->log_WARNING_HI_UnknownSequencerDirective(stmt.get_opCode(), this->currentStatementIdx(),
495 this->m_sequenceFilePath);
496 return Fw::Success::FAILURE;
497 2246 }
498
499 // dispatches a deserialized sequencer directive to the right handler.
500 2186 void FpySequencer::dispatchDirective(const DirectiveUnion& directive, const Fpy::DirectiveId& id) {
501
29/33
✗ Branch 4 not taken.
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 7 times.
✓ Branch 9 taken 2056 times.
✓ Branch 10 taken 6 times.
✓ Branch 11 taken 1 times.
✓ Branch 12 taken 1 times.
✓ Branch 13 taken 5 times.
✓ Branch 14 taken 5 times.
✓ Branch 15 taken 7 times.
✓ Branch 16 taken 5 times.
✓ Branch 17 taken 1 times.
✓ Branch 18 taken 9 times.
✓ Branch 19 taken 45 times.
✓ Branch 20 taken 18 times.
✓ Branch 21 taken 1 times.
✓ Branch 22 taken 1 times.
✓ Branch 23 taken 1 times.
✓ Branch 24 taken 1 times.
✓ Branch 25 taken 2 times.
✓ Branch 26 taken 1 times.
✓ Branch 27 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 29 taken 1 times.
✓ Branch 30 taken 1 times.
✓ Branch 31 taken 1 times.
✓ Branch 32 taken 1 times.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
2186 switch (id) {
502 case Fpy::DirectiveId::INVALID: {
503 // coding err
504 FW_ASSERT(false);
505 return;
506 }
507 3 case Fpy::DirectiveId::WAIT_REL: {
508 3 this->directive_waitRel_internalInterfaceInvoke(directive.waitRel);
509 3 return;
510 }
511 1 case Fpy::DirectiveId::WAIT_ABS: {
512 1 this->directive_waitAbs_internalInterfaceInvoke(directive.waitAbs);
513 1 return;
514 }
515 2 case Fpy::DirectiveId::GOTO: {
516 2 this->directive_goto_internalInterfaceInvoke(directive.gotoDirective);
517 2 return;
518 }
519 7 case Fpy::DirectiveId::IF: {
520 7 this->directive_if_internalInterfaceInvoke(directive.ifDirective);
521 7 return;
522 }
523 2056 case Fpy::DirectiveId::NO_OP: {
524 2056 this->directive_noOp_internalInterfaceInvoke(directive.noOp);
525 2056 return;
526 }
527 6 case Fpy::DirectiveId::PUSH_TLM_VAL: {
528 6 this->directive_pushTlmVal_internalInterfaceInvoke(directive.pushTlmVal);
529 6 return;
530 }
531 1 case Fpy::DirectiveId::PUSH_TLM_VAL_AND_TIME: {
532 1 this->directive_pushTlmValAndTime_internalInterfaceInvoke(directive.pushTlmValAndTime);
533 1 return;
534 }
535 1 case Fpy::DirectiveId::PUSH_PRM: {
536 1 this->directive_pushPrm_internalInterfaceInvoke(directive.pushPrm);
537 1 return;
538 }
539 5 case Fpy::DirectiveId::CONST_CMD: {
540 5 this->directive_constCmd_internalInterfaceInvoke(directive.constCmd);
541 5 return;
542 }
543 // fallthrough on purpose
544 5 case Fpy::DirectiveId::OR:
545 case Fpy::DirectiveId::AND:
546 case Fpy::DirectiveId::IEQ:
547 case Fpy::DirectiveId::INE:
548 case Fpy::DirectiveId::UGT:
549 case Fpy::DirectiveId::ULT:
550 case Fpy::DirectiveId::ULE:
551 case Fpy::DirectiveId::UGE:
552 case Fpy::DirectiveId::SGT:
553 case Fpy::DirectiveId::SLT:
554 case Fpy::DirectiveId::SLE:
555 case Fpy::DirectiveId::SGE:
556 case Fpy::DirectiveId::FEQ:
557 case Fpy::DirectiveId::FNE:
558 case Fpy::DirectiveId::FLT:
559 case Fpy::DirectiveId::FLE:
560 case Fpy::DirectiveId::FGT:
561 case Fpy::DirectiveId::FGE:
562 case Fpy::DirectiveId::NOT:
563 case Fpy::DirectiveId::FPEXT:
564 case Fpy::DirectiveId::FPTRUNC:
565 case Fpy::DirectiveId::FPTOSI:
566 case Fpy::DirectiveId::FPTOUI:
567 case Fpy::DirectiveId::SITOFP:
568 case Fpy::DirectiveId::UITOFP:
569 case Fpy::DirectiveId::ADD:
570 case Fpy::DirectiveId::SUB:
571 case Fpy::DirectiveId::MUL:
572 case Fpy::DirectiveId::UDIV:
573 case Fpy::DirectiveId::SDIV:
574 case Fpy::DirectiveId::UMOD:
575 case Fpy::DirectiveId::SMOD:
576 case Fpy::DirectiveId::FADD:
577 case Fpy::DirectiveId::FSUB:
578 case Fpy::DirectiveId::FMUL:
579 case Fpy::DirectiveId::FDIV:
580 case Fpy::DirectiveId::FPOW:
581 case Fpy::DirectiveId::FLOG:
582 case Fpy::DirectiveId::FMOD:
583 case Fpy::DirectiveId::SIEXT_8_64:
584 case Fpy::DirectiveId::SIEXT_16_64:
585 case Fpy::DirectiveId::SIEXT_32_64:
586 case Fpy::DirectiveId::ZIEXT_8_64:
587 case Fpy::DirectiveId::ZIEXT_16_64:
588 case Fpy::DirectiveId::ZIEXT_32_64:
589 case Fpy::DirectiveId::ITRUNC_64_8:
590 case Fpy::DirectiveId::ITRUNC_64_16:
591 case Fpy::DirectiveId::ITRUNC_64_32:
592 case Fpy::DirectiveId::FFLOOR:
593 case Fpy::DirectiveId::IABS:
594 case Fpy::DirectiveId::FABS: {
595 5 this->directive_stackOp_internalInterfaceInvoke(directive.stackOp);
596 5 return;
597 }
598 7 case Fpy::DirectiveId::EXIT: {
599 7 this->directive_exit_internalInterfaceInvoke(directive.exit);
600 7 return;
601 }
602 5 case Fpy::DirectiveId::ALLOCATE: {
603 5 this->directive_allocate_internalInterfaceInvoke(directive.allocate);
604 5 return;
605 }
606 1 case Fpy::DirectiveId::STORE_REL_CONST_OFFSET: {
607 1 this->directive_storeRelConstOffset_internalInterfaceInvoke(directive.storeRelConstOffset);
608 1 return;
609 }
610 9 case Fpy::DirectiveId::LOAD_REL: {
611 9 this->directive_loadRel_internalInterfaceInvoke(directive.loadRel);
612 9 return;
613 }
614 45 case Fpy::DirectiveId::PUSH_VAL: {
615 45 this->directive_pushVal_internalInterfaceInvoke(directive.pushVal);
616 45 return;
617 }
618 18 case Fpy::DirectiveId::DISCARD: {
619 18 this->directive_discard_internalInterfaceInvoke(directive.discard);
620 18 return;
621 }
622 1 case Fpy::DirectiveId::MEMCMP: {
623 1 this->directive_memCmp_internalInterfaceInvoke(directive.memCmp);
624 1 return;
625 }
626 1 case Fpy::DirectiveId::STACK_CMD: {
627 1 this->directive_stackCmd_internalInterfaceInvoke(directive.stackCmd);
628 1 return;
629 }
630 1 case Fpy::DirectiveId::PUSH_TIME: {
631 1 this->directive_pushTime_internalInterfaceInvoke(directive.pushTime);
632 1 return;
633 }
634 1 case Fpy::DirectiveId::SET_SEED: {
635 1 this->directive_setSeed_internalInterfaceInvoke(directive.setSeed);
636 1 return;
637 }
638 2 case Fpy::DirectiveId::PUSH_RAND: {
639 2 this->directive_pushRand_internalInterfaceInvoke(directive.pushRand);
640 2 return;
641 }
642 1 case Fpy::DirectiveId::GET_FIELD: {
643 1 this->directive_getField_internalInterfaceInvoke(directive.getField);
644 1 return;
645 }
646 1 case Fpy::DirectiveId::PEEK: {
647 1 this->directive_peek_internalInterfaceInvoke(directive.peek);
648 1 return;
649 }
650 1 case Fpy::DirectiveId::STORE_REL: {
651 1 this->directive_storeRel_internalInterfaceInvoke(directive.storeRel);
652 1 return;
653 }
654 1 case Fpy::DirectiveId::CALL: {
655 1 this->directive_call_internalInterfaceInvoke(directive.call);
656 1 return;
657 }
658 1 case Fpy::DirectiveId::RETURN: {
659 1 this->directive_return_internalInterfaceInvoke(directive.returnDirective);
660 1 return;
661 }
662 1 case Fpy::DirectiveId::LOAD_ABS: {
663 1 this->directive_loadAbs_internalInterfaceInvoke(directive.loadAbs);
664 1 return;
665 }
666 1 case Fpy::DirectiveId::STORE_ABS: {
667 1 this->directive_storeAbs_internalInterfaceInvoke(directive.storeAbs);
668 1 return;
669 }
670 1 case Fpy::DirectiveId::STORE_ABS_CONST_OFFSET: {
671 1 this->directive_storeAbsConstOffset_internalInterfaceInvoke(directive.storeAbsConstOffset);
672 1 return;
673 }
674 case Fpy::DirectiveId::POP_EVENT: {
675 this->directive_popEvent_internalInterfaceInvoke(directive.popEvent);
676 return;
677 }
678 case Fpy::DirectiveId::POP_SERIALIZABLE: {
679 this->directive_popSerializable_internalInterfaceInvoke(directive.popSerializable);
680 return;
681 }
682 }
683 // coding err
684 FW_ASSERT(false, static_cast<FwAssertArgType>(id));
685 }
686
687 8 Signal FpySequencer::checkShouldWake() {
688
1/1
✓ Branch 3 taken 8 times.
8 Fw::Time currentTime = this->getTime();
689
690
4/4
✓ Branch 4 taken 8 times.
✓ Branch 12 taken 8 times.
✓ Branch 24 taken 1 times.
✓ Branch 25 taken 7 times.
8 if (currentTime.getTimeBase() != this->m_runtime.wakeupTime.getTimeBase()) {
691 // cannot compare these times.
692
3/3
✓ Branch 8 taken 1 times.
✓ Branch 16 taken 1 times.
✓ Branch 23 taken 1 times.
1 this->log_WARNING_HI_MismatchedTimeBase(currentTime.getTimeBase(), this->m_runtime.wakeupTime.getTimeBase());
693
694 1 return Signal::result_timeOpFailed;
695 }
696
697 // Do not compare time context
698
699
3/3
✓ Branch 5 taken 7 times.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 4 times.
7 if (currentTime < this->m_runtime.wakeupTime) {
700 // not time to wake up!
701 3 return Signal::result_checkShouldWake_keepSleeping;
702 }
703
704 // say we've finished our sleep
705 4 return Signal::result_checkShouldWake_wakeup;
706 8 }
707
708 // checks whether the currently executing statement timed out
709 12 Signal FpySequencer::checkStatementTimeout() {
710
1/1
✓ Branch 2 taken 12 times.
12 Fw::ParamValid valid;
711
1/1
✓ Branch 5 taken 12 times.
12 F32 timeout = this->paramGet_STATEMENT_TIMEOUT_SECS(valid);
712
5/6
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 9 times.
12 if (timeout <= 0 || timeout > static_cast<F32>(std::numeric_limits<U32>::max())) {
713 // no timeout
714 3 return Signal::result_checkStatementTimeout_noTimeout;
715 }
716
717
1/1
✓ Branch 3 taken 9 times.
9 Fw::Time currentTime = getTime();
718
719
4/4
✓ Branch 4 taken 9 times.
✓ Branch 12 taken 9 times.
✓ Branch 24 taken 1 times.
✓ Branch 25 taken 8 times.
9 if (currentTime.getTimeBase() != this->m_runtime.currentStatementDispatchTime.getTimeBase()) {
720 // can't compare time base. must have changed
721
2/2
✓ Branch 10 taken 1 times.
✓ Branch 17 taken 1 times.
2 this->log_WARNING_HI_MismatchedTimeBase(currentTime.getTimeBase(),
722
1/1
✓ Branch 3 taken 1 times.
2 this->m_runtime.currentStatementDispatchTime.getTimeBase());
723 1 return Signal::result_timeOpFailed;
724 }
725
726 // Do not compare time context
727
728
3/4
✓ Branch 6 taken 8 times.
✓ Branch 10 taken 8 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 8 times.
8 if (this->m_runtime.currentStatementDispatchTime.getSeconds() > currentTime.getSeconds()) {
729 // somehow we've gone back in time... just ignore it and move on. should get fixed
730 // if we wait I guess
731 return Signal::result_checkStatementTimeout_noTimeout;
732 }
733
734
4/6
✓ Branch 6 taken 8 times.
✓ Branch 10 taken 8 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 8 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 8 times.
8 if (this->m_runtime.currentStatementDispatchTime.getSeconds() == currentTime.getSeconds() &&
735 this->m_runtime.currentStatementDispatchTime.getUSeconds() > currentTime.getUSeconds()) {
736 // same as above
737 return Signal::result_checkStatementTimeout_noTimeout;
738 }
739
740
2/2
✓ Branch 2 taken 8 times.
✓ Branch 6 taken 8 times.
8 U64 currentUSeconds = static_cast<U64>(currentTime.getSeconds()) * 1000000 + currentTime.getUSeconds();
741
1/1
✓ Branch 6 taken 8 times.
8 U64 dispatchUSeconds = static_cast<U64>(this->m_runtime.currentStatementDispatchTime.getSeconds()) * 1000000 +
742
1/1
✓ Branch 6 taken 8 times.
8 this->m_runtime.currentStatementDispatchTime.getUSeconds();
743
744 8 U64 timeoutUSeconds = static_cast<U64>(timeout * 1000000.0f);
745
746
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 5 times.
8 if (currentUSeconds - dispatchUSeconds < timeoutUSeconds) {
747 // not over timeout
748 3 return Signal::result_checkStatementTimeout_noTimeout;
749 }
750
751 // we timed out
752
1/2
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
5 if (this->m_runtime.currentStatementOpcode == Fpy::DirectiveId::CONST_CMD ||
753
1/2
✗ Branch 4 not taken.
✓ Branch 5 taken 5 times.
5 this->m_runtime.currentStatementOpcode == Fpy::DirectiveId::STACK_CMD) {
754 // if we were executing a command, warn that the cmd timed out with its opcode
755 this->log_WARNING_HI_CommandTimedOut(CmdDispatcherCfg::getEventOpcode(this->m_runtime.currentCmdOpcode),
756 this->currentStatementIdx(), this->m_sequenceFilePath);
757 } else {
758
1/1
✓ Branch 16 taken 5 times.
5 this->log_WARNING_HI_DirectiveTimedOut(this->m_runtime.currentStatementOpcode, this->currentStatementIdx(),
759 this->m_sequenceFilePath);
760 }
761
762 5 return Signal::result_checkStatementTimeout_statementTimeout;
763 12 }
764
765 } // namespace Svc
766