6 #include <hls_stream.h>
7 #include <hls_vector.h>
24 tbp_t (&tbmat)[MAX_QUERY_LENGTH][MAX_REFERENCE_LENGTH],
25 tbr_t (&traceback_out)[MAX_REFERENCE_LENGTH + MAX_QUERY_LENGTH],
26 const int max_row,
const int max_col);
35 tbp_t (&tbmat)[PE_NUM][TBMEM_SIZE],
37 idx_t (&ck_start_col)[MAX_QUERY_LENGTH / PE_NUM],
38 idx_t (&ck_end_col)[MAX_QUERY_LENGTH / PE_NUM],
39 int ck_idx,
int pe_idx,
int col_idx,
int v_row,
int v_col);
41 template <
int VIRTUAL_CHUNK_WIDTH>
44 int &chunk,
int &pe,
int &col,
int &v_row,
int &v_col)
47 int nav_int = nav.to_int();
52 if (v_row <= 0 || v_col <= 0)
66 col -= VIRTUAL_CHUNK_WIDTH;
86 col -= VIRTUAL_CHUNK_WIDTH;
111 template <
int CHUNK_WIDTH>
113 tbp_t (&tbmat)[PE_NUM][TBMEM_SIZE],
115 int ck_idx,
int pe_idx,
int col_idx,
int v_row,
int v_col)
129 while (navigation !=
AL_END)
131 #pragma HLS PIPELINE II = 1
133 tbp_t tbptr = tbmat[pe][col];
138 traceback_out[w_id++] = navigation;
139 Traceback::NextAddressFixedSize<CHUNK_WIDTH>(navigation, chunk, pe, col, v_row, v_col);
141 traceback_out[w_id] =
AL_END;
180 idx_t (&ck_start_idx)[
CK_NUM],
181 idx_t (&ck_end_idx)[CK_NUM],
182 int &chunk,
int &pe,
int &col,
int &v_row,
int &v_col);
void TracebackOptimized(tbp_t(&tbmat)[PE_NUM][TBMEM_SIZE], traceback_buf_t(&traceback_out), idx_t(&ck_start_col)[MAX_QUERY_LENGTH/PE_NUM], idx_t(&ck_end_col)[MAX_QUERY_LENGTH/PE_NUM], int ck_idx, int pe_idx, int col_idx, int v_row, int v_col)
Traceback function. It extract the traceback path from a matrix of traceback pointers.
#define CK_NUM
Defines the number of chunks (CK) based on the maximum query length and the number of processing elem...
Definition: dp_hls_common.h:58
#define AL_INS
Definition: dp_hls_common.h:96
void NextAddress(tbr_t &nagivation, idx_t(&ck_start_idx)[CK_NUM], idx_t(&ck_end_idx)[CK_NUM], int &chunk, int &pe, int &col, int &v_row, int &v_col)
void state_initial(tbp_t tbp, TB_STATE &state)
Function used to set the initial state of the traceback, according to the ruls of the traceback point...
#define AL_DEL
Definition: dp_hls_common.h:98
#define AL_NULL
Definition: dp_hls_common.h:99
Declaration of types used by DP-HLS internally, referred from the user defined params.h file.
void TracebackFixedSize(tbp_t(&tbmat)[PE_NUM][TBMEM_SIZE], traceback_buf_t(&traceback_out), int ck_idx, int pe_idx, int col_idx, int v_row, int v_col)
Definition: traceback.h:112
tbr_t state_to_path(TB_STATE state)
tbp_t extract_direction(tbp_t tbp)
Private helper function that extract the direction bit of the traceback pointer.
void pointer_to_coordinate(tbp_t tbp, TB_STATE &state, int &row, int &column)
A traceback pointer to coordinate mapping function. The traceback function is implemeted as a state m...
void StateMapping(tbp_t tbp, TB_STATE &state, tbr_t &navigation)
Map the current step's state and the traceback pointer to the next state and one of the Insertion...
#define AL_MMI
Definition: dp_hls_common.h:97
tbr_t traceback_buf_t[MAX_QUERY_LENGTH+MAX_REFERENCE_LENGTH]
Definition: dp_hls_common.h:101
void NextAddressFixedSize(tbr_t &nav, int &chunk, int &pe, int &col, int &v_row, int &v_col)
Definition: traceback.h:42
void StateInit(tbp_t tbp, TB_STATE &state)
Initialize the initial traceback state based on the initial traceback pointer.
#define AL_END
Definition: dp_hls_common.h:95
ap_uint< 3 > tbr_t
Definition: dp_hls_common.h:94
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.