Verilog to Routing - VPR
Functions
SetupGrid.cpp File Reference

Initializes and allocates the physical logic block grid for VPR. More...

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <regex>
#include <limits>
#include "vtr_assert.h"
#include "vtr_math.h"
#include "vtr_log.h"
#include "vpr_types.h"
#include "vpr_error.h"
#include "vpr_utils.h"
#include "globals.h"
#include "SetupGrid.h"
#include "expr_eval.h"
Include dependency graph for SetupGrid.cpp:

Functions

static DeviceGrid auto_size_device_grid (const std::vector< t_grid_def > &grid_layouts, const std::map< t_logical_block_type_ptr, size_t > &minimum_instance_counts, float maximum_device_utilization)
 Create a device grid which satisfies the minimum block counts. More...
 
static std::vector< t_logical_block_type_ptr > grid_overused_resources (const DeviceGrid &grid, std::map< t_logical_block_type_ptr, size_t > instance_counts)
 Estimates what logical block types will be unimplementable due to resource limits in the available grid. More...
 
static bool grid_satisfies_instance_counts (const DeviceGrid &grid, std::map< t_logical_block_type_ptr, size_t > instance_counts, float maximum_utilization)
 
static DeviceGrid build_device_grid (const t_grid_def &grid_def, size_t grid_width, size_t grid_height, bool warn_out_of_range, const std::vector< t_logical_block_type_ptr > limiting_resources)
 Build the specified device grid. More...
 
static void CheckGrid (const DeviceGrid &grid)
 Check grid is valid. More...
 
static void set_grid_block_type (int priority, const t_physical_tile_type *type, size_t x_root, size_t y_root, vtr::Matrix< t_grid_tile > &grid, vtr::Matrix< int > &grid_priorities, const t_metadata_dict *meta)
 
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)
 Create the device grid based on resource requirements. More...
 
DeviceGrid create_device_grid (std::string layout_name, const std::vector< t_grid_def > &grid_layouts, size_t width, size_t height)
 Create the device grid based on dimensions. More...
 
float calculate_device_utilization (const DeviceGrid &grid, std::map< t_logical_block_type_ptr, size_t > instance_counts)
 Calculate the device utilization. More...
 
size_t count_grid_tiles (const DeviceGrid &grid)
 Returns the effective size of the device (size of the bounding box of non-empty grid tiles) More...
 

Detailed Description

Initializes and allocates the physical logic block grid for VPR.

Author
Jason Luu
Date
October 8, 2008

Function Documentation

◆ auto_size_device_grid()

static DeviceGrid auto_size_device_grid ( const std::vector< t_grid_def > &  grid_layouts,
const std::map< t_logical_block_type_ptr, size_t > &  minimum_instance_counts,
float  maximum_device_utilization 
)
static

Create a device grid which satisfies the minimum block counts.

If a set of fixed grid layouts are specified, the smallest satisfying grid is picked If an auto grid layouts are specified, the smallest dynamicly sized grid is picked

◆ build_device_grid()

static DeviceGrid build_device_grid ( const t_grid_def &  grid_def,
size_t  width,
size_t  height,
bool  warn_out_of_range = true,
std::vector< t_logical_block_type_ptr >  limiting_resources = std::vector<t_logical_block_type_ptr>() 
)
static

Build the specified device grid.

◆ calculate_device_utilization()

float calculate_device_utilization ( const DeviceGrid grid,
std::map< t_logical_block_type_ptr, size_t >  instance_counts 
)

Calculate the device utilization.

Calculate the device utilization (i.e. fraction of used grid tiles) foor the specified grid and resource requirements

◆ CheckGrid()

static void CheckGrid ( const DeviceGrid grid)
static

Check grid is valid.

◆ count_grid_tiles()

size_t count_grid_tiles ( const DeviceGrid grid)

Returns the effective size of the device (size of the bounding box of non-empty grid tiles)

◆ create_device_grid() [1/2]

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 
)

Create the device grid based on resource requirements.

Find the device satisfying the specified minimum resources.

◆ create_device_grid() [2/2]

DeviceGrid create_device_grid ( std::string  layout_name,
const std::vector< t_grid_def > &  grid_layouts,
size_t  width,
size_t  height 
)

Create the device grid based on dimensions.

Find the device close in size to the specified dimensions.

◆ grid_overused_resources()

static std::vector< t_logical_block_type_ptr > grid_overused_resources ( const DeviceGrid grid,
std::map< t_logical_block_type_ptr, size_t >  instance_counts 
)
static

Estimates what logical block types will be unimplementable due to resource limits in the available grid.

Performs a fast counting based estimate, allocating the least flexible block types (those with the fewestequivalent tiles) first.

◆ grid_satisfies_instance_counts()

static bool grid_satisfies_instance_counts ( const DeviceGrid grid,
std::map< t_logical_block_type_ptr, size_t >  instance_counts,
float  maximum_utilization 
)
static

◆ set_grid_block_type()

static void set_grid_block_type ( int  priority,
const t_physical_tile_type *  type,
size_t  x_root,
size_t  y_root,
vtr::Matrix< t_grid_tile > &  grid,
vtr::Matrix< int > &  grid_priorities,
const t_metadata_dict *  meta 
)
static