openfpga/src/annotation/check_pb_type_annotation.cpp
/********************************************************************
 * This function will check 
 * - if a primitive pb_type has been mapped to a physical pb_type 
 * - if every port of the pb_type have been linked a port of a physical pb_type
 *******************************************************************/
This function will check
- if a primitive pb_type has been mapped to a physical pb_type
- if every port of the pb_type have been linked a port of a physical pb_type
This function will check - if a primitive pb_type has been mapped to a physical pb_type - if every port of the pb_type have been linked a port of a physical pb_type
static 
void check_vpr_physical_primitive_pb_type_annotation(t_pb_type* cur_pb_type,
                                                     const VprDeviceAnnotation& vpr_device_annotation,
                                                     size_t& num_err) {
  if (nullptr == vpr_device_annotation.physical_pb_type(cur_pb_type)) {
    VTR_LOG_ERROR("Find a pb_type '%s' which has not been mapped to any physical pb_type!\n",
                  cur_pb_type->name);
    VTR_LOG_ERROR("Please specify in the OpenFPGA architecture\n");
    num_err++;  
    return;
  }
  for (t_port* pb_port : pb_type_ports(cur_pb_type)) {
    if (0 == vpr_device_annotation.physical_pb_port(pb_port).size()) {
      VTR_LOG_ERROR("Find a port '%s' of pb_type '%s' which has not been mapped to any physical port!\n",
                    pb_port->name, cur_pb_type->name);
      VTR_LOG_ERROR("Please specify in the OpenFPGA architecture\n");
      num_err++;
    }
  }
  return;
}
static void check_vpr_physical_primitive_pb_type_annotation ( t_pb_type * cur_pb_type , const VprDeviceAnnotation & vpr_device_annotation , size_t & num_err ) { if ( nullptr == vpr_device_annotation . physical_pb_type ( cur_pb_type ) ) { VTR_LOG_ERROR ( " \n " , cur_pb_type -> name ) ; VTR_LOG_ERROR ( " \n " ) ; num_err ++ ; return ; } for ( t_port * pb_port : pb_type_ports ( cur_pb_type ) ) { if ( 0 == vpr_device_annotation . physical_pb_port ( pb_port ) . size ( ) ) { VTR_LOG_ERROR ( " \n " , pb_port -> name , cur_pb_type -> name ) ; VTR_LOG_ERROR ( " \n " ) ; num_err ++ ; } } return ; }
This function will check
 - if a primitive pb_type has been mapped to a physical pb_type
 - if every port of the pb_type have been linked a port of a physical pb_type
This function will check - if a primitive pb_type has been mapped to a physical pb_type - if every port of the pb_type have been linked a port of a physical pb_type
/* Now we need to check each port of the pb_type */