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

Frame header : Common header to everything except warning words. More...

#include <PennMicroSlice.hh>

Public Types

typedef uint32_t data_t
 
typedef uint16_t data_size_t
 
typedef uint8_t data_packet_type_t
 
typedef uint32_t short_nova_timestamp_t
 

Public Member Functions

uint64_t get_full_timestamp_pre (uint64_t ts_ref)
 
uint64_t get_full_timestamp_post (uint64_t ts_ref)
 

Public Attributes

uint8_t padding: 2
 
short_nova_timestamp_t short_nova_timestamp: 27
 
data_packet_type_t data_packet_type: 3
 

Static Public Attributes

static size_t const size_bytes = sizeof(data_t)
 
static size_t const size_u32 = sizeof(data_t)/sizeof(uint32_t)
 
static data_size_t const num_bits_padding = 2
 
static data_size_t const num_bits_short_tstamp = 27
 
static data_size_t const num_bits_packet_type = 3
 

Detailed Description

Frame header : Common header to everything except warning words.

Definition at line 131 of file PennMicroSlice.hh.

Member Typedef Documentation

Definition at line 135 of file PennMicroSlice.hh.

Definition at line 133 of file PennMicroSlice.hh.

Definition at line 132 of file PennMicroSlice.hh.

Definition at line 136 of file PennMicroSlice.hh.

Member Function Documentation

uint64_t dune::PennMicroSlice::Payload_Header::get_full_timestamp_post ( uint64_t  ts_ref)
inline

Definition at line 174 of file PennMicroSlice.hh.

174  {
175  if ((ts_ref & 0x7FFFFFF) == short_nova_timestamp) {
176  // they are equal. This word is right on the border of the microslice
177  return ts_ref;
178  } else if ((ts_ref & 0x7FFFFFF) > short_nova_timestamp) {
179  // it rolled over. Has to sum the short and the difference
180  // that takes for the reference to roll over
181  return ts_ref + (0x7FFFFFF - ((ts_ref & 0x7FFFFFF))) + short_nova_timestamp;
182  } else {
183  // it didn't roll over. Just add the difference of the rollovers
184  return ts_ref + (short_nova_timestamp - (ts_ref & 0x7FFFFFF));
185  }
186  }
short_nova_timestamp_t short_nova_timestamp
uint64_t dune::PennMicroSlice::Payload_Header::get_full_timestamp_pre ( uint64_t  ts_ref)
inline

Definition at line 159 of file PennMicroSlice.hh.

159  {
160  if ((ts_ref & 0x7FFFFFF) == short_nova_timestamp) {
161  // they are equal. This word is right on the border of the microslice
162  return ts_ref;
163  } else if ((ts_ref & 0x7FFFFFF) > short_nova_timestamp) {
164  // there was no bit rollover in between
165  return ts_ref - ((ts_ref & 0x7FFFFFF) - short_nova_timestamp);
166  } else {
167  // it rolled over.
168  // Be sure of the values being set
169  return ts_ref - ((ts_ref & 0x7FFFFFF) + (0x7FFFFFF - short_nova_timestamp));
170  }
171  }
short_nova_timestamp_t short_nova_timestamp

Member Data Documentation

data_packet_type_t dune::PennMicroSlice::Payload_Header::data_packet_type

Definition at line 145 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Header::num_bits_packet_type = 3
static

Definition at line 152 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Header::num_bits_padding = 2
static

Definition at line 150 of file PennMicroSlice.hh.

data_size_t const dune::PennMicroSlice::Payload_Header::num_bits_short_tstamp = 27
static

Definition at line 151 of file PennMicroSlice.hh.

uint8_t dune::PennMicroSlice::Payload_Header::padding

Definition at line 143 of file PennMicroSlice.hh.

short_nova_timestamp_t dune::PennMicroSlice::Payload_Header::short_nova_timestamp

Definition at line 144 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Header::size_bytes = sizeof(data_t)
static

Definition at line 147 of file PennMicroSlice.hh.

size_t const dune::PennMicroSlice::Payload_Header::size_u32 = sizeof(data_t)/sizeof(uint32_t)
static

Definition at line 148 of file PennMicroSlice.hh.


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