#include "xf_database/hash_semi_join.hpp"
template < int HashMode, int WKey, int WPayload, int WHashHigh, int WhashLow, int WTmpBufferAddress, int WTmpBuffer, int NChannels, int WBloomFilter, int EnBloomFilter > static void hashSemiJoin ( hls::stream <ap_uint <WKey>> key_istrms [NChannels], hls::stream <ap_uint <WPayload>> payload_istrms [NChannels], hls::stream <bool> e0_strm_arry [NChannels], ap_uint <WTmpBuffer>* pu0_tmp_rwtpr, ap_uint <WTmpBuffer>* pu1_tmp_rwptr, ap_uint <WTmpBuffer>* pu2_tmp_rwptr, ap_uint <WTmpBuffer>* pu3_tmp_rwptr, ap_uint <WTmpBuffer>* pu4_tmp_rwptr, ap_uint <WTmpBuffer>* pu5_tmp_rwptr, ap_uint <WTmpBuffer>* pu6_tmp_rwptr, ap_uint <WTmpBuffer>* pu7_tmp_rwptr, hls::stream <ap_uint <WPayload>>& join_ostrm, hls::stream <bool>& end_ostrm )
Multi-PU Hash-Semi-Join primitive, using multiple DDR/HBM buffers.
The max number of lines of inner table is 2M in this design. It is assumed that the hash-conflict is within 256K per bin.
This module can accept more than 1 input row per cycle, via multiple input channels. The outer table and the inner table share 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 inner table should be fed TWICE, followed by the outer table ONCE.
Parameters:
HashMode | 0 for radix and 1 for Jenkin’s Lookup3 hash. |
WKey | width of key, in bit. |
WPayload | width of payload of outer table. |
WHashHigh | number of hash bits used for PU/buffer selection, 1~3. |
WhashLow | number of hash bits used for hash-table in PU. |
WTmpBufferAddress | width of address, log2(inner table max num of rows). |
WTmpBuffer | width of buffer. |
NChannels | number of input channels, 1,2,4. |
WBloomFilter | bloom-filter hash width. |
EnBloomFilter | bloom-filter switch, 0 for off, 1 for on. |
key_istrms | input of key columns of both tables. |
payload_istrms | input of payload columns of both tables. |
e0_strm_arry | input of end signal of both tables. |
pu0_tmp_rwtpr | HBM/DDR buffer of PU0 |
pu1_tmp_rwptr | HBM/DDR buffer of PU1 |
pu2_tmp_rwptr | HBM/DDR buffer of PU2 |
pu3_tmp_rwptr | HBM/DDR buffer of PU3 |
pu4_tmp_rwptr | HBM/DDR buffer of PU4 |
pu5_tmp_rwptr | HBM/DDR buffer of PU5 |
pu6_tmp_rwptr | HBM/DDR buffer of PU6 |
pu7_tmp_rwptr | HBM/DDR buffer of PU7 |
join_ostrm | output of joined rows. |
end_ostrm | end signal of joined rows. |