openfpga/src/base/openfpga_lut_truth_table_fixup.cpp
/********************************************************************
 * This function recursively visits the pb graph until we reach a 
 * LUT pb_type (primitive node in the pb_graph with a class type 
 * of LUT_CLASS
 * Once we find a LUT node, we will apply the fix-up
 *******************************************************************/
This function recursively visits the pb graph until we reach a
LUT pb_type (primitive node in the pb_graph with a class type
of LUT_CLASS
Once we find a LUT node, we will apply the fix-up
This function recursively visits the pb graph until we reach a LUT pb_type ( primitive node in the pb_graph with a class type of LUT_CLASS Once we find a LUT node we will apply the fix - up
static 
void rec_adapt_lut_pb_tt(const AtomContext& atom_ctx,
                         t_pb* pb,
                         const t_pb_routes& pb_route,
                         VprClusteringAnnotation& vpr_clustering_annotation,
                         const bool& verbose) {
  t_pb_graph_node* pb_graph_node = pb->pb_graph_node; 
  if (true == is_primitive_pb_type(pb_graph_node->pb_type)) {
    if (LUT_CLASS == pb_graph_node->pb_type->class_type) {
      if (1 == pb->mode) {
        fix_up_lut_atom_block_truth_table(atom_ctx, pb->child_pbs[0], pb_route, vpr_clustering_annotation, verbose);
      }
    }
    return;
  }
  t_mode* mapped_mode = &(pb_graph_node->pb_type->modes[pb->mode]);
  for (int ipb = 0; ipb < mapped_mode->num_pb_type_children; ++ipb) {
    for (int jpb = 0; jpb < mapped_mode->pb_type_children[ipb].num_pb; ++jpb) {
      if ((pb->child_pbs[ipb] != nullptr) && (pb->child_pbs[ipb][jpb].name != nullptr)) {
        rec_adapt_lut_pb_tt(atom_ctx, &(pb->child_pbs[ipb][jpb]), pb_route, vpr_clustering_annotation, verbose);
      }
    }
  }
}
static void rec_adapt_lut_pb_tt ( const AtomContext & atom_ctx , t_pb * pb , const t_pb_routes & pb_route , VprClusteringAnnotation & vpr_clustering_annotation , const bool & verbose ) { t_pb_graph_node * pb_graph_node = pb -> pb_graph_node ; if ( true == is_primitive_pb_type ( pb_graph_node -> pb_type ) ) { if ( LUT_CLASS == pb_graph_node -> pb_type -> class_type ) { if ( 1 == pb -> mode ) { fix_up_lut_atom_block_truth_table ( atom_ctx , pb -> child_pbs [ 0 ] , pb_route , vpr_clustering_annotation , verbose ) ; } } return ; } t_mode * mapped_mode = & ( pb_graph_node -> pb_type -> modes [ pb -> mode ] ) ; for ( int ipb = 0 ; ipb < mapped_mode -> num_pb_type_children ; ++ ipb ) { for ( int jpb = 0 ; jpb < mapped_mode -> pb_type_children [ ipb ] . num_pb ; ++ jpb ) { if ( ( pb -> child_pbs [ ipb ] != nullptr ) && ( pb -> child_pbs [ ipb ] [ jpb ] . name != nullptr ) ) { rec_adapt_lut_pb_tt ( atom_ctx , & ( pb -> child_pbs [ ipb ] [ jpb ] ) , pb_route , vpr_clustering_annotation , verbose ) ; } } } }
This function recursively visits the pb graph until we reach a
 LUT pb_type (primitive node in the pb_graph with a class type
 of LUT_CLASS
 Once we find a LUT node, we will apply the fix-up
This function recursively visits the pb graph until we reach a LUT pb_type ( primitive node in the pb_graph with a class type of LUT_CLASS Once we find a LUT node we will apply the fix - up
/* If we reach a primitive pb_graph node, we return */ /* Do fix-up here.
       * Note that LUTs have two modes, 
       * For wire modes, we should skip the truth table adaption
       * mode 0 is reserved for wire, see read_xml_arch_file.cpp
       * mode 1 is the regular mode
       */ /* Recursively visit all the used pbs in the graph */ /* Each child may exist multiple times in the hierarchy*/ /* See if we still have any pb children to walk through */