from
Code Coverage Tool
by Mark Walker
Code Coverage Tool measures C statement coverage in generated code.
|
| controller_model_cov.html |
RTW Report - controller_model.c
1 /* .....
2 ..... * File: controller_model.c
3 ..... *
4 ..... * Real-Time Workshop code generated for Simulink model controller_model.
5 ..... *
6 ..... * Model version : 1.79
7 ..... * Real-Time Workshop file version : 7.2 (R2008b) 04-Aug-2008
8 ..... * Real-Time Workshop file generated on : Thu May 14 12:41:13 2009
9 ..... * TLC version : 7.2 (Aug 5 2008)
10 ..... * C/C++ source code generated on : Thu May 14 12:41:14 2009
11 ..... */
12 .....
13 ..... #include "controller_model.h"
14 ..... #include "controller_model_private.h"
15 .....
16 ..... /* Exported block signals */
17 ..... uint8_T result; /* '<S1>/Gain' */
18 .....
19 ..... /* Block signals (auto storage) */
20 ..... BlockIO_controller_model controller_model_B;
21 .....
22 ..... /* External inputs (root inport signals with auto storage) */
23 ..... ExternalInputs_controller_model controller_model_U;
24 .....
25 ..... /* Real-time model */
26 ..... RT_MODEL_controller_model controller_model_M_;
27 ..... RT_MODEL_controller_model *controller_model_M = &controller_model_M_;
28 .....
29 ..... /* Model step function */
30 ..... void controller_model_step(void)
31 00011 {
32 ..... {
33 ..... int32_T tmp;
34 ..... uint8_T tmp_0;
35 .....
36 ..... /* Outputs for atomic SubSystem: '<Root>/controller_model' */
37 .....
38 ..... /* Stateflow: '<S1>/Chart' incorporates:
39 ..... * Inport: '<Root>/In1'
40 ..... * SubSystem: '<S1>/result 1'
41 ..... * SubSystem: '<S1>/result 2'
42 ..... * SubSystem: '<S1>/result 3'
43 ..... */
44 ..... /* Gateway: controller_model/Chart */
45 ..... /* During: controller_model/Chart */
46 ..... /* Transition: '<S2>:1' */
47 00011 if (controller_model_U.In1 > 1) {
48 ..... /* Transition: '<S2>:2' */
49 ..... /* Transition: '<S2>:4' */
50 ..... /* Event: '<S2>:25' */
51 .....
52 ..... /* Product: '<S3>/Product' incorporates:
53 ..... * Constant: '<S3>/Constant'
54 ..... * Inport: '<Root>/In1'
55 ..... */
56 00007 controller_model_B.Merge = (uint8_T)(uint32_T)(((uint8_T)5U) *
57 ..... controller_model_U.In1);
58 00007 if (controller_model_U.In1 > 2) {
59 ..... /* Transition: '<S2>:6' */
60 ..... /* Transition: '<S2>:8' */
61 ..... /* Event: '<S2>:26' */
62 .....
63 ..... /* Product: '<S4>/Product' incorporates:
64 ..... * Constant: '<S4>/Constant'
65 ..... * Inport: '<Root>/In1'
66 ..... */
67 00005 controller_model_B.Merge = (uint8_T)(uint32_T)(((uint8_T)6U) *
68 ..... controller_model_U.In1);
69 00005 if (controller_model_U.In1 > 3) {
70 ..... /* Transition: '<S2>:7' */
71 ..... /* Transition: '<S2>:5' */
72 ..... /* Event: '<S2>:27' */
73 .....
74 ..... /* Product: '<S5>/Product' incorporates:
75 ..... * Constant: '<S5>/Constant'
76 ..... * Inport: '<Root>/In1'
77 ..... */
78 ##### controller_model_B.Merge = (uint8_T)(uint32_T)(((uint8_T)7U) *
79 ..... controller_model_U.In1);
80 .....
81 ..... /* Transition: '<S2>:11' */
82 ##### } else {
83 ..... /* Transition: '<S2>:10' */
84 ..... }
85 .....
86 ..... /* Transition: '<S2>:12' */
87 ##### } else {
88 ..... /* Transition: '<S2>:9' */
89 ..... }
90 .....
91 ..... /* Transition: '<S2>:13' */
92 00011 } else {
93 ..... /* Transition: '<S2>:3' */
94 ..... }
95 .....
96 ..... /* Gain: '<S1>/Gain' */
97 00011 tmp = ((uint8_T)128U) * controller_model_B.Merge;
98 00011 tmp = ((uint32_T)(tmp & 32) != 0U) + (int32_T)((uint32_T)tmp >> 6);
99 00011 if ((uint32_T)tmp > 255U) {
100 ##### tmp_0 = MAX_uint8_T;
101 00011 } else {
102 00011 tmp_0 = (uint8_T)tmp;
103 ..... }
104 .....
105 00011 result = tmp_0;
106 .....
107 ..... /* end of Outputs for SubSystem: '<Root>/controller_model' */
108 ..... }
109 00011 }
110 .....
111 ..... /* Model initialize function */
112 ..... void controller_model_initialize(boolean_T firstTime)
113 00001 {
114 00001 (void)firstTime;
115 .....
116 ..... /* Registration code */
117 .....
118 ..... /* initialize real-time model */
119 00001 (void) memset((void *)controller_model_M,0,
120 ..... sizeof(RT_MODEL_controller_model));
121 00001 rtmSetFirstInitCond(controller_model_M, 1);
122 .....
123 ..... /* block I/O */
124 00001 (void) memset(((void *) &controller_model_B),0,
125 ..... sizeof(BlockIO_controller_model));
126 .....
127 ..... /* exported global signals */
128 00001 result = 0;
129 .....
130 ..... /* external inputs */
131 00001 controller_model_U.In1 = 0;
132 .....
133 ..... /* InitializeConditions for atomic SubSystem: '<Root>/controller_model' */
134 .....
135 ..... /* InitializeConditions for Merge: '<S1>/Merge' */
136 00001 if (rtmIsFirstInitCond(controller_model_M)) {
137 00001 controller_model_B.Merge = ((uint8_T)0U);
138 ..... }
139 .....
140 ..... /* end of InitializeConditions for SubSystem: '<Root>/controller_model' */
141 .....
142 ..... /* set "at time zero" to false */
143 00001 if (rtmIsFirstInitCond(controller_model_M)) {
144 00001 rtmSetFirstInitCond(controller_model_M, 0);
145 ..... }
146 00001 }
147 .....
148 ..... /* Model terminate function */
149 ..... void controller_model_terminate(void)
150 00001 {
151 ..... /* user code (Terminate function Body) */
152 00001 __cct_dump();
153 00001 }
154 .....
155 ..... /* File trailer for Real-Time Workshop generated code.
156 ..... *
157 ..... * [EOF]
158 ..... */
|
|
|
Contact us at files@mathworks.com