openfpga/src/utils/pb_type_utils.cpp
/*********************************************************************
 * Generate the full hierarchy for a pb_type
 * The final name will be in the following format:
 * <top_pb_type_name>[<mode_name>].<parent_pb_type_name> ... <current_pb_type_name>
 *
 * TODO: This function should be part of the VPR libarchfpga parser
 **********************************************************************/
Generate the full hierarchy for a pb_type
The final name will be in the following format:
[]. ...

This function should be part of the VPR libarchfpga parser
Generate the full hierarchy for a pb_type The final name will be in the following format : [] . ... This function should be part of the VPR libarchfpga parser
std::string generate_pb_type_hierarchy_path(t_pb_type* cur_pb_type) {
  std::string hie_name(cur_pb_type->name);
  t_pb_type* parent_pb_type = cur_pb_type;
  while (1) {
    t_mode* parent_mode = parent_pb_type->parent_mode;
    if (NULL == parent_mode) {
      break;
    }
    hie_name = std::string("[") + std::string(parent_mode->name) + std::string("].") + hie_name;
    parent_pb_type = parent_mode->parent_pb_type;
    if (NULL == parent_pb_type) {
      break;
    }
    hie_name = std::string(parent_pb_type->name) + hie_name;
  }
  return hie_name;
}
std :: string generate_pb_type_hierarchy_path ( t_pb_type * cur_pb_type ) { std :: string hie_name ( cur_pb_type -> name ) ; t_pb_type * parent_pb_type = cur_pb_type ; while ( 1 ) { t_mode * parent_mode = parent_pb_type -> parent_mode ; if ( NULL == parent_mode ) { break ; } hie_name = std :: string ( " " ) + std :: string ( parent_mode -> name ) + std :: string ( " " ) + hie_name ; parent_pb_type = parent_mode -> parent_pb_type ; if ( NULL == parent_pb_type ) { break ; } hie_name = std :: string ( parent_pb_type -> name ) + hie_name ; } return hie_name ; }
Generate the full hierarchy for a pb_type
 The final name will be in the following format:
 <top_pb_type_name>[<mode_name>].<parent_pb_type_name> ... <current_pb_type_name>
Generate the full hierarchy for a pb_type The final name will be in the following format : <top_pb_type_name > [ <mode_name > ] . <parent_pb_type_name > ... <current_pb_type_name >
/* Backward trace until we meet the top-level pb_type */ /* If there is no parent mode, this is a top-level pb_type, quit the loop here */ /* Add the mode name to the full hierarchy */ /* Backtrace to the upper level */ /* If there is no parent pb_type, this is a top-level pb_type, quit the loop here */ /* Add the current pb_type name to the hierarchy name */