From 5eec31fab45649b529428cda756d04bcdaeb3134 Mon Sep 17 00:00:00 2001
From: Josh Blum <josh@joshknows.com>
Date: Mon, 6 Feb 2012 16:40:42 -0800
Subject: dsp rework: implement 64 bit ticks, no seconds

---
 host/lib/usrp/b100/b100_impl.cpp | 8 ++++----
 host/lib/usrp/b100/b100_regs.hpp | 8 ++++----
 host/lib/usrp/b100/io_impl.cpp   | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

(limited to 'host/lib/usrp/b100')

diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 08a2cdeec..ce0b9453b 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -364,10 +364,10 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
     // create time control objects
     ////////////////////////////////////////////////////////////////////
     time64_core_200::readback_bases_type time64_rb_bases;
-    time64_rb_bases.rb_secs_now = B100_REG_RB_TIME_NOW_SECS;
-    time64_rb_bases.rb_ticks_now = B100_REG_RB_TIME_NOW_TICKS;
-    time64_rb_bases.rb_secs_pps = B100_REG_RB_TIME_PPS_SECS;
-    time64_rb_bases.rb_ticks_pps = B100_REG_RB_TIME_PPS_TICKS;
+    time64_rb_bases.rb_hi_now = B100_REG_RB_TIME_NOW_HI;
+    time64_rb_bases.rb_lo_now = B100_REG_RB_TIME_NOW_LO;
+    time64_rb_bases.rb_hi_pps = B100_REG_RB_TIME_PPS_HI;
+    time64_rb_bases.rb_lo_pps = B100_REG_RB_TIME_PPS_LO;
     _time64 = time64_core_200::make(
         _fpga_ctrl, B100_REG_SR_ADDR(B100_SR_TIME64), time64_rb_bases
     );
diff --git a/host/lib/usrp/b100/b100_regs.hpp b/host/lib/usrp/b100/b100_regs.hpp
index 77b643372..987a09f03 100644
--- a/host/lib/usrp/b100/b100_regs.hpp
+++ b/host/lib/usrp/b100/b100_regs.hpp
@@ -76,10 +76,10 @@
 
 #define B100_REG_RB_MUX_32_BASE  B100_REG_SLAVE(7)
 
-#define B100_REG_RB_TIME_NOW_SECS   B100_REG_RB_MUX_32_BASE + 0
-#define B100_REG_RB_TIME_NOW_TICKS  B100_REG_RB_MUX_32_BASE + 4
-#define B100_REG_RB_TIME_PPS_SECS   B100_REG_RB_MUX_32_BASE + 8
-#define B100_REG_RB_TIME_PPS_TICKS  B100_REG_RB_MUX_32_BASE + 12
+#define B100_REG_RB_TIME_NOW_HI     B100_REG_RB_MUX_32_BASE + 0
+#define B100_REG_RB_TIME_NOW_LO     B100_REG_RB_MUX_32_BASE + 4
+#define B100_REG_RB_TIME_PPS_HI     B100_REG_RB_MUX_32_BASE + 8
+#define B100_REG_RB_TIME_PPS_LO     B100_REG_RB_MUX_32_BASE + 12
 #define B100_REG_RB_MISC_TEST32     B100_REG_RB_MUX_32_BASE + 16
 #define B100_REG_RB_COMPAT          B100_REG_RB_MUX_32_BASE + 24
 #define B100_REG_RB_GPIO            B100_REG_RB_MUX_32_BASE + 28
diff --git a/host/lib/usrp/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp
index ac7c860d2..bd60e75cf 100644
--- a/host/lib/usrp/b100/io_impl.cpp
+++ b/host/lib/usrp/b100/io_impl.cpp
@@ -84,10 +84,8 @@ void b100_impl::handle_async_message(managed_recv_buffer::sptr rbuf){
         //fill in the async metadata
         async_metadata_t metadata;
         metadata.channel = 0;
-        metadata.has_time_spec = if_packet_info.has_tsi and if_packet_info.has_tsf;
-        metadata.time_spec = time_spec_t(
-            time_t(if_packet_info.tsi), size_t(if_packet_info.tsf), _clock_ctrl->get_fpga_clock_rate()
-        );
+        metadata.has_time_spec = if_packet_info.has_tsf;
+        metadata.time_spec = time_spec_t::from_ticks(if_packet_info.tsf, _clock_ctrl->get_fpga_clock_rate());
         metadata.event_code = async_metadata_t::event_code_t(sph::get_context_code(vrt_hdr, if_packet_info));
         _io_impl->async_msg_fifo.push_with_pop_on_full(metadata);
         if (metadata.event_code &
@@ -206,6 +204,7 @@ rx_streamer::sptr b100_impl::get_rx_stream(const uhd::stream_args_t &args_){
         + vrt::max_if_hdr_words32*sizeof(boost::uint32_t)
         + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer
         - sizeof(vrt::if_packet_info_t().cid) //no class id ever used
+        - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used
     ;
     const size_t bpp = B100_MAX_PKT_BYTE_LIMIT - hdr_size;
     const size_t bpi = convert::get_bytes_per_item(args.otw_format);
@@ -262,6 +261,7 @@ tx_streamer::sptr b100_impl::get_tx_stream(const uhd::stream_args_t &args_){
         + sizeof(vrt::if_packet_info_t().tlr) //forced to have trailer
         - sizeof(vrt::if_packet_info_t().sid) //no stream id ever used
         - sizeof(vrt::if_packet_info_t().cid) //no class id ever used
+        - sizeof(vrt::if_packet_info_t().tsi) //no int time ever used
     ;
     static const size_t bpp = B100_MAX_PKT_BYTE_LIMIT - hdr_size;
     const size_t spp = bpp/convert::get_bytes_per_item(args.otw_format);
-- 
cgit v1.2.3