hashJoinV4 - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English
#include "xf_database/hash_join_v4.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_HASH_NM,
    int BFW,
    bool EN_BF
    >
static void hashJoinV4 (
    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 <64>* htb0_buf,
    ap_uint <64>* htb1_buf,
    ap_uint <64>* htb2_buf,
    ap_uint <64>* htb3_buf,
    ap_uint <64>* htb4_buf,
    ap_uint <64>* htb5_buf,
    ap_uint <64>* htb6_buf,
    ap_uint <64>* htb7_buf,
    ap_uint <64>* stb0_buf,
    ap_uint <64>* stb1_buf,
    ap_uint <64>* stb2_buf,
    ap_uint <64>* stb3_buf,
    ap_uint <64>* stb4_buf,
    ap_uint <64>* stb5_buf,
    ap_uint <64>* stb6_buf,
    ap_uint <64>* 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-Join v4 primitive, using bloom filter to enhance performance of hash join.

The build and probe procedure is similar to which in hashJoinV3 , and this primitive adds a bloom filter to reduce the redundant access to HBM.

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. Similar to hashJoinV3 , small table and big table should be fed only once.

Parameters:

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_HASH_NM number of bloom filter, 1,2,3.
BFW bloom-filter hash width.
EN_BF bloom-filter switch, 0 for off, 1 for on.
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
pu_end_status_strms returns next build id, fixed hash depth, joined number
j_strm output of joined result
j_e_strm end flag of joined result