diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-07 17:15:45 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-07 17:15:45 -0700 |
commit | 516b722fa17123b6ae95b551c71f0b052d129f78 (patch) | |
tree | 248ca0e2d34a1761aad3e59e955be74c743dad09 /host/lib/transport | |
parent | 79c513d0b21127a5a4cfa6a70213630364a281db (diff) | |
download | uhd-516b722fa17123b6ae95b551c71f0b052d129f78.tar.gz uhd-516b722fa17123b6ae95b551c71f0b052d129f78.tar.bz2 uhd-516b722fa17123b6ae95b551c71f0b052d129f78.zip |
uhd: change pack/unpack for 64-bit numbers to reflect hardware implementation
Diffstat (limited to 'host/lib/transport')
-rwxr-xr-x | host/lib/transport/gen_vrt_if_packet.py | 10 |
1 files changed, 8 insertions, 2 deletions
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<boost::uint64_t *>(mem)) = $(XE_MACRO)(num); + //*(reinterpret_cast<boost::uint64_t *>(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<const boost::uint64_t *>(mem)); + //num = $(XE_MACRO)(*reinterpret_cast<const boost::uint64_t *>(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)( |