GQE Kernel Configuration APIs

These APIs are software APIs that can be used to genreate configuration bits for hardware kernels listed above.

class xf::database::gqe::KernelCommand

#include "xf_database/kernel_command.hpp"

Overview

Class for generating configuration bits of gqePart , gqeJoin and gqeFilter kernels.


Methods

KernelCommand

KernelCommand ()

constructor of KernelCommand class. The kernel command used buffer is allocated on host. Some default settings are provided.

setBypassOn

void setBypassOn (bool trigger)

set bypass on.

Parameters:

trigger 0 for off, 1 for on.

setJoinOn

void setJoinOn (bool trigger)

set join on.

Parameters:

trigger 0 for off, 1 for on.

setJoinType

void setJoinType (int join_type)

set join type.

Parameters:

join_type hash join type, 0 for INNER, 1 for SEMI, 2 for ANTI.

setJoinAppendMode

void setJoinAppendMode (int ap_mode)

set join append mode.

Parameters:

ap_mode append mode.

setBloomfilterOn

void setBloomfilterOn (bool trigger)

set bloom-filter on.

Parameters:

bf_size size of bloom-filter in bits, we need 35 bits to represent a range between 1 to 16 Gbits.

setBloomfilterSize

void setBloomfilterSize (ap_uint <36> bf_size)

set bloom-filter size.

Parameters:

bf_size size of bloom-filter in bits, we need 35 bits to represent a range between 1 to 16 Gbits.

setPartOn

void setPartOn (int trigger)

set partition on.

Parameters:

trigger 0 for off, 1 for on.

setLogPart

void setLogPart (int log_part)

set log of partition number.

Parameters:

log_part log of partition number.

setAggrOn

void setAggrOn (bool trigger = true)

set aggregate on.

Parameters:

trigger false for off, true for on.

setDualKeyOn

void setDualKeyOn (bool trigger = true)

set dual key on.

Parameters:

trigger false for using 1 column as key, true for using two.

setJoinBuildProbe

void setJoinBuildProbe (bool flag)

set join build probe flag.

Parameters:

flag 0 for build, 1 for probe.

setBloomfilterBuildProbe

void setBloomfilterBuildProbe (bool flag)

set bloom filter build probe flag.

Parameters:

flag 0 for build, 1 for probe.

setScanColEnable

void setScanColEnable (
    int table_id,
    std::vector <int8_t> index
    )

enables input columns for gqeKernel.

Parameters:

table_id 0 for left table, 1 for right table.
index valid input column ids.

setWriteColEnable

void setWriteColEnable (
    int krn_type,
    int table_id,
    std::vector <int8_t> index
    )

enables output columns for gqeKernel.

Parameters:

krn_type 0 for gqeJoin, 1 for gqePart, 2 for gqeFilter
table_id 0 for left table, 1 for right table
index output column ids

setRowIDValidEnable

void setRowIDValidEnable (
    int table_id,
    bool gen_rowID_en,
    bool valid_en
    )

set gen_rowIDEnable and validEnable flag.

Parameters:

table_id 0 for left table, 1 for right table.
gen_rowID_en enable flag for using GQE to generate row IDs internally. 1 for enable, 0 for disable.
valid_en enable flag for getting valid bits from off-chip memory or enabing every row internally. 1 for valid bits from off-chip memory, 0 for enabling every row.

setFilter

void setFilter (
    int table_id,
    std::string filter_string
    )

set Filter string.

The string uses a , b , c , d to refer to first to the fourth column, and supports comparison and logical operator like C++. Parentheses can be used to group logic, but notice that the underlying hardware module does not support comparing one column with multiple constant boundaries in OR relationship. Integral constants will be extracted from expression.

For example, an expression could be (a < 10 && b < 20) || (c >= d) .

Parameters:

table_id 0 for left table, 1 for right table
filter_string filter expression string

getConfigBits

ap_uint <512>* getConfigBits () const

return config bit array.

class xf::database::gqe::AggrCommand

