openfpga/src/annotation/check_pb_type_annotation.cpp
/********************************************************************
 * This function will recursively traverse pb_type graph to ensure
 * 1. there is only a physical mode under each pb_type
 * 2. physical mode appears only when its parent is a physical mode.
 *******************************************************************/
This function will recursively traverse pb_type graph to ensure
1. there is only a physical mode under each pb_type
2. physical mode appears only when its parent is a physical mode.
This function will recursively traverse pb_type graph to ensure 1 . there is only a physical mode under each pb_type 2 . physical mode appears only when its parent is a physical mode .
static 
void rec_check_vpr_physical_pb_type_annotation(t_pb_type* cur_pb_type,
                                               const VprDeviceAnnotation& vpr_device_annotation,
                                               size_t& num_err) {
  if (true == is_primitive_pb_type(cur_pb_type)) {
    check_vpr_physical_primitive_pb_type_annotation(cur_pb_type, vpr_device_annotation, num_err);
    return;
  }
  for (int imode = 0; imode < cur_pb_type->num_modes; ++imode) {
    for (int ichild = 0; ichild < cur_pb_type->modes[imode].num_pb_type_children; ++ichild) { 
      rec_check_vpr_physical_pb_type_annotation(&(cur_pb_type->modes[imode].pb_type_children[ichild]),
                                                vpr_device_annotation,
                                                num_err);
    }
  }
}
static void rec_check_vpr_physical_pb_type_annotation ( t_pb_type * cur_pb_type , const VprDeviceAnnotation & vpr_device_annotation , size_t & num_err ) { if ( true == is_primitive_pb_type ( cur_pb_type ) ) { check_vpr_physical_primitive_pb_type_annotation ( cur_pb_type , vpr_device_annotation , num_err ) ; return ; } for ( int imode = 0 ; imode < cur_pb_type -> num_modes ; ++ imode ) { for ( int ichild = 0 ; ichild < cur_pb_type -> modes [ imode ] . num_pb_type_children ; ++ ichild ) { rec_check_vpr_physical_pb_type_annotation ( & ( cur_pb_type -> modes [ imode ] . pb_type_children [ ichild ] ) , vpr_device_annotation , num_err ) ; } } }
This function will recursively traverse pb_type graph to ensure
 1. there is only a physical mode under each pb_type
 2. physical mode appears only when its parent is a physical mode.
This function will recursively traverse pb_type graph to ensure 1 . there is only a physical mode under each pb_type 2 . physical mode appears only when its parent is a physical mode .
/* Primitive pb_type should always been binded to a physical pb_type */ /* Traverse all the modes */