#NEWLINE# def __get_tbl_core_nonreflected( self ) : #NEWLINE# #INDENT# '\n        Return the core loop of the table-driven algorithm, non-reflected variant.\n        ' #NEWLINE# if ( self . opt . algorithm != loop_core . opt . algo_table_driven ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# loop_core = '' #NEWLINE# loop_indent = '' #NEWLINE# if self . opt . undefined_crc_parameters : #NEWLINE# #INDENT# loop_indent = ( ' ' * 12 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# loop_indent = ( ' ' * 8 ) #NEWLINE# #UNINDENT# if ( self . opt . width == None ) : #NEWLINE# #INDENT# crc_shifted_right = '(crc >> ($cfg_width - $cfg_table_idx_width))' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . opt . width < 8 ) : #NEWLINE# #INDENT# shift_val = ( self . opt . width - self . opt . tbl_idx_width ) #NEWLINE# if ( shift_val < 0 ) : #NEWLINE# #INDENT# crc_shifted_right = '(crc << {0})' . format ( ( - shift_val ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# crc_shifted_right = '(crc >> {0})' . format ( shift_val ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# shift_val = ( self . opt . width - self . opt . tbl_idx_width ) #NEWLINE# if ( shift_val == 0 ) : #NEWLINE# #INDENT# crc_shifted_right = 'crc' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# crc_shifted_right = '(crc >> {0})' . format ( shift_val ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( self . opt . width != None ) and ( self . opt . tbl_idx_width != None ) and ( self . opt . width <= self . opt . tbl_idx_width ) ) : #NEWLINE# #INDENT# crc_xor_expr = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# crc_xor_expr = ' ^ (crc << $cfg_table_idx_width)' #NEWLINE# #UNINDENT# if ( self . opt . tbl_idx_width == 8 ) : #NEWLINE# #INDENT# if ( self . opt . slice_by > 1 ) : #NEWLINE# #INDENT# crc_lookup = 'crc_table[0][tbl_idx]' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# crc_lookup = 'crc_table[tbl_idx]' #NEWLINE# #UNINDENT# loop_core += ( ( ( ( ( ( ( ( ( ( ( loop_indent + 'tbl_idx = (' ) + crc_shifted_right ) + ' ^ *d)$if ($crc_width > 8) {: & $crc_table_mask:};' ) + '\n' ) + loop_indent ) + 'crc = (' ) + crc_lookup ) + crc_xor_expr ) + ') & ' ) + '$cfg_mask;' ) + '\n' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# crc_lookup = 'crc_table[tbl_idx & $crc_table_mask]' #NEWLINE# for i in range ( ( 8 // self . opt . tbl_idx_width ) ) : #NEWLINE# #INDENT# str_idx = '{0:d}' . format ( ( 8 - ( ( i + 1 ) * self . opt . tbl_idx_width ) ) ) #NEWLINE# loop_core += ( ( ( ( ( ( ( ( ( ( ( ( loop_indent + 'tbl_idx = ' ) + crc_shifted_right ) + ' ^ (*d >> ' ) + str_idx ) + ');' ) + '\n' ) + loop_indent ) + 'crc = ' ) + crc_lookup ) + crc_xor_expr ) + ';' ) + '\n' ) #NEWLINE# #UNINDENT# #UNINDENT# return loop_core