vpr/src/base/SetupGrid.cpp
//Create the device grid based on resource requirements
Create the device grid based on resource requirements
Create the device grid based on resource requirements
DeviceGrid create_device_grid(std::string layout_name, const std::vector<t_grid_def>& grid_layouts, const std::map<t_logical_block_type_ptr, size_t>& minimum_instance_counts, float target_device_utilization) {
    if (layout_name == "auto") {
        Note that we treat the target device utilization as a maximum
        return auto_size_device_grid(grid_layouts, minimum_instance_counts, target_device_utilization);
    } else {
        Use the specified device
        Find the matching grid definition
        auto cmp = [&](const t_grid_def& grid_def) {
            return grid_def.name == layout_name;
        };
        auto iter = std::find_if(grid_layouts.begin(), grid_layouts.end(), cmp);
        if (iter == grid_layouts.end()) {
            Not found
            std::string valid_names;
            for (size_t i = 0; i < grid_layouts.size(); ++i) {
                if (i != 0) {
                    valid_names += ", ";
                }
                valid_names += "'" + grid_layouts[i].name + "'";
            }
            VPR_FATAL_ERROR(VPR_ERROR_ARCH, "Failed to find grid layout named '%s' (valid grid layouts: %s)\n", layout_name.c_str(), valid_names.c_str());
        }
        return build_device_grid(*iter, iter->width, iter->height);
    }
}
DeviceGrid create_device_grid ( std :: string layout_name , const std :: vector < t_grid_def > & grid_layouts , const std :: map < t_logical_block_type_ptr , size_t > & minimum_instance_counts , float target_device_utilization ) { if ( layout_name == " " ) { return auto_size_device_grid ( grid_layouts , minimum_instance_counts , target_device_utilization ) ; } else { auto cmp = [ & ] ( const t_grid_def & grid_def ) { return grid_def . name == layout_name ; } ; auto iter = std :: find_if ( grid_layouts . begin ( ) , grid_layouts . end ( ) , cmp ) ; if ( iter == grid_layouts . end ( ) ) { std :: string valid_names ; for ( size_t i = 0 ; i < grid_layouts . size ( ) ; ++ i ) { if ( i != 0 ) { valid_names += " " ; } valid_names += " " + grid_layouts [ i ] . name + " " ; } VPR_FATAL_ERROR ( VPR_ERROR_ARCH , " \n " , layout_name . c_str ( ) , valid_names . c_str ( ) ) ; } return build_device_grid ( * iter , iter -> width , iter -> height ) ; } }
Create the device grid based on resource requirements
Create the device grid based on resource requirements
//Auto-size the device // //Note that we treat the target device utilization as a maximum //Use the specified device //Find the matching grid definition //Not found