FW Profile - C1 Implementation
FwPrMakeTest.c
Go to the documentation of this file.
1 
19 #include "FwPrMakeTest.h"
20 #include "FwPrSCreate.h"
21 #include <stdlib.h>
22 
36 
48 struct TestPrData* GetTestPrData(FwPrDesc_t prDesc);
49 
55 static void incrCnt1By1(FwPrDesc_t prDesc) {
56  struct TestPrData* prData = GetTestPrData(prDesc);
57  prData->counter_1++;
60  fwPrLogIndex++;
61 }
62 
68 static void incrCnt1By8(FwPrDesc_t prDesc) {
69  struct TestPrData* prData = GetTestPrData(prDesc);
70  prData->counter_1 = prData->counter_1 + 8;
73  fwPrLogIndex++;
74 }
75 
82 static void assignProcExecCntToCnt1(FwPrDesc_t prDesc) {
83  struct TestPrData* prData = GetTestPrData(prDesc);
84  prData->counter_1 = prDesc->prExecCnt;
87  fwPrLogIndex++;
88 }
89 
94 static FwPrBool_t retFlag1(FwPrDesc_t prDesc) {
95  struct TestPrData* prData = GetTestPrData(prDesc);
96  return (prData->flag_1 == 1);
97 }
98 
103 static FwPrBool_t retFlag2(FwPrDesc_t prDesc) {
104  struct TestPrData* prData = GetTestPrData(prDesc);
105  return (prData->flag_2 == 1);
106 }
107 
112 static FwPrBool_t retFlag3(FwPrDesc_t prDesc) {
113  struct TestPrData* prData = GetTestPrData(prDesc);
114  return (prData->flag_3 == 1);
115 }
116 
121 static FwPrBool_t retFlag4(FwPrDesc_t prDesc) {
122  struct TestPrData* prData = GetTestPrData(prDesc);
123  return (prData->flag_4 == 1);
124 }
125 
130 static FwPrBool_t retFlag5(FwPrDesc_t prDesc) {
131  struct TestPrData* prData = GetTestPrData(prDesc);
132  return (prData->flag_5 == 1);
133 }
134 
139 static FwPrBool_t retFlag6(FwPrDesc_t prDesc) {
140  struct TestPrData* prData = GetTestPrData(prDesc);
141  return (prData->flag_6 == 1);
142 }
143 
150 static FwPrBool_t wait3Cycles(FwPrDesc_t prDesc) {
151  return (prDesc->nodeExecCnt == 3);
152 }
153 
158 static FwPrBool_t returnCounter1GreaterThan5(FwPrDesc_t prDesc) {
159  struct TestPrData* prData = GetTestPrData(prDesc);
160  return (prData->counter_1 > 5);
161 }
162 
167 static FwPrBool_t returnCounter1SmallerThan6(FwPrDesc_t prDesc) {
168  struct TestPrData* prData = GetTestPrData(prDesc);
169  return (prData->counter_1 < 6);
170 }
171 
173  return (struct TestPrData*)FwPrGetData(prDesc);
174 }
175 
176 /* ----------------------------------------------------------------------------------------------------------------- */
178  const FwPrCounterS1_t nOfANodes = 3; /* Number of action nodes */
179  const FwPrCounterS1_t nOfDNodes = 0; /* Number of decision nodes */
180  const FwPrCounterS1_t nOfFlows = 4; /* Number of control flows */
181  const FwPrCounterS1_t nOfActions = 1; /* Number of actions */
182  const FwPrCounterS1_t nOfGuards = 3; /* Number of guards */
183  FwPrDesc_t p_pr;
184 
185  /* Create and configure the procedure */
186  p_pr = FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
187  FwPrSetData(p_pr, prData);
188 
189  FwPrAddActionNode(p_pr, N1, &incrCnt1By1);
190  FwPrAddActionNode(p_pr, N2, &incrCnt1By1);
191  FwPrAddActionNode(p_pr, N3, &incrCnt1By1);
192 
193  FwPrAddFlowIniToAct(p_pr, N1, &retFlag1);
194  FwPrAddFlowActToAct(p_pr, N1, N2, &retFlag2);
195  FwPrAddFlowActToAct(p_pr, N2, N3, &retFlag3);
196  FwPrAddFlowActToFin(p_pr, N3, &retFlag3);
197 
198  if (FwPrCheck(p_pr)==prSuccess)
199  return p_pr;
200  else
201  return NULL;
202 }
203 
204 /* ----------------------------------------------------------------------------------------------------------------- */
206 
207  /* Create the procedure */
208  FW_PR_INST_NODEC(prDesc, 3, 4, 1, 3)
209  FwPrInit(&prDesc);
210 
211  /* Configure the procedure */
212  FwPrSetData(&prDesc, prData);
213 
214  FwPrAddActionNode(&prDesc, N1, &incrCnt1By1);
215  FwPrAddActionNode(&prDesc, N2, &incrCnt1By1);
216  FwPrAddActionNode(&prDesc, N3, &incrCnt1By1);
217 
218  FwPrAddFlowIniToAct(&prDesc, N1, &retFlag1);
219  FwPrAddFlowActToAct(&prDesc, N1, N2, &retFlag2);
220  FwPrAddFlowActToAct(&prDesc, N2, N3, &retFlag3);
221  FwPrAddFlowActToFin(&prDesc, N3, &retFlag3);
222 
223  if (FwPrCheck(&prDesc)==prSuccess)
224  return &prDesc;
225  else
226  return NULL;
227 }
228 
229 /* ----------------------------------------------------------------------------------------------------------------- */
231  const FwPrCounterS1_t nOfANodes = 3; /* Number of action nodes */
232  const FwPrCounterS1_t nOfDNodes = 2; /* Number of decision nodes */
233  const FwPrCounterS1_t nOfFlows = 9; /* Number of control flows */
234  const FwPrCounterS1_t nOfActions = 1; /* Number of actions */
235  const FwPrCounterS1_t nOfGuards = 8; /* Number of guards */
236  FwPrDesc_t prDesc;
237 
238  /* Create and configure the procedure */
239  prDesc = FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
240  FwPrSetData(prDesc, prData);
241 
242  FwPrAddActionNode(prDesc, N1, &incrCnt1By1);
243  FwPrAddActionNode(prDesc, N2, &incrCnt1By1);
244  FwPrAddActionNode(prDesc, N3, &incrCnt1By1);
245 
246  FwPrAddDecisionNode(prDesc, D1, 3);
247  FwPrAddDecisionNode(prDesc, D2, 2);
248 
249  FwPrAddFlowIniToAct(prDesc, N1, &retFlag1);
250  FwPrAddFlowActToAct(prDesc, N1, N2, &retFlag2);
251  FwPrAddFlowActToDec(prDesc, N2, D1, NULL);
252  FwPrAddFlowDecToFin(prDesc, D1, &retFlag3);
253  FwPrAddFlowDecToDec(prDesc, D1, D2, &retFlag4);
254  FwPrAddFlowDecToAct(prDesc, D1, N3, &retFlag5);
255  FwPrAddFlowActToAct(prDesc, N3, N2, &retFlag6);
256  FwPrAddFlowDecToAct(prDesc, D2, N3, &returnCounter1SmallerThan6);
257  FwPrAddFlowDecToFin(prDesc, D2, &returnCounter1GreaterThan5);
258 
259  if (FwPrCheck(prDesc)==prSuccess)
260  return prDesc;
261  else
262  return NULL;
263 }
264 
265 
266 /* ----------------------------------------------------------------------------------------------------------------- */
268 
269  static PrANode_t aNodes[3]; /* 3 Action Nodes */
270  static PrDNode_t dNodes[2]; /* 2 Decision Nodes */
271  static PrFlow_t flows[9]; /* 9 Flows */
272  static FwPrAction_t actions[1]; /* 1 Action */
273  static FwPrGuard_t guards[9]; /* 9 Guards (including dummy guard) */
274  static PrBaseDesc_t prBase;
275  static struct FwPrDesc prDesc;
276 
277  /* Configure the array of actions */
278  actions[0] = &incrCnt1By1;
279 
280  /* Configure the array of guards */
281  guards[0] = &PrDummyGuard;
282  guards[1] = &retFlag1;
283  guards[2] = &retFlag2;
284  guards[3] = &retFlag3;
285  guards[4] = &retFlag4;
286  guards[5] = &retFlag5;
287  guards[6] = &retFlag6;
288  guards[7] = &returnCounter1GreaterThan5;
289  guards[8] = &returnCounter1SmallerThan6;
290 
291  /* Configure the array of action nodes */
292  aNodes[0].iAction = 0;
293  aNodes[0].iFlow = 1;
294  aNodes[1].iAction = 0;
295  aNodes[1].iFlow = 2;
296  aNodes[2].iAction = 0;
297  aNodes[2].iFlow = 3;
298 
299  /* Configure the array of decision nodes */
300  dNodes[0].nOfOutTrans = 3;
301  dNodes[0].outFlowIndex = 4;
302  dNodes[1].nOfOutTrans = 2;
303  dNodes[1].outFlowIndex = 7;
304 
305  /* Configure the array of flows */
306  flows[0].dest = 1;
307  flows[0].iGuard = 1;
308  flows[1].dest = 2;
309  flows[1].iGuard = 2;
310  flows[2].dest = -1;
311  flows[2].iGuard = 0;
312  flows[3].dest = 2;
313  flows[3].iGuard = 6;
314  flows[4].dest = 3;
315  flows[4].iGuard = 5;
316  flows[5].dest = -2;
317  flows[5].iGuard = 4;
318  flows[6].dest = 0;
319  flows[6].iGuard = 3;
320  flows[7].dest = 3;
321  flows[7].iGuard = 8;
322  flows[8].dest = 0;
323  flows[8].iGuard = 7;
324 
325  /* Configure the procedure descriptor */
326  prBase.aNodes = aNodes;
327  prBase.dNodes = dNodes;
328  prBase.flows = flows;
329  prBase.nOfANodes = 3;
330  prBase.nOfDNodes = 2;
331  prBase.nOfFlows = 9;
332  prDesc.curNode = 0;
333  prDesc.errCode = prSuccess;
334  prDesc.flowCnt = 0;
335  prDesc.nOfActions = 1;
336  prDesc.nOfGuards = 9;
337  prDesc.prActions = actions;
338  prDesc.prBase = &prBase;
339  prDesc.prData = prData;
340  prDesc.prGuards = guards;
341  prDesc.prData = prData;
342 
343  return &prDesc;
344 }
345 
346 /* ----------------------------------------------------------------------------------------------------------------- */
348 
349  /* Create the procedure */
350  FW_PR_INST(prDesc, 3, 2, 9, 1, 8)
351  FwPrInit(&prDesc);
352 
353  /* Configure the procedure */
354  FwPrSetData(&prDesc, prData);
355 
356  FwPrAddActionNode(&prDesc, N1, &incrCnt1By1);
357  FwPrAddActionNode(&prDesc, N2, &incrCnt1By1);
358  FwPrAddActionNode(&prDesc, N3, &incrCnt1By1);
359 
360  FwPrAddDecisionNode(&prDesc, D1, 3);
361  FwPrAddDecisionNode(&prDesc, D2, 2);
362 
363  FwPrAddFlowIniToAct(&prDesc, N1, &retFlag1);
364  FwPrAddFlowActToAct(&prDesc, N1, N2, &retFlag2);
365  FwPrAddFlowActToDec(&prDesc, N2, D1, NULL);
366  FwPrAddFlowDecToFin(&prDesc, D1, &retFlag3);
367  FwPrAddFlowDecToDec(&prDesc, D1, D2, &retFlag4);
368  FwPrAddFlowDecToAct(&prDesc, D1, N3, &retFlag5);
369  FwPrAddFlowActToAct(&prDesc, N3, N2, &retFlag6);
370  FwPrAddFlowDecToAct(&prDesc, D2, N3, &returnCounter1SmallerThan6);
371  FwPrAddFlowDecToFin(&prDesc, D2, &returnCounter1GreaterThan5);
372 
373  if (FwPrCheck(&prDesc)==prSuccess)
374  return &prDesc;
375  else
376  return NULL;
377 }
378 
379 /* ----------------------------------------------------------------------------------------------------------------- */
381  const FwPrCounterS1_t nOfANodes = 1; /* Number of action nodes */
382  const FwPrCounterS1_t nOfDNodes = 0; /* Number of decision nodes */
383  const FwPrCounterS1_t nOfFlows = 2; /* Number of control flows */
384  const FwPrCounterS1_t nOfActions = 1; /* Number of actions */
385  const FwPrCounterS1_t nOfGuards = 0; /* Number of guards */
386  FwPrDesc_t prDesc;
387 
388  /* Create and configure the procedure */
389  prDesc = FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
390  FwPrSetData(prDesc, prData);
391 
392  FwPrAddActionNode(prDesc, N1, &incrCnt1By1);
393 
394  FwPrAddFlowIniToAct(prDesc, N1, NULL);
395  FwPrAddFlowActToFin(prDesc, N1, NULL);
396 
397  if (FwPrCheck(prDesc)==prSuccess)
398  return prDesc;
399  else
400  return NULL;
401 }
402 
403 /* ----------------------------------------------------------------------------------------------------------------- */
405  FwPrDesc_t prDesc;
406  const FwPrCounterS1_t nOfANodes = 1; /* Number of action nodes */
407  const FwPrCounterS1_t nOfDNodes = 1; /* Number of decision nodes */
408  const FwPrCounterS1_t nOfFlows = 4; /* Number of control flows */
409  const FwPrCounterS1_t nOfActions = 1; /* Number of actions */
410  const FwPrCounterS1_t nOfGuards = 2; /* Number of guards */
411 
412  /* Create and configure the procedure */
413  prDesc = FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
414  FwPrSetData(prDesc, prData);
415 
416  FwPrAddActionNode(prDesc, N1, &incrCnt1By1);
417 
418  FwPrAddDecisionNode(prDesc, D1, 2);
419 
420  FwPrAddFlowIniToDec(prDesc, D1, NULL);
421  FwPrAddFlowDecToAct(prDesc, D1, N1, &retFlag1);
422  FwPrAddFlowDecToFin(prDesc, D1, &retFlag2);
423  FwPrAddFlowActToFin(prDesc, N1, NULL);
424 
425  if (FwPrCheck(prDesc)==prSuccess)
426  return prDesc;
427  else
428  return NULL;
429 }
430 
431 /* ----------------------------------------------------------------------------------------------------------------- */
433  const FwPrCounterS1_t nOfANodes = 3; /* Number of action nodes */
434  const FwPrCounterS1_t nOfDNodes = 0; /* Number of decision nodes */
435  const FwPrCounterS1_t nOfFlows = 4; /* Number of control flows */
436  const FwPrCounterS1_t nOfActions = 1; /* Number of actions */
437  const FwPrCounterS1_t nOfGuards = 1; /* Number of guards */
438  FwPrDesc_t p_pr;
439 
440  /* Create and configure the procedure */
441  p_pr = FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
442  FwPrSetData(p_pr, prData);
443 
444  FwPrAddActionNode(p_pr, N1, &assignProcExecCntToCnt1);
445  FwPrAddActionNode(p_pr, N2, &assignProcExecCntToCnt1);
446  FwPrAddActionNode(p_pr, N3, &assignProcExecCntToCnt1);
447 
448  FwPrAddFlowIniToAct(p_pr, N1, NULL);
449  FwPrAddFlowActToAct(p_pr, N1, N2, &wait3Cycles);
450  FwPrAddFlowActToAct(p_pr, N2, N3, &wait3Cycles);
451  FwPrAddFlowActToFin(p_pr, N3, NULL);
452 
453  if (FwPrCheck(p_pr)==prSuccess)
454  return p_pr;
455  else
456  return NULL;
457 }
458 
459 /* ----------------------------------------------------------------------------------------------------------------- */
461  const FwPrCounterS1_t nOfANodes = 3; /* Number of action nodes */
462  const FwPrCounterS1_t nOfDNodes = 1; /* Number of decision nodes */
463  const FwPrCounterS1_t nOfFlows = 7; /* Number of control flows */
464  const FwPrCounterS1_t nOfActions = 1; /* Number of actions */
465  const FwPrCounterS1_t nOfGuards = 4; /* Number of guards */
466  FwPrDesc_t p_pr;
467 
468  /* Create and configure the procedure */
469  p_pr = FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
470  FwPrSetData(p_pr, prData);
471 
472  FwPrAddActionNode(p_pr, N1, &incrCnt1By1);
473  FwPrAddActionNode(p_pr, N2, &incrCnt1By1);
474  FwPrAddActionNode(p_pr, N3, &incrCnt1By1);
475  FwPrAddDecisionNode(p_pr, D1, 3);
476 
477  FwPrAddFlowIniToDec(p_pr, D1, NULL);
478  FwPrAddFlowDecToAct(p_pr, D1, N1, &retFlag1);
479  FwPrAddFlowDecToAct(p_pr, D1, N2, &retFlag2);
480  FwPrAddFlowDecToAct(p_pr, D1, N3, &retFlag3);
481  FwPrAddFlowActToFin(p_pr, N1, &retFlag4);
482  FwPrAddFlowActToFin(p_pr, N2, &retFlag4);
483  FwPrAddFlowActToFin(p_pr, N3, &retFlag4);
484 
485  if (FwPrCheck(p_pr)==prSuccess)
486  return p_pr;
487  else
488  return NULL;
489 }
490 
491 /* ----------------------------------------------------------------------------------------------------------------- */
493  const FwPrCounterS1_t nOfANodes = 3; /* Number of action nodes */
494  const FwPrCounterS1_t nOfDNodes = 1; /* Number of decision nodes */
495  const FwPrCounterS1_t nOfFlows = 7; /* Number of control flows */
496  const FwPrCounterS1_t nOfActions = 1; /* Number of actions */
497  const FwPrCounterS1_t nOfGuards = 4; /* Number of guards */
498  FwPrDesc_t p_pr;
499 
500  /* Create and configure the procedure */
501  p_pr = FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
502  FwPrSetData(p_pr, prData);
503 
504  FwPrAddActionNode(p_pr, N1, &incrCnt1By1);
505  FwPrAddActionNode(p_pr, N2, &incrCnt1By1);
506  FwPrAddActionNode(p_pr, N3, &incrCnt1By1);
507  FwPrAddDecisionNode(p_pr, D1, 3);
508 
509  FwPrAddFlowIniToDec(p_pr, D1, NULL);
510  FwPrAddFlowDecToAct(p_pr, D1, N3, &retFlag3);
511  FwPrAddFlowDecToAct(p_pr, D1, N2, &retFlag2);
512  FwPrAddFlowDecToAct(p_pr, D1, N1, &retFlag1);
513  FwPrAddFlowActToFin(p_pr, N1, &retFlag4);
514  FwPrAddFlowActToFin(p_pr, N2, &retFlag4);
515  FwPrAddFlowActToFin(p_pr, N3, &retFlag4);
516 
517  if (FwPrCheck(p_pr)==prSuccess)
518  return p_pr;
519  else
520  return NULL;
521 }
522 
523 /* ----------------------------------------------------------------------------------------------------------------- */
525  const FwPrCounterS1_t nOfANodes = 3; /* Number of action nodes */
526  const FwPrCounterS1_t nOfDNodes = 1; /* Number of decision nodes */
527  const FwPrCounterS1_t nOfFlows = 7; /* Number of control flows */
528  const FwPrCounterS1_t nOfActions = 1; /* Number of actions */
529  const FwPrCounterS1_t nOfGuards = 4; /* Number of guards */
530  FwPrDesc_t p_pr;
531 
532  /* Create and configure the procedure */
533  p_pr = FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
534  FwPrSetData(p_pr, prData);
535 
536  FwPrAddActionNode(p_pr, N1, &incrCnt1By1);
537  FwPrAddActionNode(p_pr, N2, &incrCnt1By1);
538  FwPrAddActionNode(p_pr, N3, &incrCnt1By1);
539  FwPrAddDecisionNode(p_pr, D1, 3);
540 
541  FwPrAddFlowIniToDec(p_pr, D1, NULL);
542  FwPrAddFlowDecToAct(p_pr, D1, N2, &retFlag2);
543  FwPrAddFlowDecToAct(p_pr, D1, N3, &retFlag3);
544  FwPrAddFlowDecToAct(p_pr, D1, N1, &retFlag1);
545  FwPrAddFlowActToFin(p_pr, N1, &retFlag4);
546  FwPrAddFlowActToFin(p_pr, N2, &retFlag4);
547  FwPrAddFlowActToFin(p_pr, N3, &retFlag4);
548 
549  if (FwPrCheck(p_pr)==prSuccess)
550  return p_pr;
551  else
552  return NULL;
553 }
554 /*-------------------------------------------------------------------------------------------------*/
555 FwPrDesc_t FwPrMakeTestPRDer1(FwPrDesc_t prDescBase, struct TestPrData* prData) {
556  FwPrDesc_t p_pr;
557 
558  /* Create and configure the derived state machine */
559  p_pr = FwPrCreateDer(prDescBase);
560  FwPrOverrideAction(p_pr, &incrCnt1By1, &incrCnt1By8);
561  FwPrOverrideGuard(p_pr, &retFlag1, &retFlag2);
562  FwPrSetData(p_pr, prData);
563 
564  return p_pr;
565 }
566 
567 /*-------------------------------------------------------------------------------------------------*/
569 
570  /* Instantiate a derived procedure. The number of actions and of guards
571  * of the derived procedure must be the same as number of actions and of
572  * guards of the base procedure.
573  */
574  FW_PR_INST_DER(prDescDer, 1, 8)
575  FwPrDesc_t p_pr = &prDescDer;
576 
577  /* Initialize the derived procedure */
578  FwPrInitDer(p_pr, prDescBase);
579 
580  /* Configure the derived procedure */
581  FwPrOverrideAction(p_pr, &incrCnt1By1, &incrCnt1By8);
582  FwPrOverrideGuard(p_pr, &retFlag1, &retFlag2);
583  FwPrSetData(p_pr, prData);
584 
585  return p_pr;
586 }
587 
Structure representing a decision node in a procedure.
Definition: FwPrPrivate.h:121
#define FW_PR_INST(PR_DESC, N, NDEC, NFLOWS, NA, NG)
Instantiate a procedure descriptor and its internal data structure.
Definition: FwPrSCreate.h:102
FwPrDesc_t FwPrMakeTestPR1Static(struct TestPrData *prData)
Operation to create and configure the procedure PR1 (see FwPrMakeTestPR1 and figure below) statically...
Definition: FwPrMakeTest.c:205
Structure representing an action node in a procedure.
Definition: FwPrPrivate.h:98
FwPrCounterS1_t nOfGuards
the number of guards in the procedure
Definition: FwPrPrivate.h:264
int fwPrLogIndex
Location in the log array where the next entry is written.
Definition: FwPrMakeTest.c:35
void FwPrInitDer(FwPrDesc_t prDesc, FwPrDesc_t prDescBase)
Initialize a procedure descriptor to extend another procedure (the base procedure).
Definition: FwPrSCreate.c:51
#define LOG_ARRAY_SIZE
Size of the log arrays.
Definition: FwPrMakeTest.h:46
void FwPrOverrideGuard(FwPrDesc_t prDesc, FwPrGuard_t oldGuard, FwPrGuard_t newGuard)
Override a guard in a derived procedure.
Definition: FwPrConfig.c:448
FwPrCounterS1_t iAction
index of the action attached to the node
Definition: FwPrPrivate.h:102
int flag_6
Flag used in the procedure control flows.
Definition: FwPrMakeTest.h:79
Structure representing the base descriptor of a procedure.
Definition: FwPrPrivate.h:186
void * prData
the pointer to the data manipulated by the procedure actions and guards
Definition: FwPrPrivate.h:276
void FwPrAddFlowIniToDec(FwPrDesc_t prDesc, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from the initial node to a decision node and add it to a procedure.
Definition: FwPrConfig.c:180
FwPrCounterS1_t nOfActions
the number of actions in the procedure
Definition: FwPrPrivate.h:262
void FwPrAddFlowActToDec(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from an action node to a decision node and add it to a procedure.
Definition: FwPrConfig.c:190
FwPrCounterS1_t nOfANodes
the number of action nodes in the procedure
Definition: FwPrPrivate.h:194
FwPrDesc_t FwPrMakeTestPR4(struct TestPrData *prData)
Operation to create the test procedure PR4.
Definition: FwPrMakeTest.c:404
void FwPrInit(FwPrDesc_t prDesc)
Initialize a procedure descriptor to represent an unconfigured procedure with no control flows...
Definition: FwPrSCreate.c:23
FwPrCounterS1_t dest
the index of the destination of the control flow
Definition: FwPrPrivate.h:154
PrFlow_t * flows
array holding the control flows in the procedure
Definition: FwPrPrivate.h:192
FwPrCounterS1_t nOfFlows
the number of control flows in the procedure (excluding control flow from initial node) ...
Definition: FwPrPrivate.h:198
PrBaseDesc_t * prBase
pointer to the base descriptor
Definition: FwPrPrivate.h:256
int flag_2
Flag used in the procedure control flows.
Definition: FwPrMakeTest.h:71
FwPrDesc_t FwPrMakeTestPR2Dir(struct TestPrData *prData)
Operation to create the test procedure PR2 (see FwPrMakeTestPR2 and figure below) directly by instant...
Definition: FwPrMakeTest.c:267
FwPrDesc_t FwPrMakeTestPR2Static(struct TestPrData *prData)
Operation to create and configure the procedure PR2 (see FwPrMakeTestPR2 and figure below) statically...
Definition: FwPrMakeTest.c:347
FwPrDesc_t FwPrMakeTestPR3(struct TestPrData *prData)
Operation to create the test procedure PR3.
Definition: FwPrMakeTest.c:380
PrANode_t * aNodes
array holding the action nodes in the procedure
Definition: FwPrPrivate.h:188
#define FW_PR_INST_NODEC(PR_DESC, N, NFLOWS, NA, NG)
Instantiate a procedure descriptor and its internal data structure.
Definition: FwPrSCreate.h:153
#define N1
An action node identifier.
Definition: FwPrMakeTest.h:34
#define N2
An action node identifier.
Definition: FwPrMakeTest.h:36
void FwPrAddFlowDecToFin(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrGuard_t cfGuard)
Create a control flow from a decision node to the final node and add it to a procedure.
Definition: FwPrConfig.c:210
FwPrCounterS1_t flowCnt
the counter for the number of control flows added to the procedure
Definition: FwPrPrivate.h:266
int FwPrBool_t
Type used for booleans (0 is "false" and 1 is "true").
Definition: FwPrConstants.h:48
void FwPrOverrideAction(FwPrDesc_t prDesc, FwPrAction_t oldAction, FwPrAction_t newAction)
Override an action in a derived procedure.
Definition: FwPrConfig.c:429
int flag_1
Flag used in the procedure control flows.
Definition: FwPrMakeTest.h:69
PrDNode_t * dNodes
array holding the decision nodes in the procedure
Definition: FwPrPrivate.h:190
FwPrCounterS1_t iGuard
the index of the guard associated to the control flow
Definition: FwPrPrivate.h:156
int flag_4
Flag used in the procedure control flows.
Definition: FwPrMakeTest.h:75
int flag_5
Flag used in the procedure control flows.
Definition: FwPrMakeTest.h:77
FwPrDesc_t FwPrMakeTestPR6_2(struct TestPrData *prData)
Operation to create the test procedure PR6.
Definition: FwPrMakeTest.c:492
FwPrBool_t PrDummyGuard(FwPrDesc_t prDesc)
Dummy guard which always returns true.
Definition: FwPrCore.c:23
FwPrDesc_t FwPrMakeTestPR6_1(struct TestPrData *prData)
Operation to create the test procedure PR6.
Definition: FwPrMakeTest.c:460
void FwPrAddFlowActToFin(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrGuard_t cfGuard)
Create a control flow from an action node to the final node and add it to a procedure.
Definition: FwPrConfig.c:205
void FwPrAddFlowActToAct(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from an action node to another action node and add it to a procedure.
Definition: FwPrConfig.c:185
FwPrDesc_t FwPrCreate(FwPrCounterS1_t nOfANodes, FwPrCounterS1_t nOfDNodes, FwPrCounterS1_t nOfFlows, FwPrCounterS1_t nOfActions, FwPrCounterS1_t nOfGuards)
Create a new procedure descriptor.
Definition: FwPrDCreate.c:23
#define FW_PR_INST_DER(PR_DESC, NA, NG)
Instantiate a descriptor for a derived procedure.
Definition: FwPrSCreate.h:197
int fwPrLogNode[LOG_ARRAY_SIZE]
Log array where the actions of the test procedures write the current state of their procedure...
Definition: FwPrMakeTest.c:31
FwPrDesc_t FwPrCreateDer(FwPrDesc_t prDesc)
Create the descriptor of a derived procedure.
Definition: FwPrDCreate.c:132
void(* FwPrAction_t)(FwPrDesc_t)
Type for a pointer to a procedure action.
Definition: FwPrConstants.h:45
void * FwPrGetData(FwPrDesc_t prDesc)
Get the pointer to the procedure data in the procedure descriptor.
Definition: FwPrConfig.c:87
void FwPrSetData(FwPrDesc_t prDesc, void *prData)
Set the pointer to the procedure data in the procedure descriptor.
Definition: FwPrConfig.c:82
Structure representing a control flow.
Definition: FwPrPrivate.h:152
FwPrCounterU3_t nodeExecCnt
the node execution counter
Definition: FwPrPrivate.h:274
FwPrDesc_t FwPrMakeTestPRDer1Static(FwPrDesc_t prDescBase, struct TestPrData *prData)
Create a derived procedure and override one of its actions and one of its guards. ...
Definition: FwPrMakeTest.c:568
FwPrErrCode_t errCode
either &#39;success&#39; or the code of the last error encountered by the procedure
Definition: FwPrPrivate.h:270
FwPrDesc_t FwPrMakeTestPR2(struct TestPrData *prData)
Operation to create the test procedure PR2.
Definition: FwPrMakeTest.c:230
void FwPrAddFlowDecToDec(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from a decision node to another decision node and add it to a procedure...
Definition: FwPrConfig.c:200
FwPrCounterS1_t outFlowIndex
index of first out-going control flow in control flow array
Definition: FwPrPrivate.h:123
int fwPrLogMarker[LOG_ARRAY_SIZE]
Log array where the actions of the test procedures write their markers.
Definition: FwPrMakeTest.c:26
Declaration of the static creation interface for a FW Procedure.
FwPrDesc_t FwPrMakeTestPR5(struct TestPrData *prData)
Operation to create the test procedure PR5.
Definition: FwPrMakeTest.c:432
Return codes of a function which has completed execution without errors.
Definition: FwPrConstants.h:85
void FwPrAddDecisionNode(FwPrDesc_t prDesc, FwPrCounterS1_t nodeId, FwPrCounterS1_t nOfOutFlows)
Create a decision node with the given characteristics and add it to a procedure.
Definition: FwPrConfig.c:134
Declaration of functions to create and configure test procedures.
signed char FwPrCounterS1_t
Type used for signed counters with a "short" range.
Definition: FwPrConstants.h:78
Structure representing a procedure descriptor.
Definition: FwPrPrivate.h:254
FwPrCounterS1_t nOfOutTrans
number of outgoing control flows from the decision node
Definition: FwPrPrivate.h:125
FwPrAction_t * prActions
the procedure actions
Definition: FwPrPrivate.h:258
#define N3
An action node identifier.
Definition: FwPrMakeTest.h:38
FwPrDesc_t FwPrMakeTestPR1(struct TestPrData *prData)
Operation to create the test procedure PR1.
Definition: FwPrMakeTest.c:177
#define D2
A decision node identifier.
Definition: FwPrMakeTest.h:43
FwPrDesc_t FwPrMakeTestPR6_3(struct TestPrData *prData)
Operation to create the test procedure PR6.
Definition: FwPrMakeTest.c:524
FwPrCounterS1_t FwPrGetCurNode(FwPrDesc_t prDesc)
Return the identifier of the current action node in a procedure.
Definition: FwPrCore.c:117
struct TestPrData * GetTestPrData(FwPrDesc_t prDesc)
Get the pointer to the procedure data of a test procedure.
Definition: FwPrMakeTest.c:172
int counter_1
Counter incremented by the procedure actions.
Definition: FwPrMakeTest.h:65
int marker
Procedure&#39;s marker.
Definition: FwPrMakeTest.h:67
FwPrDesc_t FwPrMakeTestPRDer1(FwPrDesc_t prDescBase, struct TestPrData *prData)
Create a derived procedure and override one of its actions and one of its guards. ...
Definition: FwPrMakeTest.c:555
void FwPrAddFlowIniToAct(FwPrDesc_t prDesc, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from the initial node to an action node and add it to a procedure.
Definition: FwPrConfig.c:175
void FwPrAddActionNode(FwPrDesc_t prDesc, FwPrCounterS1_t nodeId, FwPrAction_t action)
Create an action node with the given characteristics and add it to a procedure.
Definition: FwPrConfig.c:92
#define D1
A decision node identifier.
Definition: FwPrMakeTest.h:41
FwPrErrCode_t FwPrCheck(FwPrDesc_t prDesc)
Check the correctness and completeness of the configuration of a procedure descriptor.
Definition: FwPrConfig.c:341
FwPrCounterS1_t iFlow
index of out-going control flows
Definition: FwPrPrivate.h:100
FwPrCounterU3_t prExecCnt
the procedure execution counter
Definition: FwPrPrivate.h:272
FwPrGuard_t * prGuards
the control flow guards in the procedure
Definition: FwPrPrivate.h:260
Type for the data structure passed to all procedures made by the functions declared by this header fi...
Definition: FwPrMakeTest.h:63
FwPrCounterS1_t nOfDNodes
the number of decision nodes in the procedure
Definition: FwPrPrivate.h:196
int flag_3
Flag used in the procedure control flows.
Definition: FwPrMakeTest.h:73
void FwPrAddFlowDecToAct(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from a decision node to an action node and add it to a procedure.
Definition: FwPrConfig.c:195
FwPrCounterS1_t curNode
the current node of the procedure
Definition: FwPrPrivate.h:268
FwPrBool_t(* FwPrGuard_t)(FwPrDesc_t)
Type for a pointer to a procedure guard.
Definition: FwPrConstants.h:63
P&P Software GmbH, Copyright 2011, All Rights Reserved