#include "xf_database/aggr_command.hpp"

Overview

Class for generating configuration bits of gqeAggr kernel.


Methods

AggrCommand

AggrCommand ()

construct of AggrCommand .

The aggregate command used buffer is allocated on host. Some default settings are provided.

Scan

void Scan (std::vector <int8_t> index)

scan valid cols and shuffle for evaluation 1.

Parameters:

index input valid column ids

setEvaluation

setEvaluation overload (1)
void setEvaluation (
    int eval_id,
    std::string s0,
    std::vector <int32_t> index,
    int post_div = nosf
    )

set Evaluation string.

Parameters:

eval_id most support two evaluations
s0 evaluation string for special strm format (not support ‘/’)
index evaluation constants for each strm, default 0
post_div post division alu operation, nosf for no division, sf10 for “a/10”, sf100 for “a/100”, sf1k for “a/1000”, sf10k for “a/10000” (a is result of evaluation expression)
setEvaluation overload (2)
void setEvaluation (
    int eval_id,
    std::string eval_str
    )

set Evaluation string.

Parameters:

eval_id most two evaluations
eval_str evaluation expression string

setFilter

setFilter overload (1)
void setFilter (std::string filter_string)

set Filter string.

The string uses a , b , c , d to refer to first to the fourth column, and supports comparison and logical operator like C++. Parentheses can be used to group logic, but notice that the underlying hardware module does not support comparing one column with multiple constant boundaries in OR relationship. Integral constants will be extracted from expression.

For example, an expression could be (a < 10 && b < 20) || (c >= d) .

Parameters:

filter_string filter expression string

setShuffle0

void setShuffle0 (std::vector <int8_t> index)

set shuffle0 column ids.

Parameters:

index shuffle0 key list,move evaluation keys to first 4 locations

setShuffle1

void setShuffle1 (std::vector <int8_t> index)

set shuffle1 column ids.

Parameters:

index shuffle1 key list,move filter keys to first 4 locations

setShuffle2

void setShuffle2 (std::vector <int8_t> index)

set shuffle2 column ids.

Parameters:

index set column indexes of keys

setShuffle3

void setShuffle3 (std::vector <int8_t> index)

set shuffle3 column ids.

Parameters:

index set column indexes of payloads

setGroupAggr

void setGroupAggr (
    int ind,
    ap_uint <4> aggr_op
    )

set Group Aggregation type of setting index

Parameters:

ind set index of column
aggr_op Aggregation type of setting index

setGroupAggrs

void setGroupAggrs (std::vector <ap_uint <4>> index)

set Group Aggregation types

Parameters:

index list of Aggregation types, starting from the first column, align with columns in shuffle3

setMerge

void setMerge (
    int m_id,
    std::vector <uint8_t> index
    )

set Merge column index in setting round of merge

merge flow : four list : key, count, aggr_l and aggr_h, each one has size 8 key is aligned with shuffle2, count, aggr_l and aggr_h are aligned with shuffle3 and setGroupAggr merge 0,1,2 merge key into the other three merge 3,4 merge count pld into other two

Parameters:

m_id round id of column merge
index merge colum list in current round

columnMerge

void columnMerge (std::vector <ap_uint <4>> index)

set Merge codes in each round of merge

merge flow : four list : key, count, aggr_h, aggr_l (each one has size 8) key is aligned with shuffle2, count, aggr_h and aggr_l are aligned with shuffle3 and setGroupAggr merge 0,1,2 merge key into the other three merge 3,4 merge count pld into other two

Parameters:

index coded merging indexes

setDirectAggrs

void setDirectAggrs (std::vector <uint8_t> index)

set demux direct aggregations

Parameters:

index columns of using direct aggregations

setWriteCol

void setWriteCol (std::vector <int8_t> index)

set output column ids.

Parameters:

index output column ids

getConfigBits

ap_uint <W>* getConfigBits () const

return config bit array.

getConfigOutBits

ap_uint <W>* getConfigOutBits ()

return config out bit array.