Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
dune::PennMicroSlice::Payload_Counter Struct Reference

Counter payload description. More...

#include <PennMicroSlice.hh>

Public Types

typedef uint64_t counter_set_t
 
typedef uint16_t data_size_t
 

Public Member Functions

counter_set_t get_bsu_cl ()
 
bool get_tsu_wu (uint32_t idx)
 
bool get_tsu_el (uint32_t idx)
 
bool get_tsu_extra (uint32_t idx)
 
bool get_tsu_nu (uint32_t idx)
 
bool get_tsu_sl (uint32_t idx)
 
bool get_tsu_nl (uint32_t idx)
 
bool get_tsu_su (uint32_t idx)
 
bool get_bsu_rm (uint32_t idx)
 
bool get_bsu_cu (uint32_t idx)
 
bool get_bsu_cl (uint32_t idx)
 
bool get_bsu_rl (uint32_t idx)
 
bool get_counter_status (uint32_t idx) const
 

Static Public Member Functions

static data_size_t get_counter_type (uint32_t bit_idx)
 
static uint32_t get_counter_type_pos (uint32_t bit_idx)
 

Public Attributes

counter_set_t tsu_wu: 10
 
counter_set_t tsu_el: 10
 
counter_set_t tsu_extra: 4
 
counter_set_t tsu_nu: 6
 
counter_set_t tsu_sl: 6
 
counter_set_t tsu_nl: 6
 
counter_set_t tsu_su: 6
 
counter_set_t bsu_rm: 16
 
counter_set_t bsu_cu: 10
 
counter_set_t bsu_cl1: 6
 
counter_set_t bsu_extra: 1
 
counter_set_t bsu_cl2: 7
 
counter_set_t bsu_rl: 10
 
counter_set_t padding: 30
 

Static Public Attributes

static data_size_t const num_bits_tsu_wu = 10
 
static data_size_t const num_bits_tsu_el = 10
 
static data_size_t const num_bits_tsu_extra = 4
 
static data_size_t const num_bits_tsu_nu = 6
 
static data_size_t const num_bits_tsu_sl = 6
 
static data_size_t const num_bits_tsu_nl = 6
 
static data_size_t const num_bits_tsu_su = 6
 
static data_size_t const num_bits_bsu_rm = 16
 
static data_size_t const num_bits_bsu_cu = 10
 
static data_size_t const num_bits_bsu_cl1 = 6
 
static data_size_t const num_bits_bsu_extra = 1
 
static data_size_t const num_bits_bsu_cl2 = 7
 
static data_size_t const num_bits_bsu_rl = 10
 
static data_size_t const num_bits_padding = 30
 
static data_size_t const num_bits_bsu_cl = 13
 
static data_size_t const counter_type_tsu_wu = 10
 
static data_size_t const counter_type_tsu_el = 20
 
static data_size_t const counter_type_tsu_extra = 24
 
static data_size_t const counter_type_tsu_nu = 30
 
static data_size_t const counter_type_tsu_sl = 36
 
static data_size_t const counter_type_tsu_nl = 42
 
static data_size_t const counter_type_tsu_su = 48
 
static data_size_t const counter_type_bsu_rm = 64
 
static data_size_t const counter_type_bsu_cu = 74
 
static data_size_t const counter_type_bsu_cl1 = 80
 
static data_size_t const counter_type_bsu_extra = 81
 
static data_size_t const counter_type_bsu_cl2 = 88
 
static data_size_t const counter_type_bsu_rl = 98
 
static data_size_t const counter_type_padding = 128
 
static data_size_t const counter_type_unknown = 129
 
static data_size_t const counter_type_bsu_cl = 130
 
static size_t const size_bytes = 2*sizeof(uint64_t)
 
static size_t const size_u32 = size_bytes/sizeof(uint32_t)
 
static size_t const size_words_ptb_u32 = 3
 
static size_t const size_words_ptb_bytes = size_words_ptb_u32*sizeof(uint32_t)
 
static size_t const ptb_offset_u32 = 0
 
static size_t const ptb_offset_bytes = ptb_offset_u32*sizeof(uint32_t)
 
