Grid

DeviceGrid

class DeviceGrid

Represents the FPGA fabric. It is used to get information about different layers and tiles.

Public Functions

inline int get_num_layers() const

Return the number of layers(number of dies)

inline size_t width() const

Return the width of the grid at the specified layer.

inline size_t height() const

Return the height of the grid at the specified layer.

inline std::tuple<size_t, size_t, size_t> dim_sizes() const

Return the grid dimensions in (# of layers, width, height) format.

inline size_t grid_size() const

Return the size of the flattened grid on the given layer.

void clear()

deallocate members of DeviceGrid

size_t num_instances(t_physical_tile_type_ptr type, int layer_num) const

Return the number of instances of the specified tile type on the specified layer. If the layer_num is -1, return the total number of instances of the specified tile type on all layers.

Note

This function should be used if count_instances() is called in the constructor.

inline std::vector<t_logical_block_type_ptr> limiting_resources() const

Returns the block types which limits the device size (may be empty if resource limits were not considered when selecting the device).

inline t_physical_tile_type_ptr get_physical_type(const t_physical_tile_loc &tile_loc) const

Return the t_physical_tile_type_ptr at the specified location.

inline int get_width_offset(const t_physical_tile_loc &tile_loc) const

Return the width offset of the tile at the specified location. The root location of the tile is where width_offset and height_offset are 0.

inline int get_height_offset(const t_physical_tile_loc &tile_loc) const

Return the height offset of the tile at the specified location. The root location of the tile is where width_offset and height_offset are 0.

inline bool is_root_location(const t_physical_tile_loc &tile_loc) const

Returns true if the given location is the root location (bottom left corner) of a tile.

inline vtr::Rect<int> get_tile_bb(const t_physical_tile_loc &tile_loc) const

Returns a rectangle which represents the bounding box of the tile at the given location.

inline const t_metadata_dict *get_metadata(const t_physical_tile_loc &tile_loc) const

Return the metadata of the tile at the specified location.

inline int get_grid_loc_x(const t_grid_tile *&grid_loc) const

Given t_grid_tile, return the x coordinate of the tile on the given layer - Used by serializer functions.

inline int get_grid_loc_y(const t_grid_tile *&grid_loc) const

Given t_grid_tile, return the y coordinate of the tile on the given layer - Used by serializer functions.

inline int get_grid_loc_layer(const t_grid_tile *&grid_loc) const

Given t_grid_tile, return the layer number of the tile - Used by serializer functions.

inline const t_grid_tile *get_grid_locs_grid_loc(int n) const

Return the nth t_grid_tile on the given layer of the flattened grid - Used by serializer functions.