##// END OF EJS Templates
SM simulator functionnal...
paul -
r100:e4348633316b VHDLib206
parent child
Show More
@@ -1,339 +1,339
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 3.0.0, 2014-02-19T07:19:44. -->
3 <!-- Written by QtCreator 3.0.0, 2014-02-20T06:55:01. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 7 <value type="int">1</value>
8 8 </data>
9 9 <data>
10 10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 11 <valuemap type="QVariantMap">
12 12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
15 15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
16 16 <value type="QString" key="language">Cpp</value>
17 17 <valuemap type="QVariantMap" key="value">
18 18 <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
19 19 </valuemap>
20 20 </valuemap>
21 21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
22 22 <value type="QString" key="language">QmlJS</value>
23 23 <valuemap type="QVariantMap" key="value">
24 24 <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
25 25 </valuemap>
26 26 </valuemap>
27 27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
28 28 <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
29 29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
30 30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
31 31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
32 32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
33 33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
34 34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
35 35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
36 36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
37 37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
38 38 <value type="int" key="EditorConfiguration.TabSize">8</value>
39 39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
40 40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
41 41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
42 42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
43 43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
44 44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
45 45 </valuemap>
46 46 </data>
47 47 <data>
48 48 <variable>ProjectExplorer.Project.PluginSettings</variable>
49 49 <valuemap type="QVariantMap"/>
50 50 </data>
51 51 <data>
52 52 <variable>ProjectExplorer.Project.Target.0</variable>
53 53 <valuemap type="QVariantMap">
54 54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
55 55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
56 56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e04e3924-0bd8-4708-be18-f1474e45608e}</value>
57 57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
58 58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
59 59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
60 60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
61 61 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
62 62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
63 63 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
64 64 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
65 65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
66 66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
67 67 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
68 68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
69 69 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
70 70 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
71 71 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
72 72 </valuemap>
73 73 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
74 74 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
75 75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
76 76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
77 77 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
78 78 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
79 79 <value type="QString">-w</value>
80 80 <value type="QString">-r</value>
81 81 </valuelist>
82 82 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
83 83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
84 84 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
85 85 </valuemap>
86 86 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
87 87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
88 88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
89 89 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
90 90 </valuemap>
91 91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
92 92 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
93 93 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
94 94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
95 95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
96 96 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
97 97 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
98 98 <value type="QString">-w</value>
99 99 <value type="QString">-r</value>
100 100 </valuelist>
101 101 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
102 102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
103 103 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
104 104 </valuemap>
105 105 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
106 106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
107 107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
108 108 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
109 109 </valuemap>
110 110 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
111 111 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
112 112 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
113 113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
114 114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
115 115 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
116 116 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
117 117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
118 118 </valuemap>
119 119 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
120 120 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
121 121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
122 122 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
123 123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
124 124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
125 125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
126 126 </valuemap>
127 127 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
128 128 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
129 129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
130 130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
131 131 </valuemap>
132 132 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
133 133 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
134 134 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
135 135 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
136 136 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
137 137 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
138 138 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
139 139 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
140 140 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
141 141 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
142 142 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
143 143 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
144 144 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
145 145 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
146 146 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
147 147 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
148 148 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
149 149 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
150 150 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
151 151 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
152 152 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
153 153 <value type="int">0</value>
154 154 <value type="int">1</value>
155 155 <value type="int">2</value>
156 156 <value type="int">3</value>
157 157 <value type="int">4</value>
158 158 <value type="int">5</value>
159 159 <value type="int">6</value>
160 160 <value type="int">7</value>
161 161 <value type="int">8</value>
162 162 <value type="int">9</value>
163 163 <value type="int">10</value>
164 164 <value type="int">11</value>
165 165 <value type="int">12</value>
166 166 <value type="int">13</value>
167 167 <value type="int">14</value>
168 168 </valuelist>
169 169 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
170 170 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
171 171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
172 172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
173 173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
174 174 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
175 175 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
176 176 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
177 177 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
178 178 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
179 179 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
180 180 <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
181 181 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
182 182 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
183 183 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
184 184 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
185 185 </valuemap>
186 186 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
187 187 </valuemap>
188 188 </data>
189 189 <data>
190 190 <variable>ProjectExplorer.Project.Target.1</variable>
191 191 <valuemap type="QVariantMap">
192 192 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
193 193 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
194 194 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
195 195 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
196 196 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
197 197 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
198 198 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
199 199 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
200 200 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
201 201 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
202 202 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
203 203 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
204 204 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
205 205 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
206 206 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
207 207 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
208 208 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
209 209 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
210 210 </valuemap>
211 211 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
212 212 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
213 213 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
214 214 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
215 215 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
216 216 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
217 217 <value type="QString">-w</value>
218 218 <value type="QString">-r</value>
219 219 </valuelist>
220 220 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
221 221 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
222 222 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
223 223 </valuemap>
224 224 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
225 225 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
226 226 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
227 227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
228 228 </valuemap>
229 229 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
230 230 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
231 231 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
232 232 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
233 233 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
234 234 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
235 235 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
236 236 <value type="QString">-w</value>
237 237 <value type="QString">-r</value>
238 238 </valuelist>
239 239 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
240 240 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
241 241 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
242 242 </valuemap>
243 243 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
244 244 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
245 245 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
246 246 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
247 247 </valuemap>
248 248 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
249 249 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
250 250 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
251 251 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
252 252 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
253 253 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
254 254 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
255 255 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
256 256 </valuemap>
257 257 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
258 258 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
259 259 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
260 260 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
261 261 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
262 262 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
263 263 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
264 264 </valuemap>
265 265 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
266 266 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
267 267 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
268 268 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
269 269 </valuemap>
270 270 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
271 271 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
272 272 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
273 273 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
274 274 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
275 275 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
276 276 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
277 277 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
278 278 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
279 279 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
280 280 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
281 281 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
282 282 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
283 283 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
284 284 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
285 285 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
286 286 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
287 287 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
288 288 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
289 289 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
290 290 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
291 291 <value type="int">0</value>
292 292 <value type="int">1</value>
293 293 <value type="int">2</value>
294 294 <value type="int">3</value>
295 295 <value type="int">4</value>
296 296 <value type="int">5</value>
297 297 <value type="int">6</value>
298 298 <value type="int">7</value>
299 299 <value type="int">8</value>
300 300 <value type="int">9</value>
301 301 <value type="int">10</value>
302 302 <value type="int">11</value>
303 303 <value type="int">12</value>
304 304 <value type="int">13</value>
305 305 <value type="int">14</value>
306 306 </valuelist>
307 307 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
308 308 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
309 309 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
310 310 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
311 311 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
312 312 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
313 313 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
314 314 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
315 315 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
316 316 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
317 317 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
318 318 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
319 319 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
320 320 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
321 321 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
322 322 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
323 323 </valuemap>
324 324 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
325 325 </valuemap>
326 326 </data>
327 327 <data>
328 328 <variable>ProjectExplorer.Project.TargetCount</variable>
329 329 <value type="int">2</value>
330 330 </data>
331 331 <data>
332 332 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
333 333 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
334 334 </data>
335 335 <data>
336 336 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
337 337 <value type="int">15</value>
338 338 </data>
339 339 </qtcreator>
@@ -1,612 +1,609
1 1 #ifndef CCSDS_TYPES_H_INCLUDED
2 2 #define CCSDS_TYPES_H_INCLUDED
3 3
4 4 #include "fsw_params_processing.h"
5 5
6 6 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
7 7 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
8 8 #define CCSDS_TM_PKT_MAX_SIZE 4412
9 9 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
10 10 #define CCSDS_TC_PKT_MAX_SIZE 256
11 11 #define CCSDS_TC_PKT_MIN_SIZE 16
12 12 #define CCSDS_TC_TM_PACKET_OFFSET 7
13 13 #define CCSDS_PROCESS_ID 76
14 14 #define CCSDS_PACKET_CATEGORY 12
15 15 #define CCSDS_NODE_ADDRESS 0xfe
16 16 #define CCSDS_USER_APP 0x00
17 17
18 18 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
19 19 #define DEFAULT_RESERVED 0x00
20 20 #define DEFAULT_HKBIA 0x1e // 0001 1110
21 21
22 22 // PACKET ID
23 23 #define TM_PACKET_ID_TC_EXE 0x0cc1 // PID 76 CAT 1
24 24 #define TM_PACKET_ID_HK 0x0cc4 // PID 76 CAT 4
25 25 #define TM_PACKET_ID_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
26 26 #define TM_PACKET_ID_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
27 27 #define TM_PACKET_ID_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
28 28 #define TM_PACKET_PID_DEFAULT 76
29 29 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
30 30 #define TM_PACKET_CAT_TC_EXE 1
31 31 #define TM_PACKET_CAT_HK 4
32 32 #define TM_PACKET_CAT_PARAMETER_DUMP 9
33 33 #define TM_PACKET_CAT_SCIENCE 12
34 34
35 35 // PACKET SEQUENCE CONTROL
36 36 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
37 37 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
38 38 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
39 39 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
40 40 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
41 41
42 42 // DESTINATION ID
43 43 #define TM_DESTINATION_ID_GROUND 0
44 44 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
45 45 #define TM_DESTINATION_ID_TC_SEQUENCES 111
46 46 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
47 47 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
48 48 #define TM_DESTINATION_ID_DIRECT_CMD 120
49 49 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
50 50 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
51 51 #define TM_DESTINATION_ID_OBCP 15
52 52 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
53 53 #define TM_DESTINATION_ID_AOCS 11
54 54
55 55 #define CCSDS_DESTINATION_ID 0x01
56 56 #define CCSDS_PROTOCOLE_ID 0x02
57 57 #define CCSDS_RESERVED 0x00
58 58 #define CCSDS_USER_APP 0x00
59 59
60 60 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
61 61 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
62 62 #define SIZE_HK_PARAMETERS 112
63 63
64 64 // TC TYPES
65 65 #define TC_TYPE_GEN 181
66 66 #define TC_TYPE_TIME 9
67 67
68 68 // TC SUBTYPES
69 69 #define TC_SUBTYPE_RESET 1
70 70 #define TC_SUBTYPE_LOAD_COMM 11
71 71 #define TC_SUBTYPE_LOAD_NORM 13
72 72 #define TC_SUBTYPE_LOAD_BURST 19
73 73 #define TC_SUBTYPE_LOAD_SBM1 25
74 74 #define TC_SUBTYPE_LOAD_SBM2 27
75 75 #define TC_SUBTYPE_DUMP 31
76 76 #define TC_SUBTYPE_ENTER 41
77 77 #define TC_SUBTYPE_UPDT_INFO 51
78 78 #define TC_SUBTYPE_EN_CAL 61
79 79 #define TC_SUBTYPE_DIS_CAL 63
80 80 #define TC_SUBTYPE_UPDT_TIME 129
81 81
82 82 // TC LEN
83 83 #define TC_LEN_RESET 12
84 84 #define TC_LEN_LOAD_COMM 14
85 85 #define TC_LEN_LOAD_NORM 22
86 86 #define TC_LEN_LOAD_BURST 14
87 87 #define TC_LEN_LOAD_SBM1 14
88 88 #define TC_LEN_LOAD_SBM2 14
89 89 #define TC_LEN_DUMP 12
90 90 #define TC_LEN_ENTER 20
91 91 #define TC_LEN_UPDT_INFO 46
92 92 #define TC_LEN_EN_CAL 12
93 93 #define TC_LEN_DIS_CAL 12
94 94 #define TC_LEN_UPDT_TIME 18
95 95
96 96 // TM TYPES
97 97 #define TM_TYPE_TC_EXE 1
98 98 #define TM_TYPE_HK 3
99 99 #define TM_TYPE_PARAMETER_DUMP 3
100 100 #define TM_TYPE_LFR_SCIENCE 21
101 101
102 102 // TM SUBTYPES
103 103 #define TM_SUBTYPE_EXE_OK 7
104 104 #define TM_SUBTYPE_EXE_NOK 8
105 105 #define TM_SUBTYPE_HK 25
106 106 #define TM_SUBTYPE_PARAMETER_DUMP 25
107 107 #define TM_SUBTYPE_SCIENCE 3
108 108 #define TM_SUBTYPE_LFR_SCIENCE 3
109 109
110 110 // FAILURE CODES
111 111 #define ILLEGAL_APID 0
112 112 #define WRONG_LEN_PKT 1
113 113 #define INCOR_CHECKSUM 2
114 114 #define ILL_TYPE 3
115 115 #define ILL_SUBTYPE 4
116 116 #define WRONG_APP_DATA 5 // 0x00 0x05
117 117 #define TC_NOT_EXE 42000 // 0xa4 0x10
118 118 #define WRONG_SRC_ID 42001 // 0xa4 0x11
119 119 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
120 120 #define FAIL_DETECTED 42003 // 0xa4 0x13
121 121 #define NOT_ALLOWED 42004 // 0xa4 0x14
122 122 #define CORRUPTED 42005 // 0xa4 0x15
123 123 #define CCSDS_TM_VALID 7
124 124
125 125 // TC SID
126 126 #define SID_TC_GROUND 0
127 127 #define SID_TC_MISSION_TIMELINE 110
128 128 #define SID_TC_TC_SEQUENCES 111
129 129 #define SID_TC_RECOVERY_ACTION_CMD 112
130 130 #define SID_TC_BACKUP_MISSION_TIMELINE 113
131 131 #define SID_TC_DIRECT_CMD 120
132 132 #define SID_TC_SPARE_GRD_SRC1 121
133 133 #define SID_TC_SPARE_GRD_SRC2 122
134 134 #define SID_TC_OBCP 15
135 135 #define SID_TC_SYSTEM_CONTROL 14
136 136 #define SID_TC_AOCS 11
137 137 #define SID_TC_RPW_INTERNAL 254
138 138
139 139 enum apid_destid{
140 140 GROUND,
141 141 MISSION_TIMELINE,
142 142 TC_SEQUENCES,
143 143 RECOVERY_ACTION_CMD,
144 144 BACKUP_MISSION_TIMELINE,
145 145 DIRECT_CMD,
146 146 SPARE_GRD_SRC1,
147 147 SPARE_GRD_SRC2,
148 148 OBCP,
149 149 SYSTEM_CONTROL,
150 150 AOCS,
151 151 RPW_INTERNAL
152 152 };
153 153 // SEQUENCE COUNTERS
154 154 #define SEQ_CNT_MAX 16383
155 155 #define SEQ_CNT_NB_DEST_ID 12
156 156
157 157 // TM SID
158 158 #define SID_HK 1
159 159 #define SID_PARAMETER_DUMP 10
160 160
161 161 #define SID_NORM_SWF_F0 3
162 162 #define SID_NORM_SWF_F1 4
163 163 #define SID_NORM_SWF_F2 5
164 164 #define SID_NORM_CWF_F3 1
165 165 #define SID_BURST_CWF_F2 2
166 166 #define SID_SBM1_CWF_F1 24
167 167 #define SID_SBM2_CWF_F2 25
168 168 #define SID_NORM_ASM_F0 11
169 169 #define SID_NORM_ASM_F1 12
170 170 #define SID_NORM_ASM_F2 13
171 171 #define SID_NORM_BP1_F0 14
172 172 #define SID_NORM_BP1_F1 15
173 173 #define SID_NORM_BP1_F2 16
174 174 #define SID_NORM_BP2_F0 19
175 175 #define SID_NORM_BP2_F1 20
176 176 #define SID_NORM_BP2_F2 21
177 177 #define SID_BURST_BP1_F0 17
178 178 #define SID_BURST_BP2_F0 22
179 179 #define SID_BURST_BP1_F1 18
180 180 #define SID_BURST_BP2_F1 23
181 181 #define SID_SBM1_BP1_F0 28
182 182 #define SID_SBM1_BP2_F0 31
183 183 #define SID_SBM2_BP1_F0 29
184 184 #define SID_SBM2_BP2_F0 32
185 185 #define SID_SBM2_BP1_F1 30
186 186 #define SID_SBM2_BP2_F1 33
187 187 #define SID_NORM_CWF_LONG_F3 34
188 188
189 189 // LENGTH (BYTES)
190 190 #define LENGTH_TM_LFR_TC_EXE_MAX 32
191 191 #define LENGTH_TM_LFR_HK 126
192 192
193 193 // HEADER_LENGTH
194 194 #define TM_HEADER_LEN 16
195 195 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
196 196 // PACKET_LENGTH
197 197 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
198 198 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
199 199 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
200 200 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
201 201 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
202 202 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
203 203 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
204 204 #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (TOTAL_SIZE_ASM_F0 + HEADER_LENGTH_TM_LFR_SCIENCE_ASM - CCSDS_TC_TM_PACKET_OFFSET)
206 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (TOTAL_SIZE_ASM_F1 + HEADER_LENGTH_TM_LFR_SCIENCE_ASM - CCSDS_TC_TM_PACKET_OFFSET)
207 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (TOTAL_SIZE_ASM_F2 + HEADER_LENGTH_TM_LFR_SCIENCE_ASM - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 2221 // 44 * 25 * 2 + 28 - 7
206 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 2621 // 52 * 25 * 2 + 28 - 7
207 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 2421 // 48 * 25 * 2 + 28 - 7
208 208
209 209 #define SPARE1_PUSVERSION_SPARE2 0x10
210 210
211 #define LEN_TM_LFR_HK 130 // 126 + 4
212 #define LEN_TM_LFR_TC_EXE_NOT_IMP 28 // 24 + 4
213
214 211 // R1
215 212 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
216 213 #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1
217 214 #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1
218 215 #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1
219 216 #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1
220 217 #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1
221 218 // R2
222 219 #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1
223 220 #define TM_LEN_SCI_SWF_224 2709 // 224 * 12 + 10 + 12 - 1
224 221 #define TM_LEN_SCI_CWF_336 4051 // 336 * 12 + 10 + 10 - 1
225 222 #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1
226 223 //
227 224 #define DEFAULT_PKTCNT 0x07
228 225 #define BLK_NR_304 0x0130
229 226 #define BLK_NR_224 0x00e0
230 227 #define BLK_NR_CWF 0x0150 // 336
231 228 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
232 229
233 230 enum TM_TYPE{
234 231 TM_LFR_TC_EXE_OK,
235 232 TM_LFR_TC_EXE_ERR,
236 233 TM_LFR_HK,
237 234 TM_LFR_SCI,
238 235 TM_LFR_SCI_SBM,
239 236 TM_LFR_PAR_DUMP
240 237 };
241 238
242 239 typedef struct {
243 240 unsigned char targetLogicalAddress;
244 241 unsigned char protocolIdentifier;
245 242 unsigned char reserved;
246 243 unsigned char userApplication;
247 244 // PACKET HEADER
248 245 unsigned char packetID[2];
249 246 unsigned char packetSequenceControl[2];
250 247 unsigned char packetLength[2];
251 248 // DATA FIELD HEADER
252 249 unsigned char spare1_pusVersion_spare2;
253 250 unsigned char serviceType;
254 251 unsigned char serviceSubType;
255 252 unsigned char destinationID;
256 253 unsigned char time[6];
257 254 //
258 255 unsigned char telecommand_pkt_id[2];
259 256 unsigned char pkt_seq_control[2];
260 257 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
261 258
262 259 typedef struct {
263 260 unsigned char targetLogicalAddress;
264 261 unsigned char protocolIdentifier;
265 262 unsigned char reserved;
266 263 unsigned char userApplication;
267 264 // PACKET HEADER
268 265 unsigned char packetID[2];
269 266 unsigned char packetSequenceControl[2];
270 267 unsigned char packetLength[2];
271 268 // DATA FIELD HEADER
272 269 unsigned char spare1_pusVersion_spare2;
273 270 unsigned char serviceType;
274 271 unsigned char serviceSubType;
275 272 unsigned char destinationID;
276 273 unsigned char time[6];
277 274 //
278 275 unsigned char tc_failure_code[2];
279 276 unsigned char telecommand_pkt_id[2];
280 277 unsigned char pkt_seq_control[2];
281 278 unsigned char tc_service;
282 279 unsigned char tc_subtype;
283 280 unsigned char byte_position;
284 281 unsigned char rcv_value;
285 282 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
286 283
287 284 typedef struct {
288 285 unsigned char targetLogicalAddress;
289 286 unsigned char protocolIdentifier;
290 287 unsigned char reserved;
291 288 unsigned char userApplication;
292 289 // PACKET HEADER
293 290 unsigned char packetID[2];
294 291 unsigned char packetSequenceControl[2];
295 292 unsigned char packetLength[2];
296 293 // DATA FIELD HEADER
297 294 unsigned char spare1_pusVersion_spare2;
298 295 unsigned char serviceType;
299 296 unsigned char serviceSubType;
300 297 unsigned char destinationID;
301 298 unsigned char time[6];
302 299 //
303 300 unsigned char tc_failure_code[2];
304 301 unsigned char telecommand_pkt_id[2];
305 302 unsigned char pkt_seq_control[2];
306 303 unsigned char tc_service;
307 304 unsigned char tc_subtype;
308 305 unsigned char lfr_status_word[2];
309 306 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
310 307
311 308 typedef struct {
312 309 unsigned char targetLogicalAddress;
313 310 unsigned char protocolIdentifier;
314 311 unsigned char reserved;
315 312 unsigned char userApplication;
316 313 // PACKET HEADER
317 314 unsigned char packetID[2];
318 315 unsigned char packetSequenceControl[2];
319 316 unsigned char packetLength[2];
320 317 // DATA FIELD HEADER
321 318 unsigned char spare1_pusVersion_spare2;
322 319 unsigned char serviceType;
323 320 unsigned char serviceSubType;
324 321 unsigned char destinationID;
325 322 unsigned char time[6];
326 323 //
327 324 unsigned char tc_failure_code[2];
328 325 unsigned char telecommand_pkt_id[2];
329 326 unsigned char pkt_seq_control[2];
330 327 unsigned char tc_service;
331 328 unsigned char tc_subtype;
332 329 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
333 330
334 331 typedef struct {
335 332 unsigned char targetLogicalAddress;
336 333 unsigned char protocolIdentifier;
337 334 unsigned char reserved;
338 335 unsigned char userApplication;
339 336 // PACKET HEADER
340 337 unsigned char packetID[2];
341 338 unsigned char packetSequenceControl[2];
342 339 unsigned char packetLength[2];
343 340 // DATA FIELD HEADER
344 341 unsigned char spare1_pusVersion_spare2;
345 342 unsigned char serviceType;
346 343 unsigned char serviceSubType;
347 344 unsigned char destinationID;
348 345 unsigned char time[6];
349 346 //
350 347 unsigned char tc_failure_code[2];
351 348 unsigned char telecommand_pkt_id[2];
352 349 unsigned char pkt_seq_control[2];
353 350 unsigned char tc_service;
354 351 unsigned char tc_subtype;
355 352 } Packet_TM_LFR_TC_EXE_ERROR_t;
356 353
357 354 typedef struct {
358 355 unsigned char targetLogicalAddress;
359 356 unsigned char protocolIdentifier;
360 357 unsigned char reserved;
361 358 unsigned char userApplication;
362 359 // PACKET HEADER
363 360 unsigned char packetID[2];
364 361 unsigned char packetSequenceControl[2];
365 362 unsigned char packetLength[2];
366 363 // DATA FIELD HEADER
367 364 unsigned char spare1_pusVersion_spare2;
368 365 unsigned char serviceType;
369 366 unsigned char serviceSubType;
370 367 unsigned char destinationID;
371 368 unsigned char time[6];
372 369 //
373 370 unsigned char tc_failure_code[2];
374 371 unsigned char telecommand_pkt_id[2];
375 372 unsigned char pkt_seq_control[2];
376 373 unsigned char tc_service;
377 374 unsigned char tc_subtype;
378 375 unsigned char pkt_len_rcv_value[2];
379 376 unsigned char pkt_datafieldsize_cnt[2];
380 377 unsigned char rcv_crc[2];
381 378 unsigned char computed_crc[2];
382 379 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
383 380
384 381 typedef struct {
385 382 unsigned char targetLogicalAddress;
386 383 unsigned char protocolIdentifier;
387 384 unsigned char reserved;
388 385 unsigned char userApplication;
389 386 unsigned char packetID[2];
390 387 unsigned char packetSequenceControl[2];
391 388 unsigned char packetLength[2];
392 389 // DATA FIELD HEADER
393 390 unsigned char spare1_pusVersion_spare2;
394 391 unsigned char serviceType;
395 392 unsigned char serviceSubType;
396 393 unsigned char destinationID;
397 394 unsigned char time[6];
398 395 // AUXILIARY HEADER
399 396 unsigned char sid;
400 397 unsigned char hkBIA;
401 398 unsigned char pktCnt;
402 399 unsigned char pktNr;
403 400 unsigned char acquisitionTime[6];
404 401 unsigned char blkNr[2];
405 402 } Header_TM_LFR_SCIENCE_SWF_t;
406 403
407 404 typedef struct {
408 405 unsigned char targetLogicalAddress;
409 406 unsigned char protocolIdentifier;
410 407 unsigned char reserved;
411 408 unsigned char userApplication;
412 409 unsigned char packetID[2];
413 410 unsigned char packetSequenceControl[2];
414 411 unsigned char packetLength[2];
415 412 // DATA FIELD HEADER
416 413 unsigned char spare1_pusVersion_spare2;
417 414 unsigned char serviceType;
418 415 unsigned char serviceSubType;
419 416 unsigned char destinationID;
420 417 unsigned char time[6];
421 418 // AUXILIARY DATA HEADER
422 419 unsigned char sid;
423 420 unsigned char hkBIA;
424 421 unsigned char acquisitionTime[6];
425 422 unsigned char blkNr[2];
426 423 } Header_TM_LFR_SCIENCE_CWF_t;
427 424
428 425 typedef struct {
429 426 unsigned char targetLogicalAddress;
430 427 unsigned char protocolIdentifier;
431 428 unsigned char reserved;
432 429 unsigned char userApplication;
433 430 unsigned char packetID[2];
434 431 unsigned char packetSequenceControl[2];
435 432 unsigned char packetLength[2];
436 433 // DATA FIELD HEADER
437 434 unsigned char spare1_pusVersion_spare2;
438 435 unsigned char serviceType;
439 436 unsigned char serviceSubType;
440 437 unsigned char destinationID;
441 438 unsigned char time[6];
442 439 // AUXILIARY HEADER
443 440 unsigned char sid;
444 441 unsigned char biaStatusInfo;
445 442 unsigned char pa_lfr_pkt_cnt_asm;
446 443 unsigned char pa_lfr_pkt_nr_asm;
447 444 unsigned char acquisitionTime[6];
448 445 unsigned char pa_lfr_asm_blk_nr[2];
449 446 } Header_TM_LFR_SCIENCE_ASM_t;
450 447
451 448 typedef struct {
452 449 //targetLogicalAddress is removed by the grspw module
453 450 unsigned char protocolIdentifier;
454 451 unsigned char reserved;
455 452 unsigned char userApplication;
456 453 unsigned char packetID[2];
457 454 unsigned char packetSequenceControl[2];
458 455 unsigned char packetLength[2];
459 456 // DATA FIELD HEADER
460 457 unsigned char headerFlag_pusVersion_Ack;
461 458 unsigned char serviceType;
462 459 unsigned char serviceSubType;
463 460 unsigned char sourceID;
464 461 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
465 462 } ccsdsTelecommandPacket_t;
466 463
467 464 typedef struct {
468 465 unsigned char targetLogicalAddress;
469 466 unsigned char protocolIdentifier;
470 467 unsigned char reserved;
471 468 unsigned char userApplication;
472 469 unsigned char packetID[2];
473 470 unsigned char packetSequenceControl[2];
474 471 unsigned char packetLength[2];
475 472 unsigned char spare1_pusVersion_spare2;
476 473 unsigned char serviceType;
477 474 unsigned char serviceSubType;
478 475 unsigned char destinationID;
479 476 unsigned char time[6];
480 477 unsigned char sid;
481 478
482 479 //**************
483 480 // HK PARAMETERS
484 481 unsigned char lfr_status_word[2];
485 482 unsigned char lfr_sw_version[4];
486 483 unsigned char lfr_fpga_version[3];
487 484 // ressource statistics
488 485 unsigned char hk_lfr_cpu_load;
489 486 unsigned char hk_lfr_load_max;
490 487 unsigned char hk_lfr_load_aver;
491 488 // tc statistics
492 489 unsigned char hk_lfr_update_info_tc_cnt[2];
493 490 unsigned char hk_lfr_update_time_tc_cnt[2];
494 491 unsigned char hk_lfr_exe_tc_cnt[2];
495 492 unsigned char hk_lfr_rej_tc_cnt[2];
496 493 unsigned char hk_lfr_last_exe_tc_id[2];
497 494 unsigned char hk_lfr_last_exe_tc_type[2];
498 495 unsigned char hk_lfr_last_exe_tc_subtype[2];
499 496 unsigned char hk_lfr_last_exe_tc_time[6];
500 497 unsigned char hk_lfr_last_rej_tc_id[2];
501 498 unsigned char hk_lfr_last_rej_tc_type[2];
502 499 unsigned char hk_lfr_last_rej_tc_subtype[2];
503 500 unsigned char hk_lfr_last_rej_tc_time[6];
504 501 // anomaly statistics
505 502 unsigned char hk_lfr_le_cnt[2];
506 503 unsigned char hk_lfr_me_cnt[2];
507 504 unsigned char hk_lfr_he_cnt[2];
508 505 unsigned char hk_lfr_last_er_rid[2];
509 506 unsigned char hk_lfr_last_er_code;
510 507 unsigned char hk_lfr_last_er_time[6];
511 508 // vhdl_blk_status
512 509 unsigned char hk_lfr_vhdl_aa_sm;
513 510 unsigned char hk_lfr_vhdl_fft_sr;
514 511 unsigned char hk_lfr_vhdl_cic_hk;
515 512 unsigned char hk_lfr_vhdl_iir_cal;
516 513 // spacewire_if_statistics
517 514 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
518 515 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
519 516 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
520 517 unsigned char hk_lfr_dpu_spw_last_timc;
521 518 // ahb error statistics
522 519 unsigned int hk_lfr_last_fail_addr;
523 520 // temperatures
524 521 unsigned char hk_lfr_temp_scm[2];
525 522 unsigned char hk_lfr_temp_pcb[2];
526 523 unsigned char hk_lfr_temp_fpga[2];
527 524 // spacecraft potential
528 525 unsigned char hk_lfr_sc_v_f3[2];
529 526 unsigned char hk_lfr_sc_e1_f3[2];
530 527 unsigned char hk_lfr_sc_e2_f3[2];
531 528 // error counters
532 529 unsigned char hk_lfr_dpu_spw_parity;
533 530 unsigned char hk_lfr_dpu_spw_disconnect;
534 531 unsigned char hk_lfr_dpu_spw_escape;
535 532 unsigned char hk_lfr_dpu_spw_credit;
536 533 unsigned char hk_lfr_dpu_spw_write_sync;
537 534 unsigned char hk_lfr_dpu_spw_rx_ahb;
538 535 unsigned char hk_lfr_dpu_spw_tx_ahb;
539 536 unsigned char hk_lfr_dpu_spw_early_eop;
540 537 unsigned char hk_lfr_dpu_spw_invalid_addr;
541 538 unsigned char hk_lfr_dpu_spw_eep;
542 539 unsigned char hk_lfr_dpu_spw_rx_too_big;
543 540 // timecode
544 541 unsigned char hk_lfr_timecode_erroneous;
545 542 unsigned char hk_lfr_timecode_missing;
546 543 unsigned char hk_lfr_timecode_invalid;
547 544 // time
548 545 unsigned char hk_lfr_time_timecode_it;
549 546 unsigned char hk_lfr_time_not_synchro;
550 547 unsigned char hk_lfr_time_timecode_ctr;
551 548 // hk_lfr_buffer_dpu_
552 549 unsigned char hk_lfr_buffer_dpu_tc_fifo;
553 550 unsigned char hk_lfr_buffer_dpu_tm_fifo;
554 551 // hk_lfr_ahb_
555 552 unsigned char hk_lfr_ahb_correctable;
556 553 unsigned char hk_lfr_ahb_uncorrectable;
557 554 // spare
558 555 unsigned char parameters_spare;
559 556 } Packet_TM_LFR_HK_t;
560 557
561 558 typedef struct {
562 559 unsigned char targetLogicalAddress;
563 560 unsigned char protocolIdentifier;
564 561 unsigned char reserved;
565 562 unsigned char userApplication;
566 563 unsigned char packetID[2];
567 564 unsigned char packetSequenceControl[2];
568 565 unsigned char packetLength[2];
569 566 // DATA FIELD HEADER
570 567 unsigned char spare1_pusVersion_spare2;
571 568 unsigned char serviceType;
572 569 unsigned char serviceSubType;
573 570 unsigned char destinationID;
574 571 unsigned char time[6];
575 572 unsigned char sid;
576 573
577 574 //******************
578 575 // COMMON PARAMETERS
579 576 unsigned char unused0;
580 577 unsigned char bw_sp0_sp1_r0_r1;
581 578
582 579 //******************
583 580 // NORMAL PARAMETERS
584 581 unsigned char sy_lfr_n_swf_l[2];
585 582 unsigned char sy_lfr_n_swf_p[2];
586 583 unsigned char sy_lfr_n_asm_p[2];
587 584 unsigned char sy_lfr_n_bp_p0;
588 585 unsigned char sy_lfr_n_bp_p1;
589 586 unsigned char sy_lfr_n_cwf_long_f3;
590 587 unsigned char lfr_normal_parameters_spare;
591 588
592 589 //*****************
593 590 // BURST PARAMETERS
594 591 unsigned char sy_lfr_b_bp_p0;
595 592 unsigned char sy_lfr_b_bp_p1;
596 593
597 594 //****************
598 595 // SBM1 PARAMETERS
599 596 unsigned char sy_lfr_s1_bp_p0;
600 597 unsigned char sy_lfr_s1_bp_p1;
601 598
602 599 //****************
603 600 // SBM2 PARAMETERS
604 601 unsigned char sy_lfr_s2_bp_p0;
605 602 unsigned char sy_lfr_s2_bp_p1;
606 603
607 604 // SPARE
608 605 unsigned char source_data_spare;
609 606 } Packet_TM_LFR_PARAMETER_DUMP_t;
610 607
611 608
612 609 #endif // CCSDS_TYPES_H_INCLUDED
@@ -1,42 +1,45
1 1 #ifndef FSW_PARAMS_PROCESSING_H
2 2 #define FSW_PARAMS_PROCESSING_H
3 3
4 4 #define NB_BINS_PER_SM 128 //
5 5 #define NB_VALUES_PER_SM 25 //
6 6 #define TOTAL_SIZE_SM 3200 // 25 * 128
7 7 #define SM_HEADER 0 //
8 8 //
9 9 #define NB_BINS_PER_ASM_F0 88
10 #define TOTAL_SIZE_ASM_F0 2200 // 25 * 88
10 #define NB_BINS_PER_PKT_ASM_F0 44
11 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
11 12 #define ASM_F0_INDICE_START 17 // 88 bins
12 13 #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins
13 14 //
14 15 #define NB_BINS_PER_ASM_F1 104
16 #define NB_BINS_PER_PKT_ASM_F1 52
15 17 #define TOTAL_SIZE_ASM_F1 2600 // 25 * 104
16 18 #define ASM_F1_INDICE_START 6 // 104 bins
17 19 #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins
18 20 //
19 21 #define NB_BINS_PER_ASM_F2 96
22 #define NB_BINS_PER_PKT_ASM_F2 48
20 23 #define TOTAL_SIZE_ASM_F2 2400 // 25 * 96
21 24 #define ASM_F2_INDICE_START 7 // 96 bins
22 25 #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins
23 26 //
24 27 #define NB_BINS_COMPRESSED_SM_F0 11
25 28 #define NB_BINS_COMPRESSED_SM_F1 13
26 29 #define NB_BINS_COMPRESSED_SM_F2 12
27 30 //
28 31 #define TOTAL_SIZE_COMPRESSED_MATRIX_f0 (NB_BINS_COMPRESSED_SM_F0 * NB_VALUES_PER_SM)
29 32 #define NB_AVERAGE_NORMAL_f0 96*4
30 33 #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8
31 34
32 35 typedef struct {
33 36 volatile unsigned char PE[2];
34 37 volatile unsigned char PB[2];
35 38 volatile unsigned char V0;
36 39 volatile unsigned char V1;
37 40 volatile unsigned char V2_ELLIP_DOP;
38 41 volatile unsigned char SZ;
39 42 volatile unsigned char VPHI;
40 43 } BP1_t;
41 44
42 45 #endif // FSW_PARAMS_PROCESSING_H
@@ -1,90 +1,90
1 1 #ifndef WF_HANDLER_H_INCLUDED
2 2 #define WF_HANDLER_H_INCLUDED
3 3
4 4 #include <rtems.h>
5 5 #include <grspw.h>
6 6 #include <stdio.h>
7 7 #include <math.h>
8 8
9 9 #include "fsw_params.h"
10 10 #include "fsw_spacewire.h"
11 11 #include "fsw_misc.h"
12 12
13 13 #define pi 3.1415
14 14
15 15 extern int fdSPW;
16 16
17 17 //*****************
18 18 // waveform buffers
19 19 // F0
20 20 //extern volatile int wf_snap_f0[ ];
21 21 // F1 F2
22 extern volatile int wf_snap_f0[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ];
23 extern volatile int wf_snap_f1[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ];
24 extern volatile int wf_snap_f2[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ];
22 extern volatile int wf_snap_f0[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
23 extern volatile int wf_snap_f1[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
24 extern volatile int wf_snap_f2[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
25 25 // F3
26 26 extern volatile int wf_cont_f3_a[ ];
27 27 extern volatile int wf_cont_f3_b[ ];
28 28 extern char wf_cont_f3_light[ ];
29 29
30 30 extern waveform_picker_regs_new_t *waveform_picker_regs;
31 31 extern time_management_regs_t *time_management_regs;
32 32 extern Packet_TM_LFR_HK_t housekeeping_packet;
33 33 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
34 34 extern struct param_local_str param_local;
35 35
36 36 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
37 37 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
38 38
39 39 extern rtems_id Task_id[20]; /* array of task ids */
40 40
41 41 extern unsigned char lfrCurrentMode;
42 42
43 43 rtems_isr waveforms_isr( rtems_vector_number vector );
44 44 rtems_isr waveforms_isr_alt( rtems_vector_number vector );
45 45 rtems_task wfrm_task( rtems_task_argument argument );
46 46 rtems_task cwf3_task( rtems_task_argument argument );
47 47 rtems_task cwf2_task( rtems_task_argument argument );
48 48 rtems_task cwf1_task( rtems_task_argument argument );
49 49
50 50 //******************
51 51 // general functions
52 52 void init_waveforms( void );
53 53 void init_waveform_rings( void );
54 54 void reset_current_ring_nodes( void );
55 55 //
56 56 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF );
57 57 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
58 58 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
59 59 //
60 60 int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id );
61 61 int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
62 62 int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
63 63 int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
64 64 //
65 65 void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime,
66 66 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime );
67 67 //
68 68 rtems_id get_pkts_queue_id( void );
69 69
70 70 //**************
71 71 // wfp registers
72 72 // RESET
73 73 void reset_wfp_burst_enable( void );
74 74 void reset_wfp_status(void);
75 75 void reset_waveform_picker_regs( void );
76 76 // SET
77 77 void set_wfp_data_shaping(void);
78 78 void set_wfp_burst_enable_register( unsigned char mode );
79 79 void set_wfp_delta_snapshot( void );
80 80 void set_wfp_delta_f0_f0_2( void );
81 81 void set_wfp_delta_f1( void );
82 82 void set_wfp_delta_f2( void );
83 83
84 84 //*****************
85 85 // local parameters
86 86 void set_local_nb_interrupt_f0_MAX( void );
87 87
88 88 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
89 89
90 90 #endif // WF_HANDLER_H_INCLUDED
@@ -1,70 +1,72
1 1 /** Global variables of the LFR flight software.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 * Among global variables, there are:
7 7 * - RTEMS names and id.
8 8 * - APB configuration registers.
9 9 * - waveforms global buffers, used by the waveform picker hardware module to store data.
10 10 * - spectral matrices buffesr, used by the hardware module to store data.
11 11 * - variable related to LFR modes parameters.
12 12 * - the global HK packet buffer.
13 13 * - the global dump parameter buffer.
14 14 *
15 15 */
16 16
17 17 #include <rtems.h>
18 18 #include <grspw.h>
19 19
20 20 #include "ccsds_types.h"
21 21 #include "grlib_regs.h"
22 22 #include "fsw_params.h"
23 23
24 24 // RTEMS GLOBAL VARIABLES
25 25 rtems_name misc_name[5];
26 26 rtems_id misc_id[5];
27 27 rtems_name Task_name[20]; /* array of task names */
28 28 rtems_id Task_id[20]; /* array of task ids */
29 29 unsigned int maxCount;
30 30 int fdSPW = 0;
31 31 int fdUART = 0;
32 32 unsigned char lfrCurrentMode;
33 33
34 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes
34 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes = 24584
35 // 97 * 256 = 24832 => delta = 248 bytes = 62 words
36 // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264
37 // 127 * 256 = 32512 => delta = 248 bytes = 62 words
35 38 // F0
36 //volatile int wf_snap_f0 [ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ] __attribute__((aligned(0x100)));
37 volatile int wf_snap_f0[ NB_RING_NODES_F0 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ] __attribute__((aligned(0x100)));
39 volatile int wf_snap_f0[ NB_RING_NODES_F0 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
38 40 // F1 F2
39 volatile int wf_snap_f1[ NB_RING_NODES_F1 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ] __attribute__((aligned(0x100)));
40 volatile int wf_snap_f2[ NB_RING_NODES_F2 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ] __attribute__((aligned(0x100)));
41 volatile int wf_snap_f1[ NB_RING_NODES_F1 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
42 volatile int wf_snap_f2[ NB_RING_NODES_F2 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
41 43 // F3
42 44 volatile int wf_cont_f3_a [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
43 45 volatile int wf_cont_f3_b [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
44 46 char wf_cont_f3_light[ (NB_SAMPLES_PER_SNAPSHOT) * NB_BYTES_CWF3_LIGHT_BLK + TIME_OFFSET_IN_BYTES ] __attribute__((aligned(0x100)));
45 47
46 48 // SPECTRAL MATRICES GLOBAL VARIABLES
47 volatile int sm_f0[ NB_RING_NODES_ASM_F0 ][ SM_HEADER + TOTAL_SIZE_SM ];
48 volatile int sm_f1[ NB_RING_NODES_ASM_F1 ][ SM_HEADER + TOTAL_SIZE_SM ];
49 volatile int sm_f2[ NB_RING_NODES_ASM_F2 ][ SM_HEADER + TOTAL_SIZE_SM ];
49 volatile int sm_f0[ NB_RING_NODES_ASM_F0 ][ SM_HEADER + TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
50 volatile int sm_f1[ NB_RING_NODES_ASM_F1 ][ SM_HEADER + TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
51 volatile int sm_f2[ NB_RING_NODES_ASM_F2 ][ SM_HEADER + TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
50 52
51 53 // APB CONFIGURATION REGISTERS
52 54 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
53 55 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
54 56 waveform_picker_regs_new_t *waveform_picker_regs = (waveform_picker_regs_new_t*) REGS_ADDR_WAVEFORM_PICKER;
55 57 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
56 58
57 59 // MODE PARAMETERS
58 60 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
59 61 struct param_local_str param_local;
60 62
61 63 // HK PACKETS
62 64 Packet_TM_LFR_HK_t housekeeping_packet;
63 65 // sequence counters are incremented by APID (PID + CAT) and destination ID
64 66 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
65 67 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
66 68 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
67 69 spw_stats spacewire_stats;
68 70 spw_stats spacewire_stats_backup;
69 71
70 72
@@ -1,341 +1,343
1 1 /** General usage functions and RTEMS tasks.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 */
7 7
8 8 #include "fsw_misc.h"
9 9
10 10 void configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider,
11 11 unsigned char interrupt_level, rtems_isr (*timer_isr)() )
12 12 {
13 13 /** This function configures a GPTIMER timer instantiated in the VHDL design.
14 14 *
15 15 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
16 16 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
17 17 * @param clock_divider is the divider of the 1 MHz clock that will be configured.
18 18 * @param interrupt_level is the interrupt level that the timer drives.
19 19 * @param timer_isr is the interrupt subroutine that will be attached to the IRQ driven by the timer.
20 20 *
21 21 * Interrupt levels are described in the SPARC documentation sparcv8.pdf p.76
22 22 *
23 23 */
24 24
25 25 rtems_status_code status;
26 26 rtems_isr_entry old_isr_handler;
27 27
28 gptimer_regs->timer[timer].ctrl = 0x00; // reset the control register
29
28 30 status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels
29 31 if (status!=RTEMS_SUCCESSFUL)
30 32 {
31 33 PRINTF("in configure_timer *** ERR rtems_interrupt_catch\n")
32 34 }
33 35
34 36 timer_set_clock_divider( gptimer_regs, timer, clock_divider);
35 37 }
36 38
37 39 void timer_start(gptimer_regs_t *gptimer_regs, unsigned char timer)
38 40 {
39 41 /** This function starts a GPTIMER timer.
40 42 *
41 43 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
42 44 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
43 45 *
44 46 */
45 47
46 48 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any
47 49 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000004; // LD load value from the reload register
48 50 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000001; // EN enable the timer
49 51 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000002; // RS restart
50 52 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000008; // IE interrupt enable
51 53 }
52 54
53 55 void timer_stop(gptimer_regs_t *gptimer_regs, unsigned char timer)
54 56 {
55 57 /** This function stops a GPTIMER timer.
56 58 *
57 59 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
58 60 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
59 61 *
60 62 */
61 63
62 64 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xfffffffe; // EN enable the timer
63 65 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xffffffef; // IE interrupt enable
64 66 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any
65 67 }
66 68
67 69 void timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider)
68 70 {
69 71 /** This function sets the clock divider of a GPTIMER timer.
70 72 *
71 73 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
72 74 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
73 75 * @param clock_divider is the divider of the 1 MHz clock that will be configured.
74 76 *
75 77 */
76 78
77 79 gptimer_regs->timer[timer].reload = clock_divider; // base clock frequency is 1 MHz
78 80 }
79 81
80 82 int send_console_outputs_on_apbuart_port( void ) // Send the console outputs on the apbuart port
81 83 {
82 84 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART;
83 85
84 86 apbuart_regs->ctrl = APBUART_CTRL_REG_MASK_TE;
85 87
86 88 return 0;
87 89 }
88 90
89 91 int enable_apbuart_transmitter( void ) // set the bit 1, TE Transmitter Enable to 1 in the APBUART control register
90 92 {
91 93 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART;
92 94
93 95 apbuart_regs->ctrl = apbuart_regs->ctrl | APBUART_CTRL_REG_MASK_TE;
94 96
95 97 return 0;
96 98 }
97 99
98 100 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value)
99 101 {
100 102 /** This function sets the scaler reload register of the apbuart module
101 103 *
102 104 * @param regs is the address of the apbuart registers in memory
103 105 * @param value is the value that will be stored in the scaler register
104 106 *
105 107 * The value shall be set by the software to get data on the serial interface.
106 108 *
107 109 */
108 110
109 111 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs;
110 112
111 113 apbuart_regs->scaler = value;
112 114 BOOT_PRINTF1("OK *** apbuart port scaler reload register set to 0x%x\n", value)
113 115 }
114 116
115 117 //************
116 118 // RTEMS TASKS
117 119
118 120 rtems_task stat_task(rtems_task_argument argument)
119 121 {
120 122 int i;
121 123 int j;
122 124 i = 0;
123 125 j = 0;
124 126 BOOT_PRINTF("in STAT *** \n")
125 127 while(1){
126 128 rtems_task_wake_after(1000);
127 129 PRINTF1("%d\n", j)
128 130 if (i == CPU_USAGE_REPORT_PERIOD) {
129 131 // #ifdef PRINT_TASK_STATISTICS
130 132 // rtems_cpu_usage_report();
131 133 // rtems_cpu_usage_reset();
132 134 // #endif
133 135 i = 0;
134 136 }
135 137 else i++;
136 138 j++;
137 139 }
138 140 }
139 141
140 142 rtems_task hous_task(rtems_task_argument argument)
141 143 {
142 144 rtems_status_code status;
143 145 rtems_id queue_id;
144 146
145 147 status = get_message_queue_id_send( &queue_id );
146 148 if (status != RTEMS_SUCCESSFUL)
147 149 {
148 150 PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status)
149 151 }
150 152
151 153 BOOT_PRINTF("in HOUS ***\n")
152 154
153 155 if (rtems_rate_monotonic_ident( name_hk_rate_monotonic, &HK_id) != RTEMS_SUCCESSFUL) {
154 156 status = rtems_rate_monotonic_create( name_hk_rate_monotonic, &HK_id );
155 157 if( status != RTEMS_SUCCESSFUL ) {
156 158 PRINTF1( "rtems_rate_monotonic_create failed with status of %d\n", status )
157 159 }
158 160 }
159 161
160 162 housekeeping_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
161 163 housekeeping_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
162 164 housekeeping_packet.reserved = DEFAULT_RESERVED;
163 165 housekeeping_packet.userApplication = CCSDS_USER_APP;
164 166 housekeeping_packet.packetID[0] = (unsigned char) (TM_PACKET_ID_HK >> 8);
165 167 housekeeping_packet.packetID[1] = (unsigned char) (TM_PACKET_ID_HK);
166 168 housekeeping_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
167 169 housekeeping_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
168 170 housekeeping_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> 8);
169 171 housekeeping_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
170 172 housekeeping_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
171 173 housekeeping_packet.serviceType = TM_TYPE_HK;
172 174 housekeeping_packet.serviceSubType = TM_SUBTYPE_HK;
173 175 housekeeping_packet.destinationID = TM_DESTINATION_ID_GROUND;
174 176 housekeeping_packet.sid = SID_HK;
175 177
176 178 status = rtems_rate_monotonic_cancel(HK_id);
177 179 if( status != RTEMS_SUCCESSFUL ) {
178 180 PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_cancel(HK_id) ***code: %d\n", status )
179 181 }
180 182 else {
181 183 DEBUG_PRINTF("OK *** in HOUS *** rtems_rate_monotonic_cancel(HK_id)\n")
182 184 }
183 185
184 186 while(1){ // launch the rate monotonic task
185 187 status = rtems_rate_monotonic_period( HK_id, HK_PERIOD );
186 188 if ( status != RTEMS_SUCCESSFUL ) {
187 189 PRINTF1( "in HOUS *** ERR period: %d\n", status);
188 190 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 );
189 191 }
190 192 else {
191 193 increment_seq_counter( housekeeping_packet.packetSequenceControl );
192 194 housekeeping_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
193 195 housekeeping_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
194 196 housekeeping_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
195 197 housekeeping_packet.time[3] = (unsigned char) (time_management_regs->coarse_time);
196 198 housekeeping_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
197 199 housekeeping_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
198 200
199 201 spacewire_update_statistics();
200 202
201 203 // SEND PACKET
202 204 status = rtems_message_queue_send( queue_id, &housekeeping_packet,
203 205 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
204 206 if (status != RTEMS_SUCCESSFUL) {
205 207 PRINTF1("in HOUS *** ERR send: %d\n", status)
206 208 }
207 209 }
208 210 }
209 211
210 212 PRINTF("in HOUS *** deleting task\n")
211 213
212 214 status = rtems_task_delete( RTEMS_SELF ); // should not return
213 215 printf( "rtems_task_delete returned with status of %d.\n", status );
214 216 return;
215 217 }
216 218
217 219 rtems_task dumb_task( rtems_task_argument unused )
218 220 {
219 221 /** This RTEMS taks is used to print messages without affecting the general behaviour of the software.
220 222 *
221 223 * @param unused is the starting argument of the RTEMS task
222 224 *
223 225 * The DUMB taks waits for RTEMS events and print messages depending on the incoming events.
224 226 *
225 227 */
226 228
227 229 unsigned int i;
228 230 unsigned int intEventOut;
229 231 unsigned int coarse_time = 0;
230 232 unsigned int fine_time = 0;
231 233 rtems_event_set event_out;
232 234
233 235 char *DumbMessages[8] = {"in DUMB *** default", // RTEMS_EVENT_0
234 236 "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1
235 237 "in DUMB *** waveforms_isr", // RTEMS_EVENT_2
236 238 "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3
237 239 "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4
238 240 "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5
239 241 "ERR HK", // RTEMS_EVENT_6
240 242 "ready for dump" // RTEMS_EVENT_7
241 243 };
242 244
243 245 BOOT_PRINTF("in DUMB *** \n")
244 246
245 247 while(1){
246 248 rtems_event_receive(RTEMS_EVENT_0 | RTEMS_EVENT_1 | RTEMS_EVENT_2 | RTEMS_EVENT_3
247 249 | RTEMS_EVENT_4 | RTEMS_EVENT_5 | RTEMS_EVENT_6 | RTEMS_EVENT_7,
248 250 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT
249 251 intEventOut = (unsigned int) event_out;
250 252 for ( i=0; i<32; i++)
251 253 {
252 254 if ( ((intEventOut >> i) & 0x0001) != 0)
253 255 {
254 256 coarse_time = time_management_regs->coarse_time;
255 257 fine_time = time_management_regs->fine_time;
256 258 printf("in DUMB *** coarse: %x, fine: %x, %s\n", coarse_time, fine_time, DumbMessages[i]);
257 259 PRINTF1("status = %x\n", waveform_picker_regs->status)
258 260 }
259 261 }
260 262 }
261 263 }
262 264
263 265 //*****************************
264 266 // init housekeeping parameters
265 267
266 268 void init_housekeeping_parameters( void )
267 269 {
268 270 /** This function initialize the housekeeping_packet global variable with default values.
269 271 *
270 272 */
271 273
272 274 unsigned int i = 0;
273 275 unsigned char *parameters;
274 276
275 277 parameters = (unsigned char*) &housekeeping_packet.lfr_status_word;
276 278 for(i = 0; i< SIZE_HK_PARAMETERS; i++)
277 279 {
278 280 parameters[i] = 0x00;
279 281 }
280 282 // init status word
281 283 housekeeping_packet.lfr_status_word[0] = DEFAULT_STATUS_WORD_BYTE0;
282 284 housekeeping_packet.lfr_status_word[1] = DEFAULT_STATUS_WORD_BYTE1;
283 285 // init software version
284 286 housekeeping_packet.lfr_sw_version[0] = SW_VERSION_N1;
285 287 housekeeping_packet.lfr_sw_version[1] = SW_VERSION_N2;
286 288 housekeeping_packet.lfr_sw_version[2] = SW_VERSION_N3;
287 289 housekeeping_packet.lfr_sw_version[3] = SW_VERSION_N4;
288 290 // init fpga version
289 291 parameters = (unsigned char *) (REGS_ADDR_WAVEFORM_PICKER + 0xd0);
290 292 housekeeping_packet.lfr_fpga_version[0] = parameters[1]; // n1
291 293 housekeeping_packet.lfr_fpga_version[1] = parameters[2]; // n2
292 294 housekeeping_packet.lfr_fpga_version[2] = parameters[3]; // n3
293 295 }
294 296
295 297 void increment_seq_counter( unsigned char *packet_sequence_control)
296 298 {
297 299 /** This function increment the sequence counter psased in argument.
298 300 *
299 301 * The increment does not affect the grouping flag. In case of an overflow, the counter is reset to 0.
300 302 *
301 303 */
302 304
303 305 unsigned short sequence_cnt;
304 306 unsigned short segmentation_grouping_flag;
305 307 unsigned short new_packet_sequence_control;
306 308
307 309 segmentation_grouping_flag = (unsigned short) ( (packet_sequence_control[0] & 0xc0) << 8 ); // keep bits 7 downto 6
308 310 sequence_cnt = (unsigned short) (
309 311 ( (packet_sequence_control[0] & 0x3f) << 8 ) // keep bits 5 downto 0
310 312 + packet_sequence_control[1]
311 313 );
312 314
313 315 if ( sequence_cnt < SEQ_CNT_MAX)
314 316 {
315 317 sequence_cnt = sequence_cnt + 1;
316 318 }
317 319 else
318 320 {
319 321 sequence_cnt = 0;
320 322 }
321 323
322 324 new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ;
323 325
324 326 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
325 327 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
326 328 }
327 329
328 330 void getTime( unsigned char *time)
329 331 {
330 332 /** This function write the current local time in the time buffer passed in argument.
331 333 *
332 334 */
333 335
334 336 time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
335 337 time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
336 338 time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
337 339 time[3] = (unsigned char) (time_management_regs->coarse_time);
338 340 time[4] = (unsigned char) (time_management_regs->fine_time>>8);
339 341 time[5] = (unsigned char) (time_management_regs->fine_time);
340 342 }
341 343
@@ -1,687 +1,686
1 1 /** Functions related to data processing.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 * These function are related to data processing, i.e. spectral matrices averaging and basic parameters computation.
7 7 *
8 8 */
9 9
10 10 #include <fsw_processing.h>
11 11
12 12 #include "fsw_processing_globals.c"
13 13
14 14 //************************
15 15 // spectral matrices rings
16 16 ring_node sm_ring_f0[NB_RING_NODES_ASM_F0];
17 17 ring_node sm_ring_f1[NB_RING_NODES_ASM_F1];
18 18 ring_node sm_ring_f2[NB_RING_NODES_ASM_F2];
19 19 ring_node *current_ring_node_sm_f0;
20 20 ring_node *ring_node_for_averaging_sm_f0;
21 21 ring_node *current_ring_node_sm_f1;
22 22 ring_node *current_ring_node_sm_f2;
23 23
24 24 BP1_t data_BP1[ NB_BINS_COMPRESSED_SM_F0 ];
25 25 float averaged_sm_f0[ TOTAL_SIZE_SM ];
26 26 char averaged_sm_f0_char[ TOTAL_SIZE_SM * 2 ];
27 27 float compressed_sm_f0[ TOTAL_SIZE_COMPRESSED_MATRIX_f0 ];
28 28
29 29 unsigned int nb_sm_f0;
30 30
31 31 void init_sm_rings( void )
32 32 {
33 33 unsigned char i;
34 34
35 35 // F0 RING
36 36 sm_ring_f0[0].next = (ring_node*) &sm_ring_f0[1];
37 37 sm_ring_f0[0].previous = (ring_node*) &sm_ring_f0[NB_RING_NODES_ASM_F0-1];
38 38 sm_ring_f0[0].buffer_address = (int) &sm_f0[0][0];
39 39
40 40 sm_ring_f0[NB_RING_NODES_ASM_F0-1].next = (ring_node*) &sm_ring_f0[0];
41 41 sm_ring_f0[NB_RING_NODES_ASM_F0-1].previous = (ring_node*) &sm_ring_f0[NB_RING_NODES_ASM_F0-2];
42 42 sm_ring_f0[NB_RING_NODES_ASM_F0-1].buffer_address = (int) &sm_f0[NB_RING_NODES_ASM_F0-1][0];
43 43
44 44 for(i=1; i<NB_RING_NODES_ASM_F0-1; i++)
45 45 {
46 46 sm_ring_f0[i].next = (ring_node*) &sm_ring_f0[i+1];
47 47 sm_ring_f0[i].previous = (ring_node*) &sm_ring_f0[i-1];
48 48 sm_ring_f0[i].buffer_address = (int) &sm_f0[i][0];
49 49 }
50 50
51 51 DEBUG_PRINTF1("asm_ring_f0 @%x\n", (unsigned int) sm_ring_f0)
52 52
53 53 spectral_matrix_regs->matrixF0_Address0 = sm_ring_f0[0].buffer_address;
54 54 DEBUG_PRINTF1("spectral_matrix_regs->matrixF0_Address0 @%x\n", spectral_matrix_regs->matrixF0_Address0)
55 55 }
56 56
57 57 void reset_current_sm_ring_nodes( void )
58 58 {
59 59 current_ring_node_sm_f0 = sm_ring_f0;
60 60 ring_node_for_averaging_sm_f0 = sm_ring_f0;
61 61 }
62 62
63 63 //***********************************************************
64 64 // Interrupt Service Routine for spectral matrices processing
65 65 void reset_nb_sm_f0( void )
66 66 {
67 67 nb_sm_f0 = 0;
68 68 }
69 69
70 70 rtems_isr spectral_matrices_isr( rtems_vector_number vector )
71 71 {
72 72 // unsigned char status;
73 73 // unsigned char i;
74 74
75 75 // status = spectral_matrix_regs->status; //[f2 f1 f0_1 f0_0]
76 76 // for (i=0; i<4; i++)
77 77 // {
78 78 // if ( ( (status >> i) & 0x01) == 1) // (1) buffer rotation
79 79 // {
80 80 // switch(i)
81 81 // {
82 82 // case 0:
83 83 // current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
84 84 // spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
85 85 // spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe;
86 86 // nb_interrupt_f0 = nb_interrupt_f0 + 1;
87 87 // if (nb_interrupt_f0 == NB_SM_TO_RECEIVE_BEFORE_AVF0 ){
88 88 // ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
89 89 // if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
90 90 // {
91 91 // rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
92 92 // }
93 93 // nb_interrupt_f0 = 0;
94 94 // }
95 95 // break;
96 96 // case 1:
97 97 // break;
98 98 // case 2:
99 99 // break;
100 100 // default:
101 101 // break;
102 102 // }
103 103 // }
104 104 // }
105 105
106 106 // // reset error codes to 0
107 107 // spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // [1100 1111]
108 108 }
109 109
110 110 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector )
111 111 {
112 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
113 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
114 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe;
112 //current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
113 //spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
114 //spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe;
115 115
116 rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 );
117 // if (nb_sm_f0 == NB_SM_TO_RECEIVE_BEFORE_AVF0 )
118 // {
119 // ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
120 // if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
121 // {
122 // rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
123 // }
124 // nb_sm_f0 = 0;
125 // }
126 // else
127 // {
128 // nb_sm_f0 = nb_sm_f0 + 1;
129 // }
116 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
117 {
118 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
119 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
120 {
121 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
122 }
123 nb_sm_f0 = 0;
124 }
125 else
126 {
127 nb_sm_f0 = nb_sm_f0 + 1;
128 }
130 129 }
131 130
132 131 //************
133 132 // RTEMS TASKS
134 133
135 134 rtems_task smiq_task(rtems_task_argument argument) // process the Spectral Matrices IRQ
136 135 {
137 136 rtems_event_set event_out;
138 137
139 138 BOOT_PRINTF("in SMIQ *** \n")
140 139
141 140 while(1){
142 141 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
143 142 }
144 143 }
145 144
146 145 rtems_task spw_bppr_task(rtems_task_argument argument)
147 146 {
148 147 rtems_status_code status;
149 148 rtems_event_set event_out;
150 149
151 150 BOOT_PRINTF("in BPPR ***\n");
152 151
153 152 while( true ){ // wait for an event to begin with the processing
154 153 status = rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out);
155 154 }
156 155 }
157 156
158 157 rtems_task avf0_task(rtems_task_argument argument)
159 158 {
160 159 int i;
161 160 static int nb_average;
162 161 rtems_event_set event_out;
163 162 rtems_status_code status;
164 163 ring_node *ring_node_tab[8];
165 164
166 165 nb_average = 0;
167 166
168 167 BOOT_PRINTF("in AVFO *** \n")
169 168
170 169 while(1){
171 170 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
172 PRINTF("avf0\n")
171 ring_node_for_averaging_sm_f0 = &sm_ring_f0[NB_SM_TO_RECEIVE_BEFORE_AVF0-1];
173 172 ring_node_tab[NB_SM_TO_RECEIVE_BEFORE_AVF0-1] = ring_node_for_averaging_sm_f0;
174 for (i=0; i<NB_SM_TO_RECEIVE_BEFORE_AVF0-1; i++)
173 for (i=2; i<NB_SM_TO_RECEIVE_BEFORE_AVF0+1; i++)
175 174 {
176 175 ring_node_for_averaging_sm_f0 = ring_node_for_averaging_sm_f0->previous;
177 ring_node_tab[i] = ring_node_for_averaging_sm_f0;
176 ring_node_tab[NB_SM_TO_RECEIVE_BEFORE_AVF0-i] = ring_node_for_averaging_sm_f0;
178 177 }
179 178 for(i=0; i<TOTAL_SIZE_SM; i++)
180 179 {
181 180 averaged_sm_f0[i] = ( (int *) (ring_node_tab[0]->buffer_address) ) [i]
182 181 + ( (int *) (ring_node_tab[1]->buffer_address) ) [i]
183 182 + ( (int *) (ring_node_tab[2]->buffer_address) ) [i]
184 183 + ( (int *) (ring_node_tab[3]->buffer_address) ) [i]
185 184 + ( (int *) (ring_node_tab[4]->buffer_address) ) [i]
186 185 + ( (int *) (ring_node_tab[5]->buffer_address) ) [i]
187 186 + ( (int *) (ring_node_tab[6]->buffer_address) ) [i]
188 187 + ( (int *) (ring_node_tab[7]->buffer_address) ) [i];
189 188 }
190 189 nb_average = nb_average + NB_SM_TO_RECEIVE_BEFORE_AVF0;
191 190 if (nb_average == NB_AVERAGE_NORMAL_f0) {
192 191 nb_average = 0;
193 192 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_0 ); // sending an event to the task 7, BPF0
194 193 if (status != RTEMS_SUCCESSFUL) {
195 194 printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status);
196 195 }
197 196 }
198 197 }
199 198 }
200 199
201 200 rtems_task bpf0_task(rtems_task_argument argument)
202 201 {
203 202 rtems_event_set event_out;
204 203 static unsigned char LFR_BP1_F0[ NB_BINS_COMPRESSED_SM_F0 * 9 ];
205 204
206 205 BOOT_PRINTF("in BPFO *** \n")
207 206
208 207 while(1){
209 208 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
210 209 matrix_compression(averaged_sm_f0, 0, compressed_sm_f0);
211 210 BP1_set(compressed_sm_f0, NB_BINS_COMPRESSED_SM_F0, LFR_BP1_F0);
212 211 }
213 212 }
214 213
215 214 rtems_task matr_task(rtems_task_argument argument)
216 215 {
217 216 spw_ioctl_pkt_send spw_ioctl_send_ASM;
218 217 rtems_event_set event_out;
219 218 rtems_status_code status;
220 219 rtems_id queue_id;
221 220 Header_TM_LFR_SCIENCE_ASM_t headerASM;
222 221
223 222 init_header_asm( &headerASM );
224 223
225 224 status = get_message_queue_id_send( &queue_id );
226 225 if (status != RTEMS_SUCCESSFUL)
227 226 {
228 227 PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status)
229 228 }
230 229
231 230 BOOT_PRINTF("in MATR *** \n")
232 231
233 232 fill_averaged_spectral_matrix( );
234 233
235 234 while(1){
236 235 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
237 236 // 1) convert the float array in a char array
238 237 convert_averaged_spectral_matrix( averaged_sm_f0, averaged_sm_f0_char);
239 238 // 2) send the spectral matrix packets
240 239 send_spectral_matrix( &headerASM, averaged_sm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id);
241 240 }
242 241 }
243 242
244 243 //*****************************
245 244 // Spectral matrices processing
246 245
247 246 void matrix_reset(volatile float *averaged_spec_mat)
248 247 {
249 248 int i;
250 249 for(i=0; i<TOTAL_SIZE_SM; i++){
251 250 averaged_spec_mat[i] = 0;
252 251 }
253 252 }
254 253
255 254 void matrix_compression(volatile float *averaged_spec_mat, unsigned char fChannel, float *compressed_spec_mat)
256 255 {
257 256 int i;
258 257 int j;
259 258 switch (fChannel){
260 259 case 0:
261 260 for(i=0;i<NB_BINS_COMPRESSED_SM_F0;i++){
262 261 j = 17 + (i * 8);
263 262 compressed_spec_mat[i] = (averaged_spec_mat[j]
264 263 + averaged_spec_mat[j+1]
265 264 + averaged_spec_mat[j+2]
266 265 + averaged_spec_mat[j+3]
267 266 + averaged_spec_mat[j+4]
268 267 + averaged_spec_mat[j+5]
269 268 + averaged_spec_mat[j+6]
270 269 + averaged_spec_mat[j+7])/(8*NB_AVERAGE_NORMAL_f0);
271 270 }
272 271 break;
273 272 case 1:
274 273 // case fChannel = f1 to be completed later
275 274 break;
276 275 case 2:
277 276 // case fChannel = f1 to be completed later
278 277 break;
279 278 default:
280 279 break;
281 280 }
282 281 }
283 282
284 283 void BP1_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * LFR_BP1){
285 284 int i;
286 285 int j;
287 286 unsigned char tmp_u_char;
288 287 unsigned char * pt_char = NULL;
289 288 float PSDB, PSDE;
290 289 float NVEC_V0;
291 290 float NVEC_V1;
292 291 float NVEC_V2;
293 292 //float significand;
294 293 //int exponent;
295 294 float aux;
296 295 float tr_SB_SB;
297 296 float tmp;
298 297 float sx_re;
299 298 float sx_im;
300 299 float nebx_re = 0;
301 300 float nebx_im = 0;
302 301 float ny = 0;
303 302 float nz = 0;
304 303 float bx_bx_star = 0;
305 304 for(i=0; i<nb_bins_compressed_spec_mat; i++){
306 305 //==============================================
307 306 // BP1 PSD == B PAR_LFR_SC_BP1_PE_FL0 == 16 bits
308 307 PSDB = compressed_spec_mat[i*30] // S11
309 308 + compressed_spec_mat[(i*30) + 10] // S22
310 309 + compressed_spec_mat[(i*30) + 18]; // S33
311 310 //significand = frexp(PSDB, &exponent);
312 311 pt_char = (unsigned char*) &PSDB;
313 312 LFR_BP1[(i*9) + 2] = pt_char[0]; // bits 31 downto 24 of the float
314 313 LFR_BP1[(i*9) + 3] = pt_char[1]; // bits 23 downto 16 of the float
315 314 //==============================================
316 315 // BP1 PSD == E PAR_LFR_SC_BP1_PB_FL0 == 16 bits
317 316 PSDE = compressed_spec_mat[(i*30) + 24] * K44_pe // S44
318 317 + compressed_spec_mat[(i*30) + 28] * K55_pe // S55
319 318 + compressed_spec_mat[(i*30) + 26] * K45_pe_re // S45
320 319 - compressed_spec_mat[(i*30) + 27] * K45_pe_im; // S45
321 320 pt_char = (unsigned char*) &PSDE;
322 321 LFR_BP1[(i*9) + 0] = pt_char[0]; // bits 31 downto 24 of the float
323 322 LFR_BP1[(i*9) + 1] = pt_char[1]; // bits 23 downto 16 of the float
324 323 //==============================================================================
325 324 // BP1 normal wave vector == PAR_LFR_SC_BP1_NVEC_V0_F0 == 8 bits
326 325 // == PAR_LFR_SC_BP1_NVEC_V1_F0 == 8 bits
327 326 // == PAR_LFR_SC_BP1_NVEC_V2_F0 == 1 bits
328 327 tmp = sqrt(
329 328 compressed_spec_mat[(i*30) + 3]*compressed_spec_mat[(i*30) + 3] //Im S12
330 329 +compressed_spec_mat[(i*30) + 5]*compressed_spec_mat[(i*30) + 5] //Im S13
331 330 +compressed_spec_mat[(i*30) + 13]*compressed_spec_mat[(i*30) + 13] //Im S23
332 331 );
333 332 NVEC_V0 = compressed_spec_mat[(i*30) + 13] / tmp; // Im S23
334 333 NVEC_V1 = -compressed_spec_mat[(i*30) + 5] / tmp; // Im S13
335 334 NVEC_V2 = compressed_spec_mat[(i*30) + 3] / tmp; // Im S12
336 335 LFR_BP1[(i*9) + 4] = (char) (NVEC_V0*127);
337 336 LFR_BP1[(i*9) + 5] = (char) (NVEC_V1*127);
338 337 pt_char = (unsigned char*) &NVEC_V2;
339 338 LFR_BP1[(i*9) + 6] = pt_char[0] & 0x80; // extract the sign of NVEC_V2
340 339 //=======================================================
341 340 // BP1 ellipticity == PAR_LFR_SC_BP1_ELLIP_F0 == 4 bits
342 341 aux = 2*tmp / PSDB; // compute the ellipticity
343 342 tmp_u_char = (unsigned char) (aux*(16-1)); // convert the ellipticity
344 343 LFR_BP1[i*9+6] = LFR_BP1[i*9+6] | ((tmp_u_char&0x0f)<<3); // keeps 4 bits of the resulting unsigned char
345 344 //==============================================================
346 345 // BP1 degree of polarization == PAR_LFR_SC_BP1_DOP_F0 == 3 bits
347 346 for(j = 0; j<NB_VALUES_PER_SM;j++){
348 347 tr_SB_SB = compressed_spec_mat[i*30] * compressed_spec_mat[i*30]
349 348 + compressed_spec_mat[(i*30) + 10] * compressed_spec_mat[(i*30) + 10]
350 349 + compressed_spec_mat[(i*30) + 18] * compressed_spec_mat[(i*30) + 18]
351 350 + 2 * compressed_spec_mat[(i*30) + 2] * compressed_spec_mat[(i*30) + 2]
352 351 + 2 * compressed_spec_mat[(i*30) + 3] * compressed_spec_mat[(i*30) + 3]
353 352 + 2 * compressed_spec_mat[(i*30) + 4] * compressed_spec_mat[(i*30) + 4]
354 353 + 2 * compressed_spec_mat[(i*30) + 5] * compressed_spec_mat[(i*30) + 5]
355 354 + 2 * compressed_spec_mat[(i*30) + 12] * compressed_spec_mat[(i*30) + 12]
356 355 + 2 * compressed_spec_mat[(i*30) + 13] * compressed_spec_mat[(i*30) + 13];
357 356 }
358 357 aux = PSDB*PSDB;
359 358 tmp = sqrt( abs( ( 3*tr_SB_SB - aux ) / ( 2 * aux ) ) );
360 359 tmp_u_char = (unsigned char) (NVEC_V0*(8-1));
361 360 LFR_BP1[(i*9) + 6] = LFR_BP1[(i*9) + 6] | (tmp_u_char & 0x07); // keeps 3 bits of the resulting unsigned char
362 361 //=======================================================================================
363 362 // BP1 x-component of the normalized Poynting flux == PAR_LFR_SC_BP1_SZ_F0 == 8 bits (7+1)
364 363 sx_re = compressed_spec_mat[(i*30) + 20] * K34_sx_re
365 364 + compressed_spec_mat[(i*30) + 6] * K14_sx_re
366 365 + compressed_spec_mat[(i*30) + 8] * K15_sx_re
367 366 + compressed_spec_mat[(i*30) + 14] * K24_sx_re
368 367 + compressed_spec_mat[(i*30) + 16] * K25_sx_re
369 368 + compressed_spec_mat[(i*30) + 22] * K35_sx_re;
370 369 sx_im = compressed_spec_mat[(i*30) + 21] * K34_sx_im
371 370 + compressed_spec_mat[(i*30) + 7] * K14_sx_im
372 371 + compressed_spec_mat[(i*30) + 9] * K15_sx_im
373 372 + compressed_spec_mat[(i*30) + 15] * K24_sx_im
374 373 + compressed_spec_mat[(i*30) + 17] * K25_sx_im
375 374 + compressed_spec_mat[(i*30) + 23] * K35_sx_im;
376 375 LFR_BP1[(i*9) + 7] = ((unsigned char) (sx_re * 128)) & 0x7f; // cf DOC for the compression
377 376 if ( abs(sx_re) > abs(sx_im) ) {
378 377 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] | (0x80); // extract the sector of sx
379 378 }
380 379 else {
381 380 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] & (0x7f); // extract the sector of sx
382 381 }
383 382 //======================================================================
384 383 // BP1 phase velocity estimator == PAR_LFR_SC_BP1_VPHI_F0 == 8 bits (7+1)
385 384 ny = sin(Alpha_M)*NVEC_V1 + cos(Alpha_M)*NVEC_V2;
386 385 nz = NVEC_V0;
387 386 bx_bx_star = cos(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+10] // re S22
388 387 + sin(Alpha_M) * sin(Alpha_M) * compressed_spec_mat[i*30+18] // re S33
389 388 - 2 * sin(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+12]; // re S23
390 389 nebx_re = ny * (compressed_spec_mat[(i*30) + 14] * K24_ny_re
391 390 +compressed_spec_mat[(i*30) + 16] * K25_ny_re
392 391 +compressed_spec_mat[(i*30) + 20] * K34_ny_re
393 392 +compressed_spec_mat[(i*30) + 22] * K35_ny_re)
394 393 + nz * (compressed_spec_mat[(i*30) + 14] * K24_nz_re
395 394 +compressed_spec_mat[(i*30) + 16] * K25_nz_re
396 395 +compressed_spec_mat[(i*30) + 20] * K34_nz_re
397 396 +compressed_spec_mat[(i*30) + 22] * K35_nz_re);
398 397 nebx_im = ny * (compressed_spec_mat[(i*30) + 15]*K24_ny_re
399 398 +compressed_spec_mat[(i*30) + 17] * K25_ny_re
400 399 +compressed_spec_mat[(i*30) + 21] * K34_ny_re
401 400 +compressed_spec_mat[(i*30) + 23] * K35_ny_re)
402 401 + nz * (compressed_spec_mat[(i*30) + 15] * K24_nz_im
403 402 +compressed_spec_mat[(i*30) + 17] * K25_nz_im
404 403 +compressed_spec_mat[(i*30) + 21] * K34_nz_im
405 404 +compressed_spec_mat[(i*30) + 23] * K35_nz_im);
406 405 tmp = nebx_re / bx_bx_star;
407 406 LFR_BP1[(i*9) + 8] = ((unsigned char) (tmp * 128)) & 0x7f; // cf DOC for the compression
408 407 if ( abs(nebx_re) > abs(nebx_im) ) {
409 408 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] | (0x80); // extract the sector of nebx
410 409 }
411 410 else {
412 411 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] & (0x7f); // extract the sector of nebx
413 412 }
414 413 }
415 414
416 415 }
417 416
418 417 void BP2_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat){
419 418 // BP2 autocorrelation
420 419 int i;
421 420 int aux = 0;
422 421
423 422 for(i = 0; i<nb_bins_compressed_spec_mat; i++){
424 423 // S12
425 424 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 10]);
426 425 compressed_spec_mat[(i*30) + 2] = compressed_spec_mat[(i*30) + 2] / aux;
427 426 compressed_spec_mat[(i*30) + 3] = compressed_spec_mat[(i*30) + 3] / aux;
428 427 // S13
429 428 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 18]);
430 429 compressed_spec_mat[(i*30) + 4] = compressed_spec_mat[(i*30) + 4] / aux;
431 430 compressed_spec_mat[(i*30) + 5] = compressed_spec_mat[(i*30) + 5] / aux;
432 431 // S23
433 432 aux = sqrt(compressed_spec_mat[i*30+12]*compressed_spec_mat[(i*30) + 18]);
434 433 compressed_spec_mat[(i*30) + 12] = compressed_spec_mat[(i*30) + 12] / aux;
435 434 compressed_spec_mat[(i*30) + 13] = compressed_spec_mat[(i*30) + 13] / aux;
436 435 // S45
437 436 aux = sqrt(compressed_spec_mat[i*30+24]*compressed_spec_mat[(i*30) + 28]);
438 437 compressed_spec_mat[(i*30) + 26] = compressed_spec_mat[(i*30) + 26] / aux;
439 438 compressed_spec_mat[(i*30) + 27] = compressed_spec_mat[(i*30) + 27] / aux;
440 439 // S14
441 440 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) +24]);
442 441 compressed_spec_mat[(i*30) + 6] = compressed_spec_mat[(i*30) + 6] / aux;
443 442 compressed_spec_mat[(i*30) + 7] = compressed_spec_mat[(i*30) + 7] / aux;
444 443 // S15
445 444 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 28]);
446 445 compressed_spec_mat[(i*30) + 8] = compressed_spec_mat[(i*30) + 8] / aux;
447 446 compressed_spec_mat[(i*30) + 9] = compressed_spec_mat[(i*30) + 9] / aux;
448 447 // S24
449 448 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 24]);
450 449 compressed_spec_mat[(i*30) + 14] = compressed_spec_mat[(i*30) + 14] / aux;
451 450 compressed_spec_mat[(i*30) + 15] = compressed_spec_mat[(i*30) + 15] / aux;
452 451 // S25
453 452 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 28]);
454 453 compressed_spec_mat[(i*30) + 16] = compressed_spec_mat[(i*30) + 16] / aux;
455 454 compressed_spec_mat[(i*30) + 17] = compressed_spec_mat[(i*30) + 17] / aux;
456 455 // S34
457 456 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 24]);
458 457 compressed_spec_mat[(i*30) + 20] = compressed_spec_mat[(i*30) + 20] / aux;
459 458 compressed_spec_mat[(i*30) + 21] = compressed_spec_mat[(i*30) + 21] / aux;
460 459 // S35
461 460 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 28]);
462 461 compressed_spec_mat[(i*30) + 22] = compressed_spec_mat[(i*30) + 22] / aux;
463 462 compressed_spec_mat[(i*30) + 23] = compressed_spec_mat[(i*30) + 23] / aux;
464 463 }
465 464 }
466 465
467 466 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header)
468 467 {
469 468 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
470 469 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
471 470 header->reserved = 0x00;
472 471 header->userApplication = CCSDS_USER_APP;
473 472 header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
474 473 header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
475 474 header->packetSequenceControl[0] = 0xc0;
476 475 header->packetSequenceControl[1] = 0x00;
477 476 header->packetLength[0] = 0x00;
478 477 header->packetLength[1] = 0x00;
479 478 // DATA FIELD HEADER
480 479 header->spare1_pusVersion_spare2 = 0x10;
481 480 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
482 481 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
483 482 header->destinationID = TM_DESTINATION_ID_GROUND;
484 483 // AUXILIARY DATA HEADER
485 484 header->sid = 0x00;
486 485 header->biaStatusInfo = 0x00;
487 486 header->pa_lfr_pkt_cnt_asm = 0x00;
488 487 header->pa_lfr_pkt_nr_asm = 0x00;
489 488 header->time[0] = 0x00;
490 489 header->time[0] = 0x00;
491 490 header->time[0] = 0x00;
492 491 header->time[0] = 0x00;
493 492 header->time[0] = 0x00;
494 493 header->time[0] = 0x00;
495 494 header->pa_lfr_asm_blk_nr[0] = 0x00; // BLK_NR MSB
496 495 header->pa_lfr_asm_blk_nr[1] = 0x00; // BLK_NR LSB
497 496 }
498 497
499 498 void send_spectral_matrix(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
500 499 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id)
501 500 {
502 501 unsigned int i;
503 502 unsigned int length = 0;
504 503 rtems_status_code status;
505 504
506 505 for (i=0; i<2; i++)
507 506 {
508 507 // (1) BUILD THE DATA
509 508 switch(sid)
510 509 {
511 510 case SID_NORM_ASM_F0:
512 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0 / 2;
513 spw_ioctl_send->data = &spectral_matrix[ ASM_F0_INDICE_START + i * (TOTAL_SIZE_ASM_F0/2)];
511 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2;
512 spw_ioctl_send->data = &spectral_matrix[ ( (ASM_F0_INDICE_START+ (i*NB_BINS_PER_PKT_ASM_F0)) * NB_VALUES_PER_SM) * 2 ];
514 513 length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0;
515 header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_ASM_F0/2) >> 8 ); // BLK_NR MSB
516 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_ASM_F0/2); // BLK_NR LSB
514 header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_PKT_ASM_F0) >> 8 ); // BLK_NR MSB
515 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB
517 516 break;
518 517 case SID_NORM_ASM_F1:
519 518 break;
520 519 case SID_NORM_ASM_F2:
521 520 break;
522 521 default:
523 522 PRINTF1("ERR *** in send_spectral_matrix *** unexpected sid %d\n", sid)
524 523 break;
525 524 }
526 525 spw_ioctl_send->hlen = HEADER_LENGTH_TM_LFR_SCIENCE_ASM + CCSDS_PROTOCOLE_EXTRA_BYTES;
527 526 spw_ioctl_send->hdr = (char *) header;
528 527 spw_ioctl_send->options = 0;
529 528
530 529 // (2) BUILD THE HEADER
531 530 header->packetLength[0] = (unsigned char) (length>>8);
532 531 header->packetLength[1] = (unsigned char) (length);
533 532 header->sid = (unsigned char) sid; // SID
534 533 header->pa_lfr_pkt_cnt_asm = 2;
535 534 header->pa_lfr_pkt_nr_asm = (unsigned char) (i+1);
536 535
537 536 // (3) SET PACKET TIME
538 537 header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
539 538 header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
540 539 header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
541 540 header->time[3] = (unsigned char) (time_management_regs->coarse_time);
542 541 header->time[4] = (unsigned char) (time_management_regs->fine_time>>8);
543 542 header->time[5] = (unsigned char) (time_management_regs->fine_time);
544 543 //
545 544 header->acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
546 545 header->acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
547 546 header->acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
548 547 header->acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
549 548 header->acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
550 549 header->acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
551 550
552 551 // (4) SEND PACKET
553 552 status = rtems_message_queue_send( queue_id, spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
554 553 if (status != RTEMS_SUCCESSFUL) {
555 554 printf("in send_spectral_matrix *** ERR %d\n", (int) status);
556 555 }
557 556 }
558 557 }
559 558
560 559 void convert_averaged_spectral_matrix( volatile float *input_matrix, char *output_matrix)
561 560 {
562 561 unsigned int i;
563 562 unsigned int j;
564 563 char * pt_char_input;
565 564 char * pt_char_output;
566 565
567 566 pt_char_input = NULL;
568 567 pt_char_output = NULL;
569 568
570 569 for( i=0; i<NB_BINS_PER_SM; i++)
571 570 {
572 571 for ( j=0; j<NB_VALUES_PER_SM; j++)
573 572 {
574 573 pt_char_input = (char*) &input_matrix [ (i*NB_VALUES_PER_SM) + j ];
575 574 pt_char_output = (char*) &output_matrix[ 2 * ( (i*NB_VALUES_PER_SM) + j ) ];
576 575 pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float
577 576 pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float
578 577 }
579 578 }
580 579 }
581 580
582 581 void fill_averaged_spectral_matrix(void)
583 582 {
584 583 /** This function fills spectral matrices related buffers with arbitrary data.
585 584 *
586 585 * This function is for testing purpose only.
587 586 *
588 587 */
589 588
590 589 float offset;
591 590 float coeff;
592 591
593 592 offset = 10.;
594 593 coeff = 100000.;
595 594 averaged_sm_f0[ 0 + 25 * 0 ] = 0. + offset;
596 595 averaged_sm_f0[ 0 + 25 * 1 ] = 1. + offset;
597 596 averaged_sm_f0[ 0 + 25 * 2 ] = 2. + offset;
598 597 averaged_sm_f0[ 0 + 25 * 3 ] = 3. + offset;
599 598 averaged_sm_f0[ 0 + 25 * 4 ] = 4. + offset;
600 599 averaged_sm_f0[ 0 + 25 * 5 ] = 5. + offset;
601 600 averaged_sm_f0[ 0 + 25 * 6 ] = 6. + offset;
602 601 averaged_sm_f0[ 0 + 25 * 7 ] = 7. + offset;
603 602 averaged_sm_f0[ 0 + 25 * 8 ] = 8. + offset;
604 603 averaged_sm_f0[ 0 + 25 * 9 ] = 9. + offset;
605 604 averaged_sm_f0[ 0 + 25 * 10 ] = 10. + offset;
606 605 averaged_sm_f0[ 0 + 25 * 11 ] = 11. + offset;
607 606 averaged_sm_f0[ 0 + 25 * 12 ] = 12. + offset;
608 607 averaged_sm_f0[ 0 + 25 * 13 ] = 13. + offset;
609 608 averaged_sm_f0[ 0 + 25 * 14 ] = 14. + offset;
610 609 averaged_sm_f0[ 9 + 25 * 0 ] = -(0. + offset)* coeff;
611 610 averaged_sm_f0[ 9 + 25 * 1 ] = -(1. + offset)* coeff;
612 611 averaged_sm_f0[ 9 + 25 * 2 ] = -(2. + offset)* coeff;
613 612 averaged_sm_f0[ 9 + 25 * 3 ] = -(3. + offset)* coeff;
614 613 averaged_sm_f0[ 9 + 25 * 4 ] = -(4. + offset)* coeff;
615 614 averaged_sm_f0[ 9 + 25 * 5 ] = -(5. + offset)* coeff;
616 615 averaged_sm_f0[ 9 + 25 * 6 ] = -(6. + offset)* coeff;
617 616 averaged_sm_f0[ 9 + 25 * 7 ] = -(7. + offset)* coeff;
618 617 averaged_sm_f0[ 9 + 25 * 8 ] = -(8. + offset)* coeff;
619 618 averaged_sm_f0[ 9 + 25 * 9 ] = -(9. + offset)* coeff;
620 619 averaged_sm_f0[ 9 + 25 * 10 ] = -(10. + offset)* coeff;
621 620 averaged_sm_f0[ 9 + 25 * 11 ] = -(11. + offset)* coeff;
622 621 averaged_sm_f0[ 9 + 25 * 12 ] = -(12. + offset)* coeff;
623 622 averaged_sm_f0[ 9 + 25 * 13 ] = -(13. + offset)* coeff;
624 623 averaged_sm_f0[ 9 + 25 * 14 ] = -(14. + offset)* coeff;
625 624
626 625 offset = 10000000;
627 626 averaged_sm_f0[ 16 + 25 * 0 ] = (0. + offset)* coeff;
628 627 averaged_sm_f0[ 16 + 25 * 1 ] = (1. + offset)* coeff;
629 628 averaged_sm_f0[ 16 + 25 * 2 ] = (2. + offset)* coeff;
630 629 averaged_sm_f0[ 16 + 25 * 3 ] = (3. + offset)* coeff;
631 630 averaged_sm_f0[ 16 + 25 * 4 ] = (4. + offset)* coeff;
632 631 averaged_sm_f0[ 16 + 25 * 5 ] = (5. + offset)* coeff;
633 632 averaged_sm_f0[ 16 + 25 * 6 ] = (6. + offset)* coeff;
634 633 averaged_sm_f0[ 16 + 25 * 7 ] = (7. + offset)* coeff;
635 634 averaged_sm_f0[ 16 + 25 * 8 ] = (8. + offset)* coeff;
636 635 averaged_sm_f0[ 16 + 25 * 9 ] = (9. + offset)* coeff;
637 636 averaged_sm_f0[ 16 + 25 * 10 ] = (10. + offset)* coeff;
638 637 averaged_sm_f0[ 16 + 25 * 11 ] = (11. + offset)* coeff;
639 638 averaged_sm_f0[ 16 + 25 * 12 ] = (12. + offset)* coeff;
640 639 averaged_sm_f0[ 16 + 25 * 13 ] = (13. + offset)* coeff;
641 640 averaged_sm_f0[ 16 + 25 * 14 ] = (14. + offset)* coeff;
642 641
643 642 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 0 ] = averaged_sm_f0[ 0 ];
644 643 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 1 ] = averaged_sm_f0[ 1 ];
645 644 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 2 ] = averaged_sm_f0[ 2 ];
646 645 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 3 ] = averaged_sm_f0[ 3 ];
647 646 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 4 ] = averaged_sm_f0[ 4 ];
648 647 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 5 ] = averaged_sm_f0[ 5 ];
649 648 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 6 ] = averaged_sm_f0[ 6 ];
650 649 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 7 ] = averaged_sm_f0[ 7 ];
651 650 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 8 ] = averaged_sm_f0[ 8 ];
652 651 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 9 ] = averaged_sm_f0[ 9 ];
653 652 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 10 ] = averaged_sm_f0[ 10 ];
654 653 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 11 ] = averaged_sm_f0[ 11 ];
655 654 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 12 ] = averaged_sm_f0[ 12 ];
656 655 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 13 ] = averaged_sm_f0[ 13 ];
657 656 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 14 ] = averaged_sm_f0[ 14 ];
658 657 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 15 ] = averaged_sm_f0[ 15 ];
659 658 }
660 659
661 660 void reset_spectral_matrix_regs()
662 661 {
663 662 /** This function resets the spectral matrices module registers.
664 663 *
665 664 * The registers affected by this function are located at the following offset addresses:
666 665 *
667 666 * - 0x00 config
668 667 * - 0x04 status
669 668 * - 0x08 matrixF0_Address0
670 669 * - 0x10 matrixFO_Address1
671 670 * - 0x14 matrixF1_Address
672 671 * - 0x18 matrixF2_Address
673 672 *
674 673 */
675 674
676 675 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
677 676 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
678 677 spectral_matrix_regs->matrixF1_Address = current_ring_node_sm_f1->buffer_address;
679 678 spectral_matrix_regs->matrixF2_Address = current_ring_node_sm_f2->buffer_address;
680 679 }
681 680
682 681 //******************
683 682 // general functions
684 683
685 684
686 685
687 686
General Comments 0
You need to be logged in to leave comments. Login now