static size_t const payload_offset_u32 = 1+ptb_offset_u32
 
static size_t const payload_offset_bytes = payload_offset_u32*sizeof(uint32_t)
 

Detailed Description

Counter payload description.

Definition at line 192 of file PennMicroSlice.hh.

Member Typedef Documentation

Definition at line 193 of file PennMicroSlice.hh.

Definition at line 194 of file PennMicroSlice.hh.

Member Function Documentation

counter_set_t dune::PennMicroSlice::Payload_Counter::get_bsu_cl ( )
inline

Definition at line 268 of file PennMicroSlice.hh.

268 {return ((bsu_cl2 << 10) | (bsu_cl1));};
bool dune::PennMicroSlice::Payload_Counter::get_bsu_cl ( uint32_t  idx)
inline

Definition at line 299 of file PennMicroSlice.hh.

299  {
300  if (idx < num_bits_bsu_cl1) {
301  return ((bsu_cl1 & (1 << idx)) != 0x0);
302  } else {
303  return ((bsu_cl2 & (1 << (idx-num_bits_bsu_cl1))) != 0x0);
304  }
305  }
static data_size_t const num_bits_bsu_cl1
bool dune::PennMicroSlice::Payload_Counter::get_bsu_cu ( uint32_t  idx)
inline

Definition at line 295 of file PennMicroSlice.hh.

295  {
296  return ((bsu_cu & (1 << idx)) != 0x0);
297  }
bool dune::PennMicroSlice::Payload_Counter::get_bsu_rl ( uint32_t  idx)
inline

Definition at line 306 of file PennMicroSlice.hh.

306  {
307  return ((bsu_rl & (1 << idx)) != 0x0);
308  }
bool dune::PennMicroSlice::Payload_Counter::get_bsu_rm ( uint32_t  idx)
inline

Definition at line 292 of file PennMicroSlice.hh.

292  {
293  return ((bsu_rm & (1 << idx)) != 0x0);
294  }
bool dune::PennMicroSlice::Payload_Counter::get_counter_status ( uint32_t  idx) const
inline

Definition at line 310 of file PennMicroSlice.hh.

310  {
311  // This was tested to return the right bits in the right order in a standalone test
312  // However, it is up to the user to know what type this bit corresponds to
313  return (((reinterpret_cast<const uint8_t*>(this)[idx/8]) & (1 << (idx%8))) != 0x0);
314  }
static data_size_t dune::PennMicroSlice::Payload_Counter::get_counter_type ( uint32_t  bit_idx)
inlinestatic

Definition at line 316 of file PennMicroSlice.hh.

316  {
317  // NFB: By construction bit_idx cannot be negative
318  // if (bit_idx < 0) return counter_type_unknown; else
319  if (bit_idx < counter_type_tsu_wu) return counter_type_tsu_wu;
320  else if (bit_idx < counter_type_tsu_el) return counter_type_tsu_el;
321  else if (bit_idx < counter_type_tsu_extra) return counter_type_tsu_extra;
322  else if (bit_idx < counter_type_tsu_nu) return counter_type_tsu_nu;
323  else if (bit_idx < counter_type_tsu_sl) return counter_type_tsu_sl;
324  else if (bit_idx < counter_type_tsu_nl) return counter_type_tsu_nl;
325  else if (bit_idx < counter_type_tsu_su) return counter_type_tsu_su;
326  else if (bit_idx < counter_type_bsu_rm) return counter_type_bsu_rm;
327  else if (bit_idx < counter_type_bsu_cu) return counter_type_bsu_cu;
328  else if (bit_idx == (counter_type_bsu_extra-1)) return counter_type_bsu_extra;
329  else if (bit_idx < counter_type_bsu_cl2) return counter_type_bsu_cl;
330  else if (bit_idx < counter_type_bsu_rl) return counter_type_bsu_rl;
331  else if (bit_idx < counter_type_padding) return counter_type_padding;
332  else return counter_type_unknown;
333  }
static data_size_t const counter_type_tsu_el
static data_size_t const counter_type_bsu_cu
static data_size_t const counter_type_tsu_nu
static data_size_t const counter_type_tsu_wu
static data_size_t const counter_type_bsu_rm
static data_size_t const counter_type_bsu_cl2
static data_size_t const counter_type_tsu_nl
static data_size_t const counter_type_tsu_extra
static data_size_t const counter_type_bsu_extra
static data_size_t const counter_type_tsu_sl
static data_size_t const counter_type_tsu_su
static data_size_t const counter_type_bsu_rl
static data_size_t const counter_type_padding
static data_size_t const counter_type_unknown
static data_size_t const counter_type_bsu_cl
static uint32_t dune::PennMicroSlice::Payload_Counter::get_counter_type_pos ( uint32_t  bit_idx)
inlinestatic

