DP-HLS
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
frontend.h
Go to the documentation of this file.
1 
5 #ifndef FRONTEND_H
6 #define FRONTEND_H
7 
8 #include "dp_hls_common.h"
9 #include "utils.h"
10 #include <math.h>
11 
17 namespace ALIGN_TYPE
18 {
19  namespace PE
20  {
26  void Compute(char_t local_query_val,
27  char_t local_reference_val,
28  score_vec_t up_prev,
29  score_vec_t diag_prev,
30  score_vec_t left_prev,
31  const Penalties penalties,
32 #ifdef LOCAL_TRANSITION_MATRIX
33  const type_t transitions[TRANSITION_MATRIX_SIZE][TRANSITION_MATRIX_SIZE],
34 #endif
35  score_vec_t &write_score,
36  tbp_t &write_traceback);
37 
38  };
39 
45  void InitializeScores(
46  score_vec_t (&init_col_scr)[MAX_QUERY_LENGTH],
47  score_vec_t (&init_row_scr)[MAX_REFERENCE_LENGTH],
48  Penalties penalties);
49 
64  void UpdatePEMaximum(
65  const wavefront_scores_inf_t scores,
66  ScorePack (&max)[PE_NUM],
67  const idx_t chunk_row_offset, const idx_t wavefront,
68  const idx_t p_cols, const idx_t ck_idx,
69  const bool (&predicate)[PE_NUM],
70  const idx_t query_len, const idx_t ref_len);
71 
83  void InitializeMaxScores(ScorePack (&max)[PE_NUM], idx_t qry_len, idx_t ref_len);
84 
89  namespace Traceback
90  {
99  void StateMapping(tbp_t tbp, TB_STATE &state, tbr_t &navigation);
100 
107  void StateInit(tbp_t tbp, TB_STATE &state);
108  }
109 
114  namespace Helper {
115  void InitCol(score_vec_t (&init_col_scr)[MAX_QUERY_LENGTH], Penalties penalties);
116  void InitRow(score_vec_t (&init_row_scr)[MAX_REFERENCE_LENGTH], Penalties penalties);
117  }
118 
119 }
120 
121 #endif // FRONTEND_H
hls::vector< type_t, N_LAYERS > score_vec_t
Vector of scores, used to store the scores of each layer in the same coordiante in the DP matrix...
Definition: dp_hls_common.h:31
A structure to hold score and index information.
Definition: dp_hls_common.h:46
void InitializeMaxScores(ScorePack(&max)[PE_NUM], idx_t qry_len, idx_t ref_len)
Initialize the ScorePacks with the minimum/maximum values.
Declaration of types used by DP-HLS internally, referred from the user defined params.h file.
void Compute(char_t local_query_val, char_t local_reference_val, score_vec_t up_prev, score_vec_t diag_prev, score_vec_t left_prev, const Penalties penalties, score_vec_t &write_score, tbp_t &write_traceback)
The PE function defining the computation of the output score based on its upper, left, and diagonal dependencies.
score_vec_t wavefront_scores_inf_t[PE_NUM+1]
Definition: dp_hls_common.h:86
void StateMapping(tbp_t tbp, TB_STATE &state, tbr_t &navigation)
Map the current step&#39;s state and the traceback pointer to the next state and one of the Insertion...
void InitCol(score_vec_t(&init_col_scr)[MAX_QUERY_LENGTH], Penalties penalties)
void StateInit(tbp_t tbp, TB_STATE &state)
Initialize the initial traceback state based on the initial traceback pointer.
void UpdatePEMaximum(const wavefront_scores_inf_t scores, ScorePack(&max)[PE_NUM], const idx_t chunk_row_offset, const idx_t wavefront, const idx_t p_cols, const idx_t ck_idx, const bool(&predicate)[PE_NUM], const idx_t query_len, const idx_t ref_len)
This function unrolls PE_NUM units to compare the their local maximum/minimum and new cell scores...
void InitializeScores(score_vec_t(&init_col_scr)[MAX_QUERY_LENGTH], score_vec_t(&init_row_scr)[MAX_REFERENCE_LENGTH], Penalties penalties)
The function to initialize the initial row and column scores.
ap_uint< 3 > tbr_t
Definition: dp_hls_common.h:94
void InitRow(score_vec_t(&init_row_scr)[MAX_REFERENCE_LENGTH], Penalties penalties)
void Traceback(tbp_t(&tbmat)[MAX_QUERY_LENGTH][MAX_REFERENCE_LENGTH], tbr_t(&traceback_out)[MAX_REFERENCE_LENGTH+MAX_QUERY_LENGTH], const int max_row, const int max_col)
Traceback function. It extract the traceback path from a matrix of traceback pointers.