I need to know if there is a way to retrieve a counter-like value from
the
FPGA to timestamp the moment I sent a packet.
More precisely, I am sending a stream of packets from the host to radio,
to
be sent to another radio in the Rx side.
I need to know if there is a way to retrieve a counter-like value from the
FPGA to timestamp the moment I sent a packet.
More precisely, I am sending a stream of packets from the host to radio, to
be sent to another radio in the Rx side.
You can actually use stream tags to control the time that a packet is
transmitted
I just want to be sure, are stream tags handled by timing of the FPGA (clock
ticks) or the timestamps are being inserted from within the host userspace,
because am getting too much variability on the latency when timestamps are
inserted in the OS.
For transmit: The host generates the timestamps and the samples and
sends this to the FPGA. The FPGA interprets the timestamps and waits
until the exact moment specified by the time to transmit.
The timestamps specify an absolute time on the device, so there isnt
room for variability, the packet with time either arrives before the
scheduled transmission time or its late and wont be transmitted.
This is the case for all the USRP devices except USRP1.
I just want to be sure, are stream tags handled by timing of the FPGA
(clock
ticks) or the timestamps are being inserted from within the host
userspace,
because am getting too much variability on the latency when timestamps
are
inserted in the OS.
The FPGA interprets the timestamps and waits
until the exact moment specified by the time to transmit.
The timestamps specify an absolute time on the device
I would like to know what is the mechanism the FPGA is using to
interpret
the timestamps. You are supposing there is two time references: the
host’s
and the FPGA’s.
Is there a way to read the FPGA’s specific register that is storing the
timestamps or the value of the clock tic or whatever manner to schedule
the
transmission.
On the host, you can use an API to set the FPGA time register to
whatever you want:
set_time_now (foo)
Which will cause the FPGAs notion of the TOD to be set to “foo” as soon
as it processes it. From that point forward, the FPGA TOD register is
incremented
every 10 nanoseconds, based on the master clock on the device.
set_time_next_pps (foo)
Which will cause the FPGA to latch in the time “foo” at the next PPS
edge. Just as above, the FPGA TOD register will increment every 10
nanoseconds.
There are also calls to fetch the FPGA TOD register:
get_time_now ()
Which will tell you what the FPGA thought the TOD was at the time the
command was processed.