Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f054fdd
Start on what a ZCU102 packet might look like.
jaycedowell Feb 4, 2025
e7cd603
Formatting plus a few snap2 -> zcu102 changes that I missed.
jaycedowell Feb 4, 2025
4e6f0a1
Switch to the new COR format where the averaging time is in units of …
jaycedowell Jul 21, 2025
42a2a0d
Merge branch 'master' into zcu102
jaycedowell Jul 21, 2025
748772b
Work on a new TBX format to replace TBF.
jaycedowell Jul 22, 2025
b143503
Merge branch 'master' into zcu102
jaycedowell Jul 22, 2025
34797cb
Merge branch 'master' into zcu102
jaycedowell Jul 22, 2025
089d031
Merge branch 'master' into zcu102
jaycedowell Jul 22, 2025
1386fef
Merge branch 'master' into zcu102
jaycedowell Jul 22, 2025
a969b0b
Merge branch 'master' into zcu102
jaycedowell Jul 22, 2025
e1eadc7
Add ZCU102 callback setter.
jaycedowell Jul 22, 2025
3fe6de9
Missing function def.
jaycedowell Jul 22, 2025
caeda56
Missing function.
jaycedowell Jul 22, 2025
ed4af5a
Merge branch 'master' into zcu102
jaycedowell Jul 22, 2025
ea41859
Merge branch 'master' into zcu102
jaycedowell Jul 22, 2025
3eaa8dc
Fix types.
jaycedowell Jul 22, 2025
974d541
Merge branch 'master' into zcu102
jaycedowell Jul 22, 2025
9584f19
Merge branch 'master' into zcu102
jaycedowell Jul 23, 2025
e43d80e
We need to represent over 255 channels in an IBeam.
jaycedowell Jul 23, 2025
d051af8
Flip that around.
jaycedowell Jul 23, 2025
f87bc3a
+1 for the underscore.
jaycedowell Jul 24, 2025
2e9f057
Cleanup.
jaycedowell Jul 30, 2025
6f92964
Switch using 0x08 as the frame ID flag.
jaycedowell Jul 30, 2025
23e2d2d
Fix the unpacking.
jaycedowell Jul 30, 2025
776058d
Change the TBX header size to make things easier in DROS.
jaycedowell Aug 5, 2025
f85d256
Merge branch 'master' into zcu102
jaycedowell Nov 4, 2025
2b0c565
Make pkt->tuning consistent across chan_block_id.
jaycedowell Dec 15, 2025
5f52bb2
Update defaults and make the size of the completion queue batches con…
jaycedowell Jan 23, 2026
2d17a19
Cleanup the intrinsics (and fix a bug).
jaycedowell Jan 23, 2026
a0979b1
Make sure we update the verbs memory region correctly. Also, skip ov…
jaycedowell Jan 23, 2026
8b88a74
Don't over-increment.
jaycedowell Jan 23, 2026
8948677
They are the same under BF_UNPACK_FACTOR = 1.
jaycedowell Jan 23, 2026
56fbee5
Huh, when did this become a problem?
jaycedowell Jan 23, 2026
345d51b
Cleanup source blanking.
jaycedowell Jan 24, 2026
e8d1ad4
Merge branch 'master' into zcu102
jaycedowell Jan 26, 2026
955d72f
Bad merge.
jaycedowell Jan 26, 2026
a7c456d
Merge branch 'master' into zcu102
jaycedowell Jan 26, 2026
c60d468
Partial unroll.
jaycedowell Jan 29, 2026
01b4487
Make the default buffer a little larger.
jaycedowell Jan 29, 2026
f360afc
Fixed a few problems with the AXV copies and also did a partial unrol…
jaycedowell Jan 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ RDMA_MAXMEM
HAVE_RDMA
VERBS_SEND_PACING
VERBS_SEND_NPKTBUF
VERBS_WCBATCH
VERBS_NPKTBUF
HAVE_VERBS
HAVE_VMA
Expand Down Expand Up @@ -861,6 +862,7 @@ enable_hwloc
enable_vma
enable_verbs
with_rx_buffer_size
with_verbs_wcbatch
with_tx_buffer_size
enable_rdma
with_rdma_max_mem
Expand Down Expand Up @@ -1584,7 +1586,9 @@ Optional Packages:
compiler's sysroot if not specified).
--with-ctags=[PATH] absolute path to ctags executable
--with-rx-buffer-size=N default Infiniband verbs receive buffer size in
packets (default=8192)
packets (default=32768)
--with-verbs-wcbatch=N default Infiniband verbs completion queue batch size
(default=64)
--with-tx-buffer-size=N default Infiniband verbs send buffer size in packets
(default=512)
--with-rdma-max-mem=N maximum RDMA buffer size in bytes
Expand Down Expand Up @@ -21549,7 +21553,7 @@ if test ${with_rx_buffer_size+y}
then :
withval=$with_rx_buffer_size;
else case e in #(
e) with_rx_buffer_size=8192 ;;
e) with_rx_buffer_size=32768 ;;
esac
fi

