GCC Code Coverage Report


Directory: ./
File: Svc/FpySequencer/FpySequencerRunState.cpp
Date: 2026-11-03 21:15:54
Exec Total Coverage
Lines: 372 435 85.5%
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 2238 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 2238 FW_ASSERT(this->m_runtime.nextStatementIndex <= this->m_sequenceObj.get_header().get_statementCount());
22
23
2/2
✓ Branch 14 taken 41 times.
✓ Branch 15 taken 2197 times.
2238 if (this->m_runtime.nextStatementIndex == this->m_sequenceObj.get_header().get_statementCount()) {
24 41 return Signal::result_dispatchStatement_noMoreStatements;
25 }
26
27 2197 const Fpy::Statement& nextStatement = this->m_sequenceObj.get_statements()[this->m_runtime.nextStatementIndex];
28 2197 this->m_runtime.nextStatementIndex++;
29 2197 this->m_runtime.currentStatementOpcode = nextStatement.get_opCode();
30 2197 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 2197 times.
2197 Fw::Success result;
33 2197 DirectiveUnion directiveUnion;
34
35
2/2
✓ Branch 2 taken 2197 times.
✓ Branch 7 taken 2197 times.
2197 result = this->deserializeDirective(nextStatement, directiveUnion);
36
37
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 2197 times.
2197 if (!result) {
38 ✗ return Signal::result_dispatchStatement_failure;
39 }
40
41
2/2
✓ Branch 4 taken 7 times.
✓ Branch 5 taken 2190 times.
2197 if (this->m_runtime.currentStatementOpcode == Fpy::DirectiveId::CONST_CMD) {
42 // update the opcode of the cmd we will await
43 7 this->m_runtime.currentCmdOpcode = directiveUnion.constCmd.get_opCode();
44 }
45
46
1/1
✓ Branch 4 taken 2197 times.
4394 this->dispatchDirective(directiveUnion,
47
1/1
✓ Branch 6 taken 2197 times.
4394 Fpy::DirectiveId(static_cast<Fpy::DirectiveId::T>(nextStatement.get_opCode())));
48 2197 this->m_runtime.currentStatementDispatchTime =
49
2/2
✓ Branch 3 taken 2197 times.
✓ Branch 10 taken 2197 times.
4394 getTime(); // set dispatch time right after we have successfully dispatched
50
51 2197 this->m_statementsDispatched++;
52
53 2197 return Signal::result_dispatchStatement_success;
54 2197 }
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 2257 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 2257 times.
✓ Branch 25 taken 2257 times.
2257 Fw::ExternalSerializeBuffer argBuf(const_cast<U8*>(stmt.get_argBuf().getBuffAddr()), stmt.get_argBuf().getSize());
63
2/2
✓ Branch 13 taken 2257 times.
✓ Branch 16 taken 2257 times.
2257 status = argBuf.setBuffLen(stmt.get_argBuf().getSize());
64 2257 FW_ASSERT(status == Fw::FW_SERIALIZE_OK, status);
65
66
31/33
✓ Branch 4 taken 7 times.
✓ Branch 5 taken 4 times.
✓ Branch 6 taken 5 times.
✓ Branch 7 taken 10 times.
✓ Branch 8 taken 2061 times.
✓ Branch 9 taken 9 times.
✓ Branch 10 taken 4 times.
✓ Branch 11 taken 4 times.
✓ Branch 12 taken 7 times.
✓ Branch 13 taken 8 times.
✓ Branch 14 taken 10 times.
✓ Branch 15 taken 6 times.
✓ Branch 16 taken 1 times.
✓ Branch 17 taken 9 times.
✓ Branch 18 taken 50 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.
2257 switch (stmt.get_opCode()) {
67 7 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 7 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
7 new (&deserializedDirective.waitRel) FpySequencer_WaitRelDirective();
70 // wait rel does not need deser
71
3/3
✓ Branch 2 taken 7 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 6 times.
7 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 6 times.
6 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 2061 case Fpy::DirectiveId::NO_OP: {
111
1/3
✓ Branch 3 taken 2061 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
2061 new (&deserializedDirective.noOp) FpySequencer_NoOpDirective();
112 // no op does not need deser
113
3/3
✓ Branch 2 taken 2061 times.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 2060 times.
2061 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 2060 times.
2060 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 7 case Fpy::DirectiveId::CONST_CMD: {
152
1/3
✓ Branch 3 taken 7 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
7 new (&deserializedDirective.constCmd) FpySequencer_ConstCmdDirective();
153
154 // first deserialize the opcode
155 7 FwOpcodeType opcode;
156
1/1
✓ Branch 2 taken 7 times.
7 status = argBuf.deserializeTo(opcode);
157
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 7 times.
7 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 7 times.
7 deserializedDirective.constCmd.set_opCode(opcode);
164 // how many bytes are left?
165
1/1
✓ Branch 3 taken 7 times.
7 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 7 times.
7 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 7 times.
7 status = argBuf.deserializeTo(deserializedDirective.constCmd.get_argBuf(), cmdArgBufSize,
177 Fw::Serialization::OMIT_LENGTH);
178
179
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 7 times.
7 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 7 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 7 times.
7 deserializedDirective.constCmd.set__argBufSize(cmdArgBufSize);
191
1/1
✓ Branch 1 taken 7 times.
7 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 6 case Fpy::DirectiveId::ALLOCATE: {
266
1/3
✓ Branch 3 taken 6 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
6 new (&deserializedDirective.allocate) FpySequencer_AllocateDirective();
267
1/1
✓ Branch 4 taken 6 times.
6 status = argBuf.deserializeTo(deserializedDirective.allocate);
268
4/7
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 6 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 6 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 6 times.
6 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 6 times.
6 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 50 case Fpy::DirectiveId::PUSH_VAL: {
296
1/3
✓ Branch 3 taken 50 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
50 new (&deserializedDirective.pushVal) FpySequencer_PushValDirective();
297
298 // how many bytes are left?
299
1/1
✓ Branch 3 taken 50 times.
50 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 50 times.
50 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 50 times.
50 argBuf.deserializeTo(deserializedDirective.pushVal.get_val(), bufSize, Fw::Serialization::OMIT_LENGTH);
312
313
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 50 times.
50 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 50 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 50 times.
50 deserializedDirective.pushVal.set__valSize(bufSize);
325
1/1
✓ Branch 1 taken 50 times.
50 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 2257 }
498
499 // dispatches a deserialized sequencer directive to the right handler.
500 2197 void FpySequencer::dispatchDirective(const DirectiveUnion& directive, const Fpy::DirectiveId& id) {
501
29/33
✗ Branch 4 not taken.
✓ Branch 5 taken 4 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 7 times.
✓ Branch 9 taken 2058 times.
✓ Branch 10 taken 6 times.
✓ Branch 11 taken 1 times.
✓ Branch 12 taken 1 times.
✓ Branch 13 taken 7 times.
✓ Branch 14 taken 5 times.
✓ Branch 15 taken 7 times.
✓ Branch 16 taken 6 times.
✓ Branch 17 taken 1 times.
✓ Branch 18 taken 9 times.
✓ Branch 19 taken 50 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.
2197 switch (id) {
502 ✗ case Fpy::DirectiveId::INVALID: {
503 // coding err
504 ✗ FW_ASSERT(false);
505 ✗ return;
506 }
507 4 case Fpy::DirectiveId::WAIT_REL: {
508 4 this->directive_waitRel_internalInterfaceInvoke(directive.waitRel, this->m_sequencesStarted);
509 4 return;
510 }
511 1 case Fpy::DirectiveId::WAIT_ABS: {
512 1 this->directive_waitAbs_internalInterfaceInvoke(directive.waitAbs, this->m_sequencesStarted);
513 1 return;
514 }
515 2 case Fpy::DirectiveId::GOTO: {
516 2 this->directive_goto_internalInterfaceInvoke(directive.gotoDirective, this->m_sequencesStarted);
517 2 return;
518 }
519 7 case Fpy::DirectiveId::IF: {
520 7 this->directive_if_internalInterfaceInvoke(directive.ifDirective, this->m_sequencesStarted);
521 7 return;
522 }
523 2058 case Fpy::DirectiveId::NO_OP: {
524 2058 this->directive_noOp_internalInterfaceInvoke(directive.noOp, this->m_sequencesStarted);
525 2058 return;
526 }
527 6 case Fpy::DirectiveId::PUSH_TLM_VAL: {
528 6 this->directive_pushTlmVal_internalInterfaceInvoke(directive.pushTlmVal, this->m_sequencesStarted);
529 6 return;
530 }
531 1 case Fpy::DirectiveId::PUSH_TLM_VAL_AND_TIME: {
532 2 this->directive_pushTlmValAndTime_internalInterfaceInvoke(directive.pushTlmValAndTime,
533 1 this->m_sequencesStarted);
534 1 return;
535 }
536 1 case Fpy::DirectiveId::PUSH_PRM: {
537 1 this->directive_pushPrm_internalInterfaceInvoke(directive.pushPrm, this->m_sequencesStarted);
538 1 return;
539 }
540 7 case Fpy::DirectiveId::CONST_CMD: {
541 7 this->directive_constCmd_internalInterfaceInvoke(directive.constCmd, this->m_sequencesStarted);
542 7 return;
543 }
544 // fallthrough on purpose
545 5 case Fpy::DirectiveId::OR:
546 case Fpy::DirectiveId::AND:
547 case Fpy::DirectiveId::IEQ:
548 case Fpy::DirectiveId::INE:
549 case Fpy::DirectiveId::UGT:
550 case Fpy::DirectiveId::ULT:
551 case Fpy::DirectiveId::ULE:
552 case Fpy::DirectiveId::UGE:
553 case Fpy::DirectiveId::SGT:
554 case Fpy::DirectiveId::SLT:
555 case Fpy::DirectiveId::SLE:
556 case Fpy::DirectiveId::SGE:
557 case Fpy::DirectiveId::FEQ:
558 case Fpy::DirectiveId::FNE:
559 case Fpy::DirectiveId::FLT:
560 case Fpy::DirectiveId::FLE:
561 case Fpy::DirectiveId::FGT:
562 case Fpy::DirectiveId::FGE:
563 case Fpy::DirectiveId::NOT:
564 case Fpy::DirectiveId::FPEXT:
565 case Fpy::DirectiveId::FPTRUNC:
566 case Fpy::DirectiveId::FPTOSI:
567 case Fpy::DirectiveId::FPTOUI:
568 case Fpy::DirectiveId::SITOFP:
569 case Fpy::DirectiveId::UITOFP:
570 case Fpy::DirectiveId::ADD:
571 case Fpy::DirectiveId::SUB:
572 case Fpy::DirectiveId::MUL:
573 case Fpy::DirectiveId::UDIV:
574 case Fpy::DirectiveId::SDIV:
575 case Fpy::DirectiveId::UMOD:
576 case Fpy::DirectiveId::SMOD:
577 case Fpy::DirectiveId::FADD:
578 case Fpy::DirectiveId::FSUB:
579 case Fpy::DirectiveId::FMUL:
580 case Fpy::DirectiveId::FDIV:
581 case Fpy::DirectiveId::FPOW:
582 case Fpy::DirectiveId::FLOG:
583 case Fpy::DirectiveId::FMOD:
584 case Fpy::DirectiveId::SIEXT_8_64:
585 case Fpy::DirectiveId::SIEXT_16_64:
586 case Fpy::DirectiveId::SIEXT_32_64:
587 case Fpy::DirectiveId::ZIEXT_8_64:
588 case Fpy::DirectiveId::ZIEXT_16_64:
589 case Fpy::DirectiveId::ZIEXT_32_64:
590 case Fpy::DirectiveId::ITRUNC_64_8:
591 case Fpy::DirectiveId::ITRUNC_64_16:
592 case Fpy::DirectiveId::ITRUNC_64_32:
593 case Fpy::DirectiveId::FFLOOR:
594 case Fpy::DirectiveId::IABS:
595 case Fpy::DirectiveId::FABS: {
596 5 this->directive_stackOp_internalInterfaceInvoke(directive.stackOp, this->m_sequencesStarted);
597 5 return;
598 }
599 7 case Fpy::DirectiveId::EXIT: {
600 7 this->directive_exit_internalInterfaceInvoke(directive.exit, this->m_sequencesStarted);
601 7 return;
602 }
603 6 case Fpy::DirectiveId::ALLOCATE: {
604 6 this->directive_allocate_internalInterfaceInvoke(directive.allocate, this->m_sequencesStarted);
605 6 return;
606 }
607 1 case Fpy::DirectiveId::STORE_REL_CONST_OFFSET: {
608 2 this->directive_storeRelConstOffset_internalInterfaceInvoke(directive.storeRelConstOffset,
609 1 this->m_sequencesStarted);
610 1 return;
611 }
612 9 case Fpy::DirectiveId::LOAD_REL: {
613 9 this->directive_loadRel_internalInterfaceInvoke(directive.loadRel, this->m_sequencesStarted);
614 9 return;
615 }
616 50 case Fpy::DirectiveId::PUSH_VAL: {
617 50 this->directive_pushVal_internalInterfaceInvoke(directive.pushVal, this->m_sequencesStarted);
618 50 return;
619 }
620 18 case Fpy::DirectiveId::DISCARD: {
621 18 this->directive_discard_internalInterfaceInvoke(directive.discard, this->m_sequencesStarted);
622 18 return;
623 }
624 1 case Fpy::DirectiveId::MEMCMP: {
625 1 this->directive_memCmp_internalInterfaceInvoke(directive.memCmp, this->m_sequencesStarted);
626 1 return;
627 }
628 1 case Fpy::DirectiveId::STACK_CMD: {
629 1 this->directive_stackCmd_internalInterfaceInvoke(directive.stackCmd, this->m_sequencesStarted);
630 1 return;
631 }
632 1 case Fpy::DirectiveId::PUSH_TIME: {
633 1 this->directive_pushTime_internalInterfaceInvoke(directive.pushTime, this->m_sequencesStarted);
634 1 return;
635 }
636 1 case Fpy::DirectiveId::SET_SEED: {
637 1 this->directive_setSeed_internalInterfaceInvoke(directive.setSeed, this->m_sequencesStarted);
638 1 return;
639 }
640 2 case Fpy::DirectiveId::PUSH_RAND: {
641 2 this->directive_pushRand_internalInterfaceInvoke(directive.pushRand, this->m_sequencesStarted);
642 2 return;
643 }
644 1 case Fpy::DirectiveId::GET_FIELD: {
645 1 this->directive_getField_internalInterfaceInvoke(directive.getField, this->m_sequencesStarted);
646 1 return;
647 }
648 1 case Fpy::DirectiveId::PEEK: {
649 1 this->directive_peek_internalInterfaceInvoke(directive.peek, this->m_sequencesStarted);
650 1 return;
651 }
652 1 case Fpy::DirectiveId::STORE_REL: {
653 1 this->directive_storeRel_internalInterfaceInvoke(directive.storeRel, this->m_sequencesStarted);
654 1 return;
655 }
656 1 case Fpy::DirectiveId::CALL: {
657 1 this->directive_call_internalInterfaceInvoke(directive.call, this->m_sequencesStarted);
658 1 return;
659 }
660 1 case Fpy::DirectiveId::RETURN: {
661 1 this->directive_return_internalInterfaceInvoke(directive.returnDirective, this->m_sequencesStarted);
662 1 return;
663 }
664 1 case Fpy::DirectiveId::LOAD_ABS: {
665 1 this->directive_loadAbs_internalInterfaceInvoke(directive.loadAbs, this->m_sequencesStarted);
666 1 return;
667 }
668 1 case Fpy::DirectiveId::STORE_ABS: {
669 1 this->directive_storeAbs_internalInterfaceInvoke(directive.storeAbs, this->m_sequencesStarted);
670 1 return;
671 }
672 1 case Fpy::DirectiveId::STORE_ABS_CONST_OFFSET: {
673 2 this->directive_storeAbsConstOffset_internalInterfaceInvoke(directive.storeAbsConstOffset,
674 1 this->m_sequencesStarted);
675 1 return;
676 }
677 ✗ case Fpy::DirectiveId::POP_EVENT: {
678 ✗ this->directive_popEvent_internalInterfaceInvoke(directive.popEvent, this->m_sequencesStarted);
679 ✗ return;
680 }
681 ✗ case Fpy::DirectiveId::POP_SERIALIZABLE: {
682 ✗ this->directive_popSerializable_internalInterfaceInvoke(directive.popSerializable,
683 ✗ this->m_sequencesStarted);
684 ✗ return;
685 }
686 }
687 // coding err
688 ✗ FW_ASSERT(false, static_cast<FwAssertArgType>(id));
689 }
690
691 9 Signal FpySequencer::checkShouldWake() {
692
1/1
✓ Branch 3 taken 9 times.
9 Fw::Time currentTime = this->getTime();
693
694
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.wakeupTime.getTimeBase()) {
695 // cannot compare these times.
696
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());
697
698 1 return Signal::result_timeOpFailed;
699 }
700
701 // Do not compare time context
702
703
3/3
✓ Branch 5 taken 8 times.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 5 times.
8 if (currentTime < this->m_runtime.wakeupTime) {
704 // not time to wake up!
705 3 return Signal::result_checkShouldWake_keepSleeping;
706 }
707
708 // say we've finished our sleep
709 5 return Signal::result_checkShouldWake_wakeup;
710 9 }
711
712 // checks whether the currently executing statement timed out
713 13 Signal FpySequencer::checkStatementTimeout() {
714
1/1
✓ Branch 2 taken 13 times.
13 Fw::ParamValid valid;
715
1/1
✓ Branch 5 taken 13 times.
13 F32 timeout = this->paramGet_STATEMENT_TIMEOUT_SECS(valid);
716
5/6
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
✓ Branch 5 taken 5 times.
✓ Branch 6 taken 8 times.
13 if (timeout <= 0 || timeout > static_cast<F32>(std::numeric_limits<U32>::max())) {
717 // no timeout
718 5 return Signal::result_checkStatementTimeout_noTimeout;
719 }
720
721
1/1
✓ Branch 3 taken 8 times.
8 Fw::Time currentTime = getTime();
722
723
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.currentStatementDispatchTime.getTimeBase()) {
724 // can't compare time base. must have changed
725
2/2
✓ Branch 10 taken 1 times.
✓ Branch 17 taken 1 times.
2 this->log_WARNING_HI_MismatchedTimeBase(currentTime.getTimeBase(),
726
1/1
✓ Branch 3 taken 1 times.
2 this->m_runtime.currentStatementDispatchTime.getTimeBase());
727 1 return Signal::result_timeOpFailed;
728 }
729
730 // Do not compare time context
731
732
3/4
✓ Branch 6 taken 7 times.
✓ Branch 10 taken 7 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 7 times.
7 if (this->m_runtime.currentStatementDispatchTime.getSeconds() > currentTime.getSeconds()) {
733 // somehow we've gone back in time... just ignore it and move on. should get fixed
734 // if we wait I guess
735 ✗ return Signal::result_checkStatementTimeout_noTimeout;
736 }
737
738
4/6
✓ Branch 6 taken 7 times.
✓ Branch 10 taken 7 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 7 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 7 times.
7 if (this->m_runtime.currentStatementDispatchTime.getSeconds() == currentTime.getSeconds() &&
739 ✗ this->m_runtime.currentStatementDispatchTime.getUSeconds() > currentTime.getUSeconds()) {
740 // same as above
741 ✗ return Signal::result_checkStatementTimeout_noTimeout;
742 }
743
744
2/2
✓ Branch 2 taken 7 times.
✓ Branch 6 taken 7 times.
7 U64 currentUSeconds = static_cast<U64>(currentTime.getSeconds()) * 1000000 + currentTime.getUSeconds();
745
1/1
✓ Branch 6 taken 7 times.
7 U64 dispatchUSeconds = static_cast<U64>(this->m_runtime.currentStatementDispatchTime.getSeconds()) * 1000000 +
746
1/1
✓ Branch 6 taken 7 times.
7 this->m_runtime.currentStatementDispatchTime.getUSeconds();
747
748 7 U64 timeoutUSeconds = static_cast<U64>(timeout * 1000000.0f);
749
750
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 5 times.
7 if (currentUSeconds - dispatchUSeconds < timeoutUSeconds) {
751 // not over timeout
752 2 return Signal::result_checkStatementTimeout_noTimeout;
753 }
754
755 // we timed out
756
1/2
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
5 if (this->m_runtime.currentStatementOpcode == Fpy::DirectiveId::CONST_CMD ||
757
1/2
✗ Branch 4 not taken.
✓ Branch 5 taken 5 times.
5 this->m_runtime.currentStatementOpcode == Fpy::DirectiveId::STACK_CMD) {
758 // if we were executing a command, warn that the cmd timed out with its opcode
759 ✗ this->log_WARNING_HI_CommandTimedOut(CmdDispatcherCfg::getEventOpcode(this->m_runtime.currentCmdOpcode),
760 ✗ this->currentStatementIdx(), this->m_sequenceFilePath);
761 } else {
762
1/1
✓ Branch 16 taken 5 times.
5 this->log_WARNING_HI_DirectiveTimedOut(this->m_runtime.currentStatementOpcode, this->currentStatementIdx(),
763 this->m_sequenceFilePath);
764 }
765
766 5 return Signal::result_checkStatementTimeout_statementTimeout;
767 13 }
768
769 } // namespace Svc
770