Definition at line 337 of file PennMicroSlice.hh.

337  {
338  if (bit_idx < counter_type_tsu_wu) return bit_idx;
339  else if (bit_idx < counter_type_tsu_el) return (bit_idx - counter_type_tsu_wu);
340  else if (bit_idx < counter_type_tsu_extra) return (bit_idx - counter_type_tsu_el);
341  else if (bit_idx < counter_type_tsu_nu) return (bit_idx - counter_type_tsu_extra);
342  else if (bit_idx < counter_type_tsu_sl) return (bit_idx - counter_type_tsu_nu);
343  else if (bit_idx < counter_type_tsu_nl) return (bit_idx - counter_type_tsu_sl);
344  else if (bit_idx < counter_type_tsu_su) return (bit_idx - counter_type_tsu_nl);
345  else if (bit_idx < counter_type_bsu_rm) return (bit_idx - counter_type_tsu_su);
346  else if (bit_idx < counter_type_bsu_cu) return (bit_idx - counter_type_bsu_rm);
347  else if (bit_idx == (counter_type_bsu_extra-1)) return 0;
348  else if (bit_idx < counter_type_bsu_cl1) return (bit_idx - counter_type_bsu_cu);
349  // -- offset the extra position that is unused in between
350  else if (bit_idx < counter_type_bsu_cl2) return (bit_idx - counter_type_bsu_cu -1);
351  else if (bit_idx < counter_type_bsu_rl) return (bit_idx - counter_type_bsu_cl2);
352  else if (bit_idx < counter_type_padding) return (bit_idx - counter_type_bsu_rl);
353  else return counter_type_unknown;
354 
355 }
static data_size_t const counter_type_tsu_el
static data_size_t const counter_type_bsu_cu
static data_size_t const counter_type_tsu_nu
static data_size_t const counter_type_tsu_wu
static data_size_t const counter_type_bsu_rm
static data_size_t const counter_type_bsu_cl2
static data_size_t const counter_type_tsu_nl
static data_size_t const counter_type_tsu_extra
static data_size_t const counter_type_bsu_cl1
static data_size_t const counter_type_bsu_extra
static data_size_t const counter_type_tsu_sl
static data_size_t const counter_type_tsu_su
static data_size_t const counter_type_bsu_rl
static data_size_t const counter_type_padding
static data_size_t const counter_type_unknown
bool dune::PennMicroSlice::Payload_Counter::get_tsu_el ( uint32_t  idx)
inline

Definition at line 273 of file PennMicroSlice.hh.

273  {
274  return ((tsu_el & (1 << idx)) != 0x0);
275  }
bool dune::PennMicroSlice::Payload_Counter::get_tsu_extra ( uint32_t  idx)
inline

Definition at line 276 of file PennMicroSlice.hh.

276  {
277  return ((tsu_extra & (1 << idx)) != 0x0);
278  }
bool dune::PennMicroSlice::Payload_Counter::get_tsu_nl ( uint32_t  idx)
inline

Definition at line 285 of file PennMicroSlice.hh.

285  {
286  return ((tsu_nl & (1 << idx)) != 0x0);
287  }
bool dune::PennMicroSlice::Payload_Counter::get_tsu_nu ( uint32_t  idx)
inline

Definition at line 279 of file PennMicroSlice.hh.

279  {
280  return ((tsu_nu & (1 << idx)) != 0x0);
281  }
bool dune::PennMicroSlice::Payload_Counter::get_tsu_sl ( uint32_t  idx)
inline

