EDM01-07: DAG 3.7G Card User Guide
Version 7: May 2006
18
©2005
Timestamps
ERF files contains a hardware generated timestamp of each packet’s arrival.
The arrival time can be either the point at which the start of the packet arrives
(head) or the point at which the end of the packet arrives (tail).
See
Default Configuration
in
Chapter 3: Configuring the Card
earlier in this
user guide for more information on configuring the timestamp head/tail
option
The format of this timestamp is a single little-endian 64-bit fixed point
number, representing the number of seconds since midnight on the January
1970.
The high 32-bits contain the integer number of seconds, while the lower 32-
bits contain the binary fraction of the second. This allows an ultimate
resolution of 2-32 seconds, or approximately 233 picoseconds.
The ERF timestamp allows you to find the difference between two
timestamps using a single 64-bit subtraction. You do not need to check for
overflows between the two halves of the structure as you would need to do
when comparing Unix time structures.
Different DAG cards have different actual resolutions. This is accommodated
by the lowermost bits that are not active being set to zero. In this way the
interpretation of the timestamp does not need to change when higher
resolution clock hardware is available.
Example
Below is example code showing how a 64-bit ERF timestamp (erfts) can be
converted into a struct timeval representation (tv):
unsigned long long lts;
struct timeval tv;
lts = erfts;
tv.tv_sec = lts >> 32;
lts = ((lts & 0xffffffffULL) * 1000 * 1000);
lts += (lts & 0x80000000ULL) << 1; /* rounding */
tv.tv_usec = lts >> 32;
if(tv.tv_usec >= 1000000) {
tv.tv_usec -= 1000000;
tv.= 1;
}
Содержание DAG 3.7G Series
Страница 1: ......
Страница 4: ...EDM01 07 DAG 3 7G Card User Guide Version 7 May 2006 2005...
Страница 18: ...EDM01 07 DAG 3 7G Card User Guide Version 7 May 2006 12 2005...
Страница 30: ...EDM01 07 DAG 3 7G Card User Guide Version 7 May 2006 24 2005...
Страница 34: ...EDM01 07 DAG 3 7G Card User Guide Version 7 May 2006 28 2005...