hashBuildProbeV3 - 2023.2 English

Vitis Libraries

Release Date
2023.2 English
#include "xf_database/hash_join_v3.hpp"
template <
    int HASH_MODE,
    int KEYW,
    int PW,
    int S_PW,
    int B_PW,
    int HASHWH,
    int HASHWL,
    int ARW,
    int CH_NM,
    int BF_W,
    int EN_BF
static void hashBuildProbeV3 (
    bool& build_probe_flag,
    hls::stream <ap_uint <KEYW>> k0_strm_arry [CH_NM],
    hls::stream <ap_uint <PW>> p0_strm_arry [CH_NM],
    hls::stream <bool> e0_strm_arry [CH_NM],
    ap_uint <256>* htb0_buf,
    ap_uint <256>* htb1_buf,
    ap_uint <256>* htb2_buf,
    ap_uint <256>* htb3_buf,
    ap_uint <256>* htb4_buf,
    ap_uint <256>* htb5_buf,
    ap_uint <256>* htb6_buf,
    ap_uint <256>* htb7_buf,
    ap_uint <256>* stb0_buf,
    ap_uint <256>* stb1_buf,
    ap_uint <256>* stb2_buf,
    ap_uint <256>* stb3_buf,
    ap_uint <256>* stb4_buf,
    ap_uint <256>* stb5_buf,
    ap_uint <256>* stb6_buf,
    ap_uint <256>* stb7_buf,
    hls::stream <ap_uint <32>>& pu_begin_status_strms,
    hls::stream <ap_uint <32>>& pu_end_status_strms,
    hls::stream <ap_uint <KEYW+S_PW+B_PW>>& j_strm,
    hls::stream <bool>& j_e_strm

Hash-Build-Probe v3 primitive, it can perform hash build and hash probe separately. It needs two call of kernel to perform build and probe seperately. There is a control flag to decide buld or probe. This primitive supports multiple build and mutiple probe, for example, you can scadule a workflow as: build0->build1->probe0->probe1->build2->build3->probe3…

The maximum size of small table is 256MBx8=2GB in this design. The total hash entries is equal to 1<<(HASHWH + HASHWL), and it is limitied to maximum of 1M entries because of the size of URAM in a single SLR.

This module can accept more than 1 input row per cycle, via multiple input channels. The small table and the big table shares the same input ports, so the width of the payload should be the max of both, while the data should be aligned to the little-end. The small table and big table should be fed only ONCE.


HASH_MODE 0 for radix and 1 for Jenkin’s Lookup3 hash.
KEYW width of key, in bit.
PW width of max payload, in bit.
S_PW width of payload of small table.
B_PW width of payload of big table.
HASHWH number of hash bits used for PU/buffer selection, 1~3.
HASHWL number of hash bits used for hash-table in PU.
ARW width of address, log2(small table max num of rows).
CH_NM number of input channels, 1,2,4.
BF_W bloom-filter hash width.
EN_BF bloom-filter switch, 0 for off, 1 for on.
build_probe_flag 0:build 1:probe
k0_strm_arry input of key columns of both tables.
p0_strm_arry input of payload columns of both tables.
e0_strm_arry input of end signal of both tables.
htb0_buf HBM/DDR buffer of hash_table0
htb1_buf HBM/DDR buffer of hash_table1
htb2_buf HBM/DDR buffer of hash_table2
htb3_buf HBM/DDR buffer of hash_table3
htb4_buf HBM/DDR buffer of hash_table4
htb5_buf HBM/DDR buffer of hash_table5
htb6_buf HBM/DDR buffer of hash_table6
htb7_buf HBM/DDR buffer of hash_table7
stb0_buf HBM/DDR buffer of PU0
stb1_buf HBM/DDR buffer of PU1
stb2_buf HBM/DDR buffer of PU2
stb3_buf HBM/DDR buffer of PU3
stb4_buf HBM/DDR buffer of PU4
stb5_buf HBM/DDR buffer of PU5
stb6_buf HBM/DDR buffer of PU6
stb7_buf HBM/DDR buffer of PU7
pu_begin_status_strms contains build id, fixed hash depth, joined number of last probe and start addr of unused stb_buf for each PU
pu_end_status_strms returns next build id, fixed hash depth, joined number of current probe and end addr of used stb_buf for each PU
j_strm output of joined result
j_e_strm end flag of joined result