Expand All @@ -21562,6 +21566,24 @@ then :
fi


# Check whether --with-verbs-wcbatch was given.
if test ${with_verbs_wcbatch+y}
then :
withval=$with_verbs_wcbatch;
else case e in #(
e) with_verbs_wcbatch=64 ;;
esac
fi

VERBS_WCBATCH=$with_verbs_wcbatch

if test x$HAVE_VERBS = x0
then :
VERBS_WCBATCH=0

fi


# Check whether --with-tx-buffer-size was given.
if test ${with_tx_buffer_size+y}
then :
Expand Down
13 changes: 11 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,22 @@ AS_IF([test x$enable_verbs != xno],

AC_ARG_WITH([rx-buffer-size],
[AS_HELP_STRING([--with-rx-buffer-size=N],
[default Infiniband verbs receive buffer size in packets (default=8192)])],
[default Infiniband verbs receive buffer size in packets (default=32768)])],
[],
[with_rx_buffer_size=8192])
[with_rx_buffer_size=32768])
AC_SUBST([VERBS_NPKTBUF], [$with_rx_buffer_size])
AS_IF([test x$HAVE_VERBS = x0],
[AC_SUBST([VERBS_NPKTBUF], [0])])

AC_ARG_WITH([verbs-wcbatch],
[AS_HELP_STRING([--with-verbs-wcbatch=N],
[default Infiniband verbs completion queue batch size (default=64)])],
[],
[with_verbs_wcbatch=64])
AC_SUBST([VERBS_WCBATCH], [$with_verbs_wcbatch])
AS_IF([test x$HAVE_VERBS = x0],
[AC_SUBST([VERBS_WCBATCH], [0])])

