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_unpack (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:79

◆ 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 }
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
assert(be >=bs)
#define N
Definition: blowfish.cc:9
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ 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:79

◆ 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:79

◆ unpack_from_bits()

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