From 7e2edf7057edc17b3991566ac5559dfde8966934 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Wed, 13 Jan 2021 10:24:01 -0600 Subject: sim: Fix CHDR header stringification Prior to Boost 1.66, boost::format() did not support the %b format specifier, yet the minimum version of Boost required to build UHD is Boost 1.58 (as specified in the CMakeLists.txt file). Rather than force an upgrade of Boost on everyone, this commit replaces the %b format specifiers with %c and provides 'Y' or 'N' values based on the Booleans in the CHDR header being printed (EOV and EOB). --- host/include/uhd/rfnoc/chdr_types.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc/chdr_types.hpp b/host/include/uhd/rfnoc/chdr_types.hpp index 006aac708..fac0331e0 100644 --- a/host/include/uhd/rfnoc/chdr_types.hpp +++ b/host/include/uhd/rfnoc/chdr_types.hpp @@ -181,11 +181,12 @@ public: // Functions // The static_casts are because vc and num_mdata are uint8_t -> unsigned char // For some reason, despite the %u meaning unsigned int, boost still formats them // as chars - return str(boost::format("chdr_header{vc:%u, eob:%b, eov:%b, pkt_type:%u, " + return str(boost::format("chdr_header{vc:%u, eob:%c, eov:%c, pkt_type:%u, " "num_mdata:%u, seq_num:%u, length:%u, dst_epid:%u}\n") - % static_cast(get_vc()) % get_eob() % get_eov() - % get_pkt_type() % static_cast(get_num_mdata()) - % get_seq_num() % get_length() % get_dst_epid()); + % static_cast(get_vc()) % (get_eob() ? 'Y' : 'N') + % (get_eov() ? 'Y' : 'N') % get_pkt_type() + % static_cast(get_num_mdata()) % get_seq_num() % get_length() + % get_dst_epid()); } private: -- cgit v1.2.3