CMS 3D CMS Logo

Functions
bit_encoding.h File Reference
#include <cassert>
#include "DataFormats/L1TParticleFlow/interface/datatypes.h"

Go to the source code of this file.

Functions

template<unsigned int N, unsigned int OFFS = 0, typename T , int NB>
void l1pf_pattern_pack (const T objs[N], ap_uint< NB > data[])
 
template<unsigned int N, unsigned int OFFS = 0, typename T , int NB>
void l1pf_pattern_pack_slim (const T objs[N], ap_uint< NB > data[])
 
template<unsigned int N, unsigned int OFFS = 0, typename T , int NB>
void l1pf_pattern_unpack (const ap_uint< NB > data[], T objs[N])
 
template<unsigned int N, unsigned int OFFS = 0, typename T , int NB>
void l1pf_pattern_unpack_slim (const ap_uint< NB > data[], T objs[N])
 
template<typename U >
void pack_bool_into_bits (U &u, unsigned int &start, bool data)
 
template<typename U , typename T >
void pack_into_bits (U &u, unsigned int &start, const T &data)
 
template<typename U >
void unpack_bool_from_bits (const U &u, unsigned int &start, bool &data)
 
template<typename U , typename T >
void unpack_from_bits (const U &u, unsigned int &start, T &data)
 

Function Documentation

◆ l1pf_pattern_pack()

template<unsigned int N, unsigned int OFFS = 0, typename T , int NB>
void l1pf_pattern_pack ( const T  objs[N],
ap_uint< NB >  data[] 
)
inline

Definition at line 32 of file bit_encoding.h.

References cms::cuda::assert(), data, mps_fire::i, N, and HLTEGTnPMonitor_cfi::objs.

32  {
33 #ifdef __SYNTHESIS__
34 #pragma HLS inline
35 #pragma HLS inline region recursive
36 #endif
37  assert(T::BITWIDTH <= NB);
38  for (unsigned int i = 0; i < N; ++i) {
39 #ifdef __SYNTHESIS__
40 #pragma HLS unroll
41 #endif
42  data[i + OFFS] = objs[i].pack();
43  }
44 }
assert(be >=bs)
#define N
Definition: blowfish.cc:9
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ l1pf_pattern_pack_slim()

template<unsigned int N, unsigned int OFFS = 0, typename T , int NB>
void l1pf_pattern_pack_slim ( const T  objs[N],
ap_uint< NB >  data[] 
)
inline

Definition at line 62 of file bit_encoding.h.

References cms::cuda::assert(), data, mps_fire::i, N, and HLTEGTnPMonitor_cfi::objs.

62  {
63 #ifdef __SYNTHESIS__
64 #pragma HLS inline
65 #pragma HLS inline region recursive
66 #endif
67  assert(T::BITWIDTH_SLIM <= NB);
68  for (unsigned int i = 0; i < N; ++i) {
69 #ifdef __SYNTHESIS__
70 #pragma HLS unroll
71 #endif
72  data[i + OFFS] = objs[i].pack_slim();
73  }
74 }
assert(be >=bs)
#define N
Definition: blowfish.cc:9
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ l1pf_pattern_unpack()

template<unsigned int N, unsigned int OFFS = 0, typename T , int NB>
void l1pf_pattern_unpack ( const ap_uint< NB >  data[],
T  objs[N] 
)
inline

Definition at line 47 of file bit_encoding.h.

References cms::cuda::assert(), data, mps_fire::i, N, HLTEGTnPMonitor_cfi::objs, and beamSpotPI::unpack().

47  {
48 #ifdef __SYNTHESIS__
49 #pragma HLS inline
50 #pragma HLS inline region recursive
51 #endif
52  assert(T::BITWIDTH <= NB);
53  for (unsigned int i = 0; i < N; ++i) {
54 #ifdef __SYNTHESIS__
55 #pragma HLS unroll
56 #endif
57  objs[i] = T::unpack(data[i + OFFS]);
58  }
59 }
assert(be >=bs)
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
#define N
Definition: blowfish.cc:9
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ l1pf_pattern_unpack_slim()

template<unsigned int N, unsigned int OFFS = 0, typename T , int NB>
void l1pf_pattern_unpack_slim ( const ap_uint< NB >  data[],
T  objs[N] 
)
inline

Definition at line 77 of file bit_encoding.h.

References cms::cuda::assert(), data, mps_fire::i, N, HLTEGTnPMonitor_cfi::objs, and beamSpotPI::unpack().

77  {
78 #ifdef __SYNTHESIS__
79 #pragma HLS inline
80 #pragma HLS inline region recursive
81 #endif
82  assert(T::BITWIDTH_SLIM <= NB);
83  for (unsigned int i = 0; i < N; ++i) {
84 #ifdef __SYNTHESIS__
85 #pragma HLS unroll
86 #endif
87  objs[i] = T::unpack(data[i + OFFS]);
88  }
89 }
assert(be >=bs)
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
#define N
Definition: blowfish.cc:9
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ pack_bool_into_bits()

template<typename U >
void pack_bool_into_bits ( U &  u,
unsigned int &  start,
bool  data 
)
inline

Definition at line 22 of file bit_encoding.h.

References data.

Referenced by l1ct::Tau::pack(), l1ct::EGIsoEleObj::pack(), l1ct::TkObj::pack(), and l1ct::MuObj::pack().

22  {
23  u[start++] = data;
24 }
Definition: start.py:1
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ pack_into_bits()

template<typename U , typename T >
void pack_into_bits ( U &  u,
unsigned int &  start,
const T data 
)
inline

◆ unpack_bool_from_bits()

template<typename U >
void unpack_bool_from_bits ( const U &  u,
unsigned int &  start,
bool &  data 
)
inline

Definition at line 27 of file bit_encoding.h.

References data.

Referenced by l1ct::EGIsoEleObj::initFromBits(), l1ct::TkObj::unpack(), and l1ct::MuObj::unpack().

27  {
28  data = u[start++];
29 }
Definition: start.py:1
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ unpack_from_bits()

template<typename U , typename T >
void unpack_from_bits ( const U &  u,
unsigned int &  start,
T data 
)
inline