From 516b722fa17123b6ae95b551c71f0b052d129f78 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 7 Jul 2010 17:15:45 -0700 Subject: uhd: change pack/unpack for 64-bit numbers to reflect hardware implementation --- host/lib/transport/gen_vrt_if_packet.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'host/lib/transport') diff --git a/host/lib/transport/gen_vrt_if_packet.py b/host/lib/transport/gen_vrt_if_packet.py index 7910ff60d..9b5bfca02 100755 --- a/host/lib/transport/gen_vrt_if_packet.py +++ b/host/lib/transport/gen_vrt_if_packet.py @@ -62,7 +62,10 @@ using namespace uhd::transport; #set $tlr_p = 0b10000 static UHD_INLINE void pack_uint64_$(suffix)(boost::uint64_t num, boost::uint32_t *mem){ - *(reinterpret_cast(mem)) = $(XE_MACRO)(num); + //*(reinterpret_cast(mem)) = $(XE_MACRO)(num); + //second word is lower 32 bits due to fpga implementation + mem[1] = $(XE_MACRO)(boost::uint32_t(num >> 0)); + mem[0] = $(XE_MACRO)(boost::uint32_t(num >> 32)); } void vrt::if_hdr_pack_$(suffix)( @@ -137,7 +140,10 @@ void vrt::if_hdr_pack_$(suffix)( } static UHD_INLINE void unpack_uint64_$(suffix)(boost::uint64_t &num, const boost::uint32_t *mem){ - num = $(XE_MACRO)(*reinterpret_cast(mem)); + //num = $(XE_MACRO)(*reinterpret_cast(mem)); + //second word is lower 32 bits due to fpga implementation + num = boost::uint64_t($(XE_MACRO)(mem[1])) << 0; + num |= boost::uint64_t($(XE_MACRO)(mem[0])) << 32; } void vrt::if_hdr_unpack_$(suffix)( -- cgit v1.2.3