Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:20

0001 #ifndef DataFormats_FEDRawData_fed_header_h
0002 #define DataFormats_FEDRawData_fed_header_h
0003 
0004 #include <cstdint>
0005 
0006 #ifdef __cplusplus
0007 extern "C" {
0008 #endif
0009 
0010 /*************************************************************************
0011  *
0012  * data structures and associated typedefs
0013  *
0014  *************************************************************************/
0015 
0016 /*
0017  * FED header - in front of each FED block
0018  */
0019 
0020 typedef struct fedh_struct {
0021   uint32_t sourceid;
0022   uint32_t eventid;
0023 } fedh_t;
0024 
0025 #define FED_SLINK_START_MARKER 0x5
0026 
0027 #define FED_HCTRLID_WIDTH 0x0000000f
0028 #define FED_HCTRLID_SHIFT 28
0029 #define FED_HCTRLID_MASK (FED_HCTRLID_WIDTH << FED_HCTRLID_SHIFT)
0030 #define FED_HCTRLID_EXTRACT(a) (((a) >> FED_HCTRLID_SHIFT) & FED_HCTRLID_WIDTH)
0031 
0032 #define FED_EVTY_WIDTH 0x0000000f
0033 #define FED_EVTY_SHIFT 24
0034 #define FED_EVTY_MASK (FED_EVTY_WIDTH << FED_EVTY_SHIFT)
0035 #define FED_EVTY_EXTRACT(a) (((a) >> FED_EVTY_SHIFT) & FED_EVTY_WIDTH)
0036 
0037 #define FED_LVL1_WIDTH 0x00ffffff
0038 #define FED_LVL1_SHIFT 0
0039 #define FED_LVL1_MASK (FED_LVL1_WIDTH << FED_LVL1_SHIFT)
0040 #define FED_LVL1_EXTRACT(a) (((a) >> FED_LVL1_SHIFT) & FED_LVL1_WIDTH)
0041 
0042 #define FED_BXID_WIDTH 0x00000fff
0043 #define FED_BXID_SHIFT 20
0044 #define FED_BXID_MASK (FED_BXID_WIDTH << FED_BXID_SHIFT)
0045 #define FED_BXID_EXTRACT(a) (((a) >> FED_BXID_SHIFT) & FED_BXID_WIDTH)
0046 
0047 #define FED_SOID_WIDTH 0x00000fff
0048 #define FED_SOID_SHIFT 8
0049 #define FED_SOID_MASK (FED_SOID_WIDTH << FED_SOID_SHIFT)
0050 #define FED_SOID_EXTRACT(a) (((a) >> FED_SOID_SHIFT) & FED_SOID_WIDTH)
0051 
0052 #define FED_VERSION_WIDTH 0x0000000f
0053 #define FED_VERSION_SHIFT 4
0054 #define FED_VERSION_MASK (FED_VERSION_WIDTH << FED_VERSION_SHIFT)
0055 #define FED_VERSION_EXTRACT(a) (((a) >> FED_VERSION_SHIFT) & FED_VERSION_WIDTH)
0056 
0057 #define FED_MORE_HEADERS_WIDTH 0x00000001
0058 #define FED_MORE_HEADERS_SHIFT 3
0059 #define FED_MORE_HEADERS_MASK (FED_MORE_HEADERS_WIDTH << FED_MORE_HEADERS_SHIFT)
0060 #define FED_MORE_HEADERS_EXTRACT(a) (((a) >> FED_MORE_HEADERS_SHIFT) & FED_MORE_HEADERS_WIDTH)
0061 
0062 #ifdef __cplusplus
0063 }
0064 #endif
0065 
0066 #endif  // DataFormats_FEDRawData_fed_header_h