Definition at line 282 of file PennMicroSlice.hh.

282  {
283  return ((tsu_sl & (1 << idx)) != 0x0);
284  }
bool dune::PennMicroSlice::Payload_Counter::get_tsu_su ( uint32_t  idx)
inline

Definition at line 288 of file PennMicroSlice.hh.

288  {
289  return ((tsu_su & (1 << idx)) != 0x0);
290  }
bool dune::PennMicroSlice::Payload_Counter::get_tsu_wu ( uint32_t  idx)
inline

Definition at line 270 of file PennMicroSlice.hh.

270  {
271  return ((tsu_wu & (1 << idx)) != 0x0);
272  }

Member Data Documentation

counter_set_t dune::PennMicroSlice::Payload_Counter::bsu_cl1

Definition at line 209 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::bsu_cl2

Definition at line 211 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::bsu_cu

Definition at line 207 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::bsu_extra

Definition at line 210 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::bsu_rl

Definition at line 212 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::bsu_rm

Definition at line 206 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_bsu_cl = 130
static

Definition at line 252 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_bsu_cl1 = 80
static

Definition at line 245 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_bsu_cl2 = 88
static

Definition at line 247 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_bsu_cu = 74
static

Definition at line 244 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_bsu_extra = 81
static

Definition at line 246 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_bsu_rl = 98
static

Definition at line 248 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_bsu_rm = 64
static

Definition at line 243 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_padding = 128
static

Definition at line 249 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_tsu_el = 20
static

Definition at line 237 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_tsu_extra = 24
static

Definition at line 238 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_tsu_nl = 42
static

Definition at line 241 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_tsu_nu = 30
static

Definition at line 239 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_tsu_sl = 36
static

Definition at line 240 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_tsu_su = 48
static

Definition at line 242 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_tsu_wu = 10
static

Definition at line 236 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::counter_type_unknown = 129
static

Definition at line 251 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_bsu_cl = 13
static

Definition at line 230 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_bsu_cl1 = 6
static

Definition at line 225 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_bsu_cl2 = 7
static

Definition at line 227 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_bsu_cu = 10
static

Definition at line 224 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_bsu_extra = 1
static

Definition at line 226 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_bsu_rl = 10
static

Definition at line 228 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_bsu_rm = 16
static

Definition at line 223 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_padding = 30
static

Definition at line 229 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_tsu_el = 10
static

Definition at line 217 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_tsu_extra = 4
static

Definition at line 218 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_tsu_nl = 6
static

Definition at line 221 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_tsu_nu = 6
static

Definition at line 219 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_tsu_sl = 6
static

Definition at line 220 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_tsu_su = 6
static

Definition at line 222 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Counter::num_bits_tsu_wu = 10
static

Definition at line 216 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::padding

Definition at line 214 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Counter::payload_offset_bytes = payload_offset_u32*sizeof(uint32_t)
static

Definition at line 266 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Counter::payload_offset_u32 = 1+ptb_offset_u32
static

Definition at line 265 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Counter::ptb_offset_bytes = ptb_offset_u32*sizeof(uint32_t)
static

Definition at line 262 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Counter::ptb_offset_u32 = 0
static

Definition at line 261 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Counter::size_bytes = 2*sizeof(uint64_t)
static

Definition at line 254 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Counter::size_u32 = size_bytes/sizeof(uint32_t)
static

Definition at line 255 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Counter::size_words_ptb_bytes = size_words_ptb_u32*sizeof(uint32_t)
static

Definition at line 259 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Counter::size_words_ptb_u32 = 3
static

Definition at line 258 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::tsu_el

Definition at line 199 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::tsu_extra

Definition at line 200 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::tsu_nl

Definition at line 203 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::tsu_nu

Definition at line 201 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::tsu_sl

Definition at line 202 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::tsu_su

Definition at line 204 of file PennMicroSlice.hh.

counter_set_t dune::PennMicroSlice::Payload_Counter::tsu_wu

Definition at line 198 of file PennMicroSlice.hh.


The documentation for this struct was generated from the following file: