openfpga/src/annotation/check_pb_type_annotation.cpp
/********************************************************************
 * This function will check the physical pb_type annotation for
 * each pb_type in the device
 * Every pb_type should have been linked to a physical pb_type
 * and every port of the pb_type have been linked a port of a physical pb_type
 *******************************************************************/
This function will check the physical pb_type annotation for
each pb_type in the device
Every pb_type should have been linked to a physical pb_type
and every port of the pb_type have been linked a port of a physical pb_type
This function will check the physical pb_type annotation for each pb_type in the device Every pb_type should have been linked to a physical pb_type and every port of the pb_type have been linked a port of a physical pb_type
void check_vpr_physical_pb_type_annotation(const DeviceContext& vpr_device_ctx, 
                                           const VprDeviceAnnotation& vpr_device_annotation) {
  size_t num_err = 0;
  for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) {
    if (nullptr == lb_type.pb_type) {
      continue;
    }
    rec_check_vpr_physical_pb_type_annotation(lb_type.pb_type, vpr_device_annotation, num_err);
  }
  if (0 == num_err) {
    VTR_LOG("Check physical pb_type annotation for pb_types passed.\n");
  } else {
    VTR_LOG_ERROR("Check physical pb_type annotation for pb_types failed with %ld errors!\n",
                  num_err);
  }
}
void check_vpr_physical_pb_type_annotation ( const DeviceContext & vpr_device_ctx , const VprDeviceAnnotation & vpr_device_annotation ) { size_t num_err = 0 ; for ( const t_logical_block_type & lb_type : vpr_device_ctx . logical_block_types ) { if ( nullptr == lb_type . pb_type ) { continue ; } rec_check_vpr_physical_pb_type_annotation ( lb_type . pb_type , vpr_device_annotation , num_err ) ; } if ( 0 == num_err ) { VTR_LOG ( " \n " ) ; } else { VTR_LOG_ERROR ( " \n " , num_err ) ; } }
This function will check the physical pb_type annotation for
 each pb_type in the device
 Every pb_type should have been linked to a physical pb_type
 and every port of the pb_type have been linked a port of a physical pb_type
This function will check the physical pb_type annotation for each pb_type in the device Every pb_type should have been linked to a physical pb_type and every port of the pb_type have been linked a port of a physical pb_type
/* By pass nullptr for pb_type head */ /* Top pb_type should always has a physical mode! */