AC_ARG_WITH([tx-buffer-size],
[AS_HELP_STRING([--with-tx-buffer-size=N],
[default Infiniband verbs send buffer size in packets (default=512)])],
Expand Down
4 changes: 4 additions & 0 deletions python/bifrost/packet_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def set_snap2(self, fnc: _bf.BFpacketcapture_snap2_sequence_callback):
self._ref_cache['snap2'] = _bf.BFpacketcapture_snap2_sequence_callback(fnc)
_check(_bf.bfPacketCaptureCallbackSetSNAP2(
self.obj, self._ref_cache['snap2']))
def set_zcu102(self, fnc: _bf.BFpacketcapture_zcu102_sequence_callback):
self._ref_cache['zcu102'] = _bf.BFpacketcapture_zcu102_sequence_callback(fnc)
_check(_bf.bfPacketCaptureCallbackSetZCU102(
self.obj, self._ref_cache['zcu102']))
def set_ibeam(self, fnc: _bf.BFpacketcapture_ibeam_sequence_callback):
self._ref_cache['ibeam'] = _bf.BFpacketcapture_ibeam_sequence_callback(fnc)
_check(_bf.bfPacketCaptureCallbackSetIBeam(
Expand Down
1 change: 1 addition & 0 deletions src/bifrost/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ extern "C" {
#define BF_VERBS_ENABLED @HAVE_VERBS@
#define BF_VERBS_NPKTBUF @VERBS_NPKTBUF@
#define BF_VERBS_SEND_NPKTBUF @VERBS_SEND_NPKTBUF@
#define BF_VERBS_WCBATCH @VERBS_WCBATCH@
#define BF_VERBS_SEND_PACING @VERBS_SEND_PACING@
#define BF_RDMA_ENABLED @HAVE_RDMA@
#define BF_RDMA_MAXMEM @RDMA_MAXMEM@
Expand Down
4 changes: 4 additions & 0 deletions src/bifrost/packet_capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ typedef int (*BFpacketcapture_chips_sequence_callback)(BFoffset, int, int, int,
BFoffset*, void const**, size_t*);
typedef int (*BFpacketcapture_snap2_sequence_callback)(BFoffset, int, int, int,
BFoffset*, void const**, size_t*);
typedef int (*BFpacketcapture_zcu102_sequence_callback)(BFoffset, int, int, int,
BFoffset*, void const**, size_t*);
typedef int (*BFpacketcapture_ibeam_sequence_callback)(BFoffset, int, int, int,
BFoffset*, void const**, size_t*);
typedef int (*BFpacketcapture_pbeam_sequence_callback)(BFoffset, BFoffset, int, int, int,
Expand All @@ -69,6 +71,8 @@ BFstatus bfPacketCaptureCallbackSetCHIPS(BFpacketcapture_callback obj,
BFpacketcapture_chips_sequence_callback callback);
BFstatus bfPacketCaptureCallbackSetSNAP2(BFpacketcapture_callback obj,
BFpacketcapture_snap2_sequence_callback callback);
BFstatus bfPacketCaptureCallbackSetZCU102(BFpacketcapture_callback obj,
BFpacketcapture_zcu102_sequence_callback callback);
BFstatus bfPacketCaptureCallbackSetIBeam(BFpacketcapture_callback obj,
BFpacketcapture_ibeam_sequence_callback callback);
BFstatus bfPacketCaptureCallbackSetPBeam(BFpacketcapture_callback obj,
Expand Down
4 changes: 2 additions & 2 deletions src/formats/cor.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2021, The Bifrost Authors. All rights reserved.
* Copyright (c) 2019-2025, The Bifrost Authors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -72,7 +72,7 @@ class CORDecoder : virtual public PacketDecoder {
pkt->sync = pkt_hdr->sync_word;
pkt->time_tag = be64toh(pkt_hdr->time_tag);
pkt->decimation = be32toh(pkt_hdr->navg);
pkt->seq = pkt->time_tag / 196000000 / (pkt->decimation / 100);
pkt->seq = pkt->time_tag / pkt->decimation;
pkt->nsrc = _nsrc;
pkt->src = (stand0*(2*(nstand-1)+1-stand0)/2 + stand1 + 1 - _src0)*nserver \
+ (server - 1);
Expand Down
1 change: 0 additions & 1 deletion src/formats/drx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class DRXProcessor : virtual public PacketProcessor {
*(aligned_data + src) = 0;
aligned_data += nsrc;
}
aligned_data += t*4096*nsrc;
}
}
};
Expand Down
1 change: 0 additions & 1 deletion src/formats/drx8.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class DRX8Processor : virtual public PacketProcessor {
*(aligned_data + src) = 0;
aligned_data += nsrc;
}
aligned_data += t*4096*nsrc;
}
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/formats/formats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@
#include "pbeam.hpp"
#include "simple.hpp"
#include "vbeam.hpp"
#include "zcu102.hpp"
#include "tbx.hpp"
28 changes: 14 additions & 14 deletions src/formats/ibeam.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, The Bifrost Authors. All rights reserved.
* Copyright (c) 2019-2025, The Bifrost Authors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -33,11 +33,11 @@
//#include <immintrin.h> // SSE

struct __attribute__((packed)) ibeam_hdr_type {
uint8_t server; // Note: 1-based
uint8_t gbe; // (AKA tuning)
uint8_t nchan; // 109
uint8_t nbeam; // 2
uint8_t nserver; // 6
uint16_t server; // Note: 1-based
uint16_t gbe; // (AKA tuning)
uint16_t nchan; // 109
uint16_t nbeam; // 2
uint16_t nserver; // 6
// Note: Big endian
uint16_t chan0; // First chan in packet
uint64_t seq; // Note: 1-based
Expand Down Expand Up @@ -67,9 +67,9 @@ class IBeamDecoder: virtual public PacketDecoder {
pkt->seq = be64toh(pkt_hdr->seq) - 1;
//pkt->nsrc = pkt_hdr->nserver;
pkt->nsrc = _nsrc;
pkt->src = (pkt_hdr->server - 1) - _src0;
pkt->beam = pkt_hdr->nbeam;
pkt->nchan = pkt_hdr->nchan;
pkt->src = (ntohs(pkt_hdr->server) - 1) - _src0;
pkt->beam = ntohs(pkt_hdr->nbeam);
pkt->nchan = ntohs(pkt_hdr->nchan);
pkt->chan0 = ntohs(pkt_hdr->chan0) - pkt->nchan * pkt->src;
pkt->payload_size = pld_size;
pkt->payload_ptr = pkt_pld;
Expand Down Expand Up @@ -164,11 +164,11 @@ class IBeamHeaderFiller : virtual public PacketHeaderFiller {
ibeam_hdr_type* header = reinterpret_cast<ibeam_hdr_type*>(hdr);
memset(header, 0, sizeof(ibeam_hdr_type));

header->server = hdr_base->src + 1;
header->gbe = hdr_base->tuning;
header->nchan = hdr_base->nchan;
header->nbeam = _nbeam;
header->nserver = hdr_base->nsrc;
header->server = htons(hdr_base->src + 1);
header->gbe = htons(hdr_base->tuning);
header->nchan = htons(hdr_base->nchan);
header->nbeam = htons(_nbeam);
header->nserver = htons(hdr_base->nsrc);
header->chan0 = htons(hdr_base->chan0);
header->seq = htobe64(hdr_base->seq);
}
Expand Down
35 changes: 20 additions & 15 deletions src/formats/snap2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,21 @@ class SNAP2Processor : virtual public PacketProcessor {
int c=0;
#if defined BF_AVX_ENABLED && BF_AVX_ENABLED
__m256i *dest_p;
__m256i vecbuf[2];
uint64_t *in64 = (uint64_t *)in;
__m256i *src_p = (__m256i *)in;
dest_p = (__m256i *)(out + (words_per_chan_out * (pkt_chan)) + pol_offset_out);
#endif
//if((pol_offset_out == 0) && (pkt_chan==0) && ((pkt->seq % 120)==0) ){
// fprintf(stderr, "nsrc: %d seq: %d, dest_p: %p obuf idx %d, obuf offset %lu, nseq_per_obuf %d, seq0 %d, nbuf: %d\n", pkt->nsrc, pkt->seq, dest_p, obuf_idx, obuf_offset, nseq_per_obuf, seq0, nbuf);
//}
for(c=0; c<pkt->nchan; c++) {
#if defined BF_AVX_ENABLED && BF_AVX_ENABLED
vecbuf[0] = _mm256_set_epi64x(in64[3], in64[2], in64[1], in64[0]);
vecbuf[1] = _mm256_set_epi64x(in64[7], in64[6], in64[5], in64[4]);
_mm256_stream_si256(dest_p, vecbuf[0]);
_mm256_stream_si256(dest_p+1, vecbuf[1]);
in64 += 8;
_mm256_stream_si256(dest_p, _mm256_loadu_si256(src_p));
_mm256_stream_si256(dest_p+1, _mm256_loadu_si256(src_p+1));
src_p += 2;
dest_p += words_per_chan_out;
#else
::memcpy(&out[pkt->src + pkt->nsrc*c],
&in[c], sizeof(otype));
::memcpy(out + (words_per_chan_out * (pkt_chan + c)) + pol_offset_out,
(uint8_t*)in + c * pkt->npol, pkt->npol);
#endif
}
}
Expand All @@ -184,13 +181,21 @@ class SNAP2Processor : virtual public PacketProcessor {
int nchan,
int nseq) {
typedef aligned256_type otype;
otype* __restrict__ aligned_data = (otype*)data;
for( int t=0; t<nseq; ++t ) {
for( int c=0; c<nchan; ++c ) {
::memset(&aligned_data[src + nsrc*(c + nchan*t)],
0, sizeof(otype));
}
otype* __restrict__ ptr = (otype*)data + 2*src;
int count = nseq * nchan;
#if defined BF_AVX_ENABLED && BF_AVX_ENABLED
__m256i zero = _mm256_setzero_si256();
for( int i=0; i<count; ++i ) {
_mm256_stream_si256(reinterpret_cast<__m256i*>(ptr+0), zero);
_mm256_stream_si256(reinterpret_cast<__m256i*>(ptr+1), zero);
ptr += 2*nsrc;
}
#else
for( int i=0; i<count; ++i ) {
::memset(ptr, 0, 2*sizeof(otype));
ptr += 2*nsrc;
}
#endif
}
};

Expand Down
63 changes: 63 additions & 0 deletions src/formats/tbx.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2025, The Bifrost Authors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of The Bifrost Authors nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#include "base.hpp"

struct __attribute__((packed)) tbx_hdr_type {
uint32_t sync_word;
uint32_t frame_count_word;
uint32_t seconds_count;
uint32_t first_chan;
uint16_t nstand;
uint16_t nchan;
uint64_t time_tag;
};

template<int16_t NSTAND>
class TBXHeaderFiller : virtual public PacketHeaderFiller {
int16_t _nstand = NSTAND;
public:
inline int get_size() { return sizeof(tbx_hdr_type); }
inline void operator()(const PacketDesc* hdr_base,
BFoffset framecount,
char* hdr) {
tbx_hdr_type* header = reinterpret_cast<tbx_hdr_type*>(hdr);
memset(header, 0, sizeof(tbx_hdr_type));

header->sync_word = 0x5CDEC0DE;
// Bits 9-32 are the frame count; bits 1-8 are the TBX packet flag
header->frame_count_word = htobe32((framecount & 0xFFFFFF) \
| ((uint32_t) 0x08 << 24));
header->first_chan = htobe32(hdr_base->src);
header->nstand = htons(_nstand);
header->nchan = htons(hdr_base->nchan);
header->time_tag = htobe64(hdr_base->seq);
}
};
Loading
Loading