-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjlabdec.h
111 lines (95 loc) · 1.75 KB
/
jlabdec.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef __JLABDEC__
#define __JLABDEC__
#include <stdint.h>
typedef struct
{
uint32_t undef:27;
uint32_t data_type_tag:4;
uint32_t data_type_defining:1;
} generic_data_word;
typedef union
{
uint32_t raw;
generic_data_word bf;
} generic_data_word_t;
/* 0: BLOCK HEADER */
typedef struct
{
uint32_t number_of_events_in_block:8;
uint32_t event_block_number:10;
uint32_t module_ID:4;
uint32_t slot_number:5;
uint32_t data_type_tag:4;
uint32_t data_type_defining:1;
} block_header;
typedef union
{
uint32_t raw;
block_header bf;
} block_header_t;
/* 1: BLOCK TRAILER */
typedef struct
{
uint32_t words_in_block:22;
uint32_t slot_number:5;
uint32_t data_type_tag:4;
uint32_t data_type_defining:1;
} block_trailer;
typedef union
{
uint32_t raw;
block_trailer bf;
} block_trailer_t;
/* 2: EVENT HEADER */
typedef struct
{
uint32_t event_number:22;
uint32_t slot_number:5;
uint32_t data_type_tag:4;
uint32_t data_type_defining:1;
} event_header;
typedef union
{
uint32_t raw;
event_header bf;
} event_header_t;
/* 13: EVENT TRAILER */
typedef struct
{
uint32_t undef:22;
uint32_t slot_number:5;
uint32_t data_type_tag:4;
uint32_t data_type_defining:1;
} event_trailer;
typedef union
{
uint32_t raw;
event_trailer bf;
} event_trailer_t;
/* 14: DATA NOT VALID */
typedef struct
{
uint32_t undef:22;
uint32_t slot_number:5;
uint32_t data_type_tag:4;
uint32_t data_type_defining:1;
} data_not_valid;
typedef union
{
uint32_t raw;
data_not_valid bf;
} data_not_valid_t;
/* 15: FILLER */
typedef struct
{
uint32_t undef:22;
uint32_t slot_number:5;
uint32_t data_type_tag:4;
uint32_t data_type_defining:1;
} filler_word;
typedef union
{
uint32_t raw;
filler_word bf;
} filler_word_t;
#endif /* __JLABDEC__ */