Project
Loading...
Searching...
No Matches
RAWDataHeader.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_HEADER_RAWDATAHEADER_H
13#define ALICEO2_HEADER_RAWDATAHEADER_H
14
18
19#ifndef GPUCA_GPUCODE_DEVICE
20#include <cstdint>
21#endif
22
23namespace o2
24{
25namespace header
26{
27
36
49//
72 union {
73 // default value
74 uint64_t word0 = 0x00000000ffff4007;
75 // | | | version 67
76 // | | | 8x64 bit words = 64 (0x40) byte
77 // | | invalid FEE id
78 // | priority bit 0
79 struct {
80 uint64_t version : 8;
81 uint64_t headerSize : 8;
82 uint64_t feeId : 16;
83 uint64_t priority : 8;
84 uint64_t sourceID : 8;
85 uint64_t zero0 : 16;
86 };
87 };
88 union {
89 uint64_t word1 = 0x0;
90 struct {
91 uint32_t offsetToNext : 16;
92 uint32_t memorySize : 16;
93 uint32_t linkID : 8;
94 uint32_t packetCounter : 8;
95 uint16_t cruID : 12;
96 uint32_t endPointID : 4;
97 };
98 };
99 union {
100 uint64_t word2 = 0x0;
101 struct {
102 uint32_t bunchCrossing : 12;
103 uint32_t reserved2 : 20;
104 uint32_t orbit;
105 };
106 };
107 union {
108 uint64_t word3 = 0x0;
109 struct {
110 uint32_t dataFormat : 8;
113 uint64_t zero3 : 56;
114 };
115 };
116 union {
117 uint64_t word4 = 0x0;
118 struct {
119 uint64_t triggerType : 32;
120 uint64_t pageCnt : 16;
121 uint64_t stop : 8;
122 uint64_t zero4 : 8;
123 };
124 };
125 union {
126 uint64_t word5 = 0x0;
127 };
128 union {
129 uint64_t word6 = 0x0;
130 struct {
131 uint64_t detectorField : 32;
132 uint64_t detectorPAR : 16;
133 uint64_t zero6 : 16;
134 };
135 };
136 union {
137 uint64_t word7 = 0x0;
138 };
139};
140
145//
167 union {
168 // default value
169 uint64_t word0 = 0x00000000ffff4006;
170 // | | | version 6
171 // | | | 8x64 bit words = 64 (0x40) byte
172 // | | invalid FEE id
173 // | priority bit 0
174 struct {
175 uint64_t version : 8;
176 uint64_t headerSize : 8;
177 uint64_t feeId : 16;
178 uint64_t priority : 8;
179 uint64_t sourceID : 8;
180 uint64_t zero0 : 16;
181 };
182 };
183 union {
184 uint64_t word1 = 0x0;
185 struct {
186 uint32_t offsetToNext : 16;
187 uint32_t memorySize : 16;
188 uint32_t linkID : 8;
189 uint32_t packetCounter : 8;
190 uint16_t cruID : 12;
191 uint32_t endPointID : 4;
192 };
193 };
194 union {
195 uint64_t word2 = 0x0;
196 struct {
197 uint32_t bunchCrossing : 12;
198 uint32_t reserved2 : 20;
199 uint32_t orbit;
200 };
201 };
202 union {
203 uint64_t word3 = 0x0;
204 };
205 union {
206 uint64_t word4 = 0x0;
207 struct {
208 uint64_t triggerType : 32;
209 uint64_t pageCnt : 16;
210 uint64_t stop : 8;
211 uint64_t zero4 : 8;
212 };
213 };
214 union {
215 uint64_t word5 = 0x0;
216 };
217 union {
218 uint64_t word6 = 0x0;
219 struct {
220 uint64_t detectorField : 32;
221 uint64_t detectorPAR : 16;
222 uint64_t zero6 : 16;
223 };
224 };
225 union {
226 uint64_t word7 = 0x0;
227 };
228};
229
260 union {
261 // default value
262 uint64_t word0 = 0x00000000ffff4005;
263 // | | | version 5
264 // | | | 8x64 bit words = 64 (0x40) byte
265 // | | invalid FEE id
266 // | priority bit 0
267 struct {
268 uint64_t version : 8;
269 uint64_t headerSize : 8;
270 uint64_t feeId : 16;
271 uint64_t priority : 8;
272 uint64_t zero0 : 24;
273 };
274 };
275 union {
276 uint64_t word1 = 0x0;
277 struct {
278 uint32_t offsetToNext : 16;
279 uint32_t memorySize : 16;
280 uint32_t linkID : 8;
281 uint32_t packetCounter : 8;
282 uint16_t cruID : 12;
283 uint32_t endPointID : 4;
284 };
285 };
286 union {
287 uint64_t word2 = 0x0;
288 struct {
289 uint32_t bunchCrossing : 12;
290 uint32_t reserved2 : 20;
291 uint32_t orbit;
292 };
293 };
294 union {
295 uint64_t word3 = 0x0;
296 };
297 union {
298 uint64_t word4 = 0x0;
299 struct {
300 uint64_t triggerType : 32;
301 uint64_t pageCnt : 16;
302 uint64_t stop : 8;
303 uint64_t zero4 : 8;
304 };
305 };
306 union {
307 uint64_t word5 = 0x0;
308 };
309 union {
310 uint64_t word6 = 0x0;
311 struct {
312 uint64_t detectorField : 32;
313 uint64_t detectorPAR : 16;
314 uint64_t zero6 : 16;
315 };
316 };
317 union {
318 uint64_t word7 = 0x0;
319 };
320};
321
383 union {
384 // default value
385 uint64_t word0 = 0x0000ffff00004004;
386 // | | | | | version 4
387 // | | | | | 8x64 bit words
388 // | | | | block length 0
389 // | | invalid FEE id
390 // | priority bit 0
391 struct {
392 uint64_t version : 8;
393 uint64_t headerSize : 8;
394 uint64_t blockLength : 16;
395 uint64_t feeId : 16;
396 uint64_t priority : 8;
397 uint64_t zero0 : 8;
398 };
399 };
400 union {
401 uint64_t word1 = 0x0;
402 struct {
403 uint32_t offsetToNext : 16;
404 uint32_t memorySize : 16;
405 uint8_t linkID : 8;
406 uint8_t packetCounter : 8;
407 uint16_t cruID : 12;
408 uint8_t endPointID : 4;
409 };
410 };
411 union {
412 uint64_t word2 = 0x0;
413 struct {
414 uint32_t triggerOrbit;
415 uint32_t heartbeatOrbit;
416 };
417 };
418 union {
419 uint64_t word3 = 0x0;
420 };
421 union {
422 uint64_t word4 = 0x0;
423 struct {
424 uint64_t triggerBC : 12;
425 uint64_t zero41 : 4;
426 uint64_t heartbeatBC : 12;
427 uint64_t zero42 : 4;
428 uint64_t triggerType : 32;
429 };
430 };
431 union {
432 uint64_t word5 = 0x0;
433 };
434 union {
435 uint64_t word6 = 0x0;
436 struct {
437 uint64_t detectorField : 16;
438 uint64_t par : 16;
439 uint64_t stop : 8;
440 uint64_t pageCnt : 16;
441 uint64_t zero6 : 8;
442 };
443 };
444 union {
445 uint64_t word7 = 0x0;
446 };
447};
448
479 union {
480 // default value
481 uint64_t word0 = 0x0004ffffff000002;
482 // | | | | | version 2
483 // | | | | block length 0
484 // | | | invalid FEE id
485 // | | invalid link id
486 // | header size 4 x 64 bit
487 struct {
488 uint64_t version : 8;
489 uint64_t blockLength : 16;
490 uint64_t feeId : 16;
491 uint64_t linkId : 8;
492 uint64_t headerSize : 8;
493 uint64_t zero0 : 8;
494 };
495 };
496 union {
497 uint64_t word1 = 0x0;
498 struct {
499 uint32_t triggerOrbit;
500 uint32_t heartbeatOrbit;
501 };
502 };
503 union {
504 uint64_t word2 = 0x0;
505 struct {
506 uint64_t triggerBC : 12;
507 uint64_t triggerType : 32;
508 uint64_t heartbeatBC : 12;
509 uint64_t zero2 : 8;
510 };
511 };
512 union {
513 uint64_t word3 = 0x0;
514 struct {
515 uint64_t pageCnt : 16;
516 uint64_t stop : 8;
517 uint64_t detectorField : 16;
518 uint64_t par : 16;
519 uint64_t zero3 : 8;
520 };
521 };
522};
523
524using RAWDataHeader = RAWDataHeaderV7; // default version
525using RDHLowest = RAWDataHeaderV4; // link this to lowest version
526using RDHHighest = RAWDataHeaderV7; // link this to highest version
527
528} // namespace header
529} // namespace o2
530
531#endif // ALICEO2_HEADER_RAWDATAHEADER_H
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
uint64_t zero0
bit 48 to 55: header size
uint64_t zero3
bit 40 to 55: par
uint64_t blockLength
bit 0 to 8: header version
uint64_t feeId
bit 9 to 23: block length
uint32_t heartbeatOrbit
bit 0 to 31: trigger orbit
uint64_t headerSize
bit 40 to 47: link identifier
uint64_t detectorField
bit 13 to 23: stop code
uint64_t zero2
bit 44 to 55: heartbeat BC ID
uint64_t linkId
bit 24 to 39: FEE identifier
uint64_t triggerType
bit 0 to 11: trigger BC ID
uint64_t par
bit 24 to 39: detector field
uint64_t heartbeatBC
bit 12 to 43: trigger type
uint64_t stop
bit 0 to 15: pages counter
uint8_t endPointID
bit 112 to 123: CRU ID
uint8_t linkID
bit 80 to 95: memory size
uint64_t stop
bit 48 to 63: par
uint64_t pageCnt
bit 0 to 7: stop code
uint64_t zero0
bit 48 to 55: priority bit
uint64_t priority
bit 32 to 47: FEE identifier
uint64_t zero42
bit 48 to 59: heartbeat BC ID
uint64_t blockLength
bit 8 to 15: header size
uint16_t cruID
bit 104 to 111: packet counter
uint64_t triggerType
bit 60 to 63: zeroed
uint8_t packetCounter
bit 96 to 103: link id
uint64_t zero6
bit 8 to 23: pages counter
uint64_t heartbeatBC
bit 44 to 47: zeroed
uint64_t headerSize
bit 0 to 7: header version
uint64_t feeId
bit 16 to 31: block length
uint64_t zero41
bit 32 to 43: trigger BC ID
uint32_t heartbeatOrbit
bit 0 to 31: trigger orbit
uint32_t memorySize
bit 64 to 79: offset to next packet in memory
uint64_t par
bit 32 to 47: detector field
uint32_t reserved2
bit 0 to 11: bunch crossing counter
uint64_t pageCnt
bit 0 to 31: trigger type
uint32_t endPointID
bit 112 to 123: CRU ID
uint64_t priority
bit 16 to 31: FEE identifier
uint32_t memorySize
bit 64 to 79: offset to next packet in memory
uint64_t stop
bit 32 to 47: pages counter
uint64_t detectorPAR
bit 0 to 31: detector field
uint32_t linkID
bit 80 to 95: memory size
uint32_t packetCounter
bit 96 to 103: link id
uint64_t zero0
bit 32 to 39: priority bit
uint64_t zero6
bit 32 to 47: detector PAR (Pause and Reset)
uint64_t feeId
bit 8 to 15: header size
uint64_t headerSize
bit 0 to 7: header version
uint32_t orbit
bit 12 to 31: reserved
uint16_t cruID
bit 104 to 111: packet counter
uint64_t zero4
bit 48 to 53: stop code
uint32_t endPointID
bit 112 to 123: CRU ID
uint32_t packetCounter
bit 96 to 103: link id
uint32_t orbit
bit 12 to 31: reserved
uint32_t reserved2
bit 0 to 11: bunch crossing counter
uint32_t linkID
bit 80 to 95: memory size
uint64_t stop
bit 32 to 47: pages counter
uint64_t sourceID
bit 32 to 39: priority bit
uint64_t feeId
bit 8 to 15: header size
uint64_t headerSize
bit 0 to 7: header version
uint64_t zero6
bit 32 to 47: detector PAR (Pause and Reset)
uint64_t zero0
bit 40 to 47: source ID
uint64_t priority
bit 16 to 31: FEE identifier
uint64_t detectorPAR
bit 0 to 31: detector field
uint64_t pageCnt
bit 0 to 31: trigger type
uint32_t memorySize
bit 64 to 79: offset to next packet in memory
uint16_t cruID
bit 104 to 111: packet counter
uint64_t zero4
bit 48 to 53: stop code
uint32_t orbit
bit 12 to 31: reserved
uint32_t endPointID
bit 112 to 123: CRU ID
uint64_t zero6
bit 32 to 47: detector PAR (Pause and Reset)
uint32_t packetCounter
bit 96 to 103: link id
uint64_t detectorPAR
bit 0 to 31: detector field
uint64_t sourceID
bit 32 to 39: priority bit
uint32_t linkID
bit 80 to 95: memory size
uint16_t cruID
bit 104 to 111: packet counter
uint64_t stop
bit 32 to 47: pages counter
uint32_t memorySize
bit 64 to 79: offset to next packet in memory
uint64_t headerSize
bit 0 to 7: header version
uint64_t zero4
bit 48 to 53: stop code
uint64_t priority
bit 16 to 31: FEE identifier
uint32_t reserved2
bit 0 to 11: bunch crossing counter
uint64_t zero0
bit 40 to 47: source ID
uint64_t feeId
bit 8 to 15: header size
uint64_t pageCnt
bit 0 to 31: trigger type