openfpga/src/fpga_sdc/analysis_sdc_grid_writer.cpp
/********************************************************************
 * Disable the timing for a fully unused grid!
 * This is very straightforward!
 * Just walk through each pb_type and disable all the ports using wildcards
 *******************************************************************/
Disable the timing for a fully unused grid.
This is very straightforward.
Just walk through each pb_type and disable all the ports using wildcards
Disable the timing for a fully unused grid . This is very straightforward . Just walk through each pb_type and disable all the ports using wildcards
static 
void print_analysis_sdc_disable_unused_grid(std::fstream& fp, 
                                            const vtr::Point<size_t>& grid_coordinate,
                                            const DeviceGrid& grids, 
                                            const VprDeviceAnnotation& device_annotation,
                                            const VprClusteringAnnotation& cluster_annotation,
                                            const VprPlacementAnnotation& place_annotation,
                                            const ModuleManager& module_manager,
                                            const e_side& border_side) {
  valid_file_stream(fp);
  t_physical_tile_type_ptr grid_type = grids[grid_coordinate.x()][grid_coordinate.y()].type;
  if ( (true == is_empty_type(grid_type))
    || (0 < grids[grid_coordinate.x()][grid_coordinate.y()].width_offset)
    || (0 < grids[grid_coordinate.x()][grid_coordinate.y()].height_offset) ) {
    return;
  }
  std::string grid_module_name_prefix(GRID_MODULE_NAME_PREFIX);
  std::string grid_module_name = generate_grid_block_module_name(grid_module_name_prefix, std::string(grid_type->name), is_io_type(grid_type), border_side);
  std::string grid_instance_name = generate_grid_block_instance_name(grid_module_name_prefix, std::string(grid_type->name), is_io_type(grid_type), border_side, grid_coordinate);
  ModuleId grid_module = module_manager.find_module(grid_module_name);
  VTR_ASSERT(true == module_manager.valid_module_id(grid_module));
  fp << "#######################################" << std::endl; 
  fp << "# Disable Timing for grid[" << grid_coordinate.x() << "][" << grid_coordinate.y() << "]" << std::endl;
  fp << "#######################################" << std::endl; 
  size_t grid_z = 0;
  for (const ClusterBlockId& blk_id : place_annotation.grid_blocks(grid_coordinate)) {
    if (ClusterBlockId::INVALID() != blk_id) { 
      const PhysicalPb& physical_pb = cluster_annotation.physical_pb(blk_id);
      print_analysis_sdc_disable_pb_block_unused_resources(fp, grid_type, grid_coordinate,
                                                           device_annotation,
                                                           module_manager, grid_instance_name, grid_z,
                                                           physical_pb, false);
    } else {
      VTR_ASSERT(ClusterBlockId::INVALID() == blk_id);
      print_analysis_sdc_disable_pb_block_unused_resources(fp, grid_type, grid_coordinate,
                                                           device_annotation, 
                                                           module_manager, grid_instance_name, grid_z,
                                                           PhysicalPb(), true);
    }
    grid_z++;
  }
}
static void print_analysis_sdc_disable_unused_grid ( std :: fstream & fp , const vtr :: Point < size_t > & grid_coordinate , const DeviceGrid & grids , const VprDeviceAnnotation & device_annotation , const VprClusteringAnnotation & cluster_annotation , const VprPlacementAnnotation & place_annotation , const ModuleManager & module_manager , const e_side & border_side ) { valid_file_stream ( fp ) ; t_physical_tile_type_ptr grid_type = grids [ grid_coordinate . x ( ) ] [ grid_coordinate . y ( ) ] . type ; if ( ( true == is_empty_type ( grid_type ) ) || ( 0 < grids [ grid_coordinate . x ( ) ] [ grid_coordinate . y ( ) ] . width_offset ) || ( 0 < grids [ grid_coordinate . x ( ) ] [ grid_coordinate . y ( ) ] . height_offset ) ) { return ; } std :: string grid_module_name_prefix ( GRID_MODULE_NAME_PREFIX ) ; std :: string grid_module_name = generate_grid_block_module_name ( grid_module_name_prefix , std :: string ( grid_type -> name ) , is_io_type ( grid_type ) , border_side ) ; std :: string grid_instance_name = generate_grid_block_instance_name ( grid_module_name_prefix , std :: string ( grid_type -> name ) , is_io_type ( grid_type ) , border_side , grid_coordinate ) ; ModuleId grid_module = module_manager . find_module ( grid_module_name ) ; VTR_ASSERT ( true == module_manager . valid_module_id ( grid_module ) ) ; fp << " " << std :: endl ; fp << " " << grid_coordinate . x ( ) << " " << grid_coordinate . y ( ) << " " << std :: endl ; fp << " " << std :: endl ; size_t grid_z = 0 ; for ( const ClusterBlockId & blk_id : place_annotation . grid_blocks ( grid_coordinate ) ) { if ( ClusterBlockId :: INVALID ( ) != blk_id ) { const PhysicalPb & physical_pb = cluster_annotation . physical_pb ( blk_id ) ; print_analysis_sdc_disable_pb_block_unused_resources ( fp , grid_type , grid_coordinate , device_annotation , module_manager , grid_instance_name , grid_z , physical_pb , false ) ; } else { VTR_ASSERT ( ClusterBlockId :: INVALID ( ) == blk_id ) ; print_analysis_sdc_disable_pb_block_unused_resources ( fp , grid_type , grid_coordinate , device_annotation , module_manager , grid_instance_name , grid_z , PhysicalPb ( ) , true ) ; } grid_z ++ ; } }
Disable the timing for a fully unused grid!
Disable the timing for a fully unused grid!
/* Validate file stream */ /* Bypass conditions for grids : 
   * 1. EMPTY type, which is by nature unused
   * 2. Offset > 0, which has already been processed when offset = 0
   */ /* Find an unique name to the grid instane
   * Note: this must be consistent with the instance name we used in build_top_module()!!!
   */ /* TODO: validate that the instance name is used in module manager!!! */ /* Print comments */ /* For used grid, find the unused rr_node in the local rr_graph 
   * and then disable each port which is not used
   * as well as the unused inputs of routing multiplexers!
   */ /* For unused grid, disable all the pins in the physical_pb_type */