Verilog to Routing - VPR
Data Structures | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
vpr_types.h File Reference

This is a core file that defines the major data types used by VPR. More...

#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include "arch_types.h"
#include "atom_netlist_fwd.h"
#include "clustered_netlist_fwd.h"
#include "constant_nets.h"
#include "clock_modeling.h"
#include "heap_type.h"
#include "vtr_assert.h"
#include "vtr_ndmatrix.h"
#include "vtr_vector.h"
#include "vtr_util.h"
#include "vtr_flat_map.h"
#include "vtr_cache.h"
#include "vtr_string_view.h"
#include "vtr_dynamic_bitset.h"
#include "rr_graph_fwd.h"
Include dependency graph for vpr_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  t_ext_pin_util
 
class  t_ext_pin_util_targets
 Specifies the utilization of external input/output pins during packing. More...
 
class  t_pack_high_fanout_thresholds
 
class  edge_idx_iterator
 An iterator that dereferences to an edge index. More...
 
class  t_pb
 A t_pb represents an instance of a clustered block. More...
 
struct  t_pb_route
 Representation of intra-logic block routing. More...
 
class  t_pack_molecule
 Represents a grouping of atom blocks that match a pack_pattern, these groups are intended to be placed as a single unit during packing. More...
 
struct  t_chain_info
 Holds information to be shared between molecules that represent the same chained pack pattern. More...
 
struct  t_cluster_placement_stats
 Stats keeper for placement information during packing. More...
 
struct  t_timing_inf
 
struct  t_net_power
 Power data for t_netlist structure. More...
 
struct  t_bb
 Stores the bounding box of a net in terms of the minimum and maximum coordinates of the blocks forming the net, clipped to the region: (1..device_ctx.grid.width()-2, 1..device_ctx.grid.height()-1) More...
 
struct  t_pl_offset
 An offset between placement locations (t_pl_loc) More...
 
struct  std::hash< t_pl_offset >
 
struct  t_pl_loc
 A placement location coordinate. More...
 
struct  std::hash< t_pl_loc >
 
struct  t_place_region
 
struct  t_block_loc
 Represents the placement location of a clustered block. More...
 
struct  t_grid_blocks
 Stores the clustered blocks placed at a particular grid location. More...
 
struct  t_file_name_opts
 Names of various files. More...
 
struct  t_netlist_opts
 Options for netlist loading. More...
 
struct  t_packer_opts
 
struct  t_annealing_sched
 Annealing schedule information for the placer. More...
 
struct  t_placer_opts
 
struct  t_timing_analysis_profile_info
 
struct  t_router_opts
 
struct  t_analysis_opts
 
struct  t_det_routing_arch
 Defines the detailed routing architecture of the FPGA. More...
 
struct  t_seg_details
 Lists detailed information about segmentation. [0 .. W-1]. More...
 
class  t_chan_seg_details
 
struct  t_linked_f_pointer
 A linked list of float pointers. More...
 
struct  t_trace
 Basic element used to store the traceback (routing) of each net. More...
 
struct  t_rr_node_route_inf
 Extra information about each rr_node needed only during routing (i.e. during the maze expansion). More...
 
class  t_net_routing_status
 Information about the current status of a particular net as pertains to routing. More...
 
struct  t_node_edge
 
struct  t_non_configurable_rr_sets
 Non-configurably connected nodes and edges in the RR graph. More...
 
struct  t_power_opts
 Power estimation options. More...
 
struct  t_chan_width
 Channel width data. More...
 
struct  t_TokenPair
 Type to store our list of token to enum pairings. More...
 
struct  t_vpr_setup
 Store settings for VPR. More...
 
class  RouteStatus
 

Namespaces

 std
 

Macros

#define TOKENS   " \t\n" /* Input file parsing. */
 
#define MAX_SHORT   32767
 
#define HUGE_POSITIVE_FLOAT   1.e30
 
#define HUGE_NEGATIVE_FLOAT   -1.e30
 
#define EPSILON   1.e-15
 
#define NEGATIVE_EPSILON   -1.e-15
 
#define FIRST_ITER_WIRELENTH_LIMIT   0.85 /* If used wirelength exceeds this value in first iteration of routing, do not route */
 
#define NO_CLUSTER   -1
 
#define NEVER_CLUSTER   -2
 
#define NOT_VALID   -10000 /* Marks gains that aren't valid */
 
#define UNDEFINED   -1
 
#define NO_PREVIOUS   -1
 

Typedefs

typedef uint16_t t_edge_size
 Type used to express rr_node edge index. More...
 
typedef vtr::Range< edge_idx_iteratoredge_idx_range
 
typedef vtr::flat_map2< int, t_pb_routet_pb_routes
 
typedef vtr::NdMatrix< t_chan_seg_details, 3 > t_chan_details
 
typedef enum e_rr_type t_rr_type
 Type of a routing resource node. More...
 
typedef std::array< vtr::NdMatrix< std::vector< int >, 3 >, NUM_RR_TYPESt_rr_node_indices
 
typedef vtr::vector< ClusterBlockId, std::vector< std::vector< int > > > t_clb_opins_used
 
typedef std::vector< std::map< int, int > > t_arch_switch_fanin
 

Enumerations

enum  ScreenUpdatePriority { ScreenUpdatePriority::MINOR = 0, ScreenUpdatePriority::MAJOR = 1 }
 For update_screen. Denotes importance of update. More...
 
enum  e_router_lookahead { e_router_lookahead::CLASSIC, e_router_lookahead::MAP, e_router_lookahead::NO_OP }
 
enum  e_route_bb_update { e_route_bb_update::STATIC, e_route_bb_update::DYNAMIC }
 
enum  e_router_initial_timing { e_router_initial_timing::ALL_CRITICAL, e_router_initial_timing::LOOKAHEAD }
 
enum  e_const_gen_inference { e_const_gen_inference::NONE, e_const_gen_inference::COMB, e_const_gen_inference::COMB_SEQ }
 
enum  e_unrelated_clustering { OFF, e_unrelated_clustering::ON, e_unrelated_clustering::AUTO }
 
enum  e_balance_block_type_util { OFF, e_balance_block_type_util::ON, e_balance_block_type_util::AUTO }
 
enum  e_check_route_option { OFF, e_check_route_option::QUICK, e_check_route_option::FULL }
 
enum  e_cluster_seed {
  e_cluster_seed::TIMING, e_cluster_seed::MAX_INPUTS, e_cluster_seed::BLEND, e_cluster_seed::MAX_PINS,
  e_cluster_seed::MAX_INPUT_PINS, e_cluster_seed::BLEND2
}
 Selection algorithm for selecting next seed. More...
 
enum  e_block_pack_status { BLK_PASSED, BLK_FAILED_FEASIBLE, BLK_FAILED_ROUTE, BLK_STATUS_UNDEFINED }
 
enum  e_pack_pattern_molecule_type { MOLECULE_SINGLE_ATOM, MOLECULE_FORCED_PACK }
 Describes the molecule type. More...
 
enum  e_timing_update_type { e_timing_update_type::FULL, e_timing_update_type::INCREMENTAL, e_timing_update_type::AUTO }
 
enum  sched_type { AUTO_SCHED, USER_SCHED }
 
enum  pic_type { NO_PICTURE, PLACEMENT, ROUTING }
 
enum  pfreq { PLACE_NEVER, PLACE_ONCE, PLACE_ALWAYS }
 
enum  e_pad_loc_type { FREE, RANDOM, USER }
 Are the pads free to be moved, locked in a random configuration, or locked in user-specified positions? More...
 
enum  e_stage_action { STAGE_SKIP = 0, STAGE_LOAD, STAGE_DO, STAGE_AUTO }
 Should a stage in the CAD flow be skipped, loaded from a file, or performed. More...
 
enum  e_packer_algorithm { PACK_GREEDY, PACK_BRUTE_FORCE }
 Options for packing. More...
 
enum  e_place_algorithm { BOUNDING_BOX_PLACE, PATH_TIMING_DRIVEN_PLACE }
 
enum  e_place_effort_scaling { CIRCUIT, DEVICE_CIRCUIT }
 
enum  PlaceDelayModelType { PlaceDelayModelType::DELTA, PlaceDelayModelType::DELTA_OVERRIDE }
 
enum  e_reducer {
  e_reducer::MIN, e_reducer::MAX, e_reducer::MEDIAN, e_reducer::ARITHMEAN,
  e_reducer::GEOMEAN
}
 
enum  e_file_type { e_file_type::PDF, e_file_type::PNG, e_file_type::SVG, e_file_type::NONE }
 
enum  e_place_delta_delay_algorithm { e_place_delta_delay_algorithm::ASTAR_ROUTE, e_place_delta_delay_algorithm::DIJKSTRA_EXPANSION }
 
enum  e_route_type { GLOBAL, DETAILED }
 
enum  e_router_algorithm { BREADTH_FIRST, TIMING_DRIVEN }
 
enum  e_base_cost_type {
  DELAY_NORMALIZED, DELAY_NORMALIZED_LENGTH, DELAY_NORMALIZED_FREQUENCY, DELAY_NORMALIZED_LENGTH_FREQUENCY,
  DELAY_NORMALIZED_LENGTH_BOUNDED, DEMAND_ONLY, DEMAND_ONLY_NORMALIZED_LENGTH
}
 
enum  e_routing_failure_predictor {
  OFF, OFF, OFF, OFF,
  SAFE, AGGRESSIVE
}
 
enum  e_routing_budgets_algorithm { MINIMAX, SCALE_DELAY, DISABLE }
 
enum  e_timing_report_detail { e_timing_report_detail::NETLIST, e_timing_report_detail::AGGREGATED, e_timing_report_detail::DETAILED_ROUTING, e_timing_report_detail::DEBUG }
 
enum  e_incr_reroute_delay_ripup { e_incr_reroute_delay_ripup::ON, e_incr_reroute_delay_ripup::OFF, e_incr_reroute_delay_ripup::AUTO }
 
enum  e_direction : unsigned char {
  INC_DIRECTION = 0, DEC_DIRECTION = 1, BI_DIRECTION = 2, NO_DIRECTION = 3,
  NUM_DIRECTIONS
}
 
enum  e_rr_type : unsigned char {
  SOURCE = 0, SINK, IPIN, OPIN,
  CHANX, CHANY, NUM_RR_TYPES
}
 Type of a routing resource node. More...
 
enum  e_cost_indices {
  SOURCE_COST_INDEX = 0, SINK_COST_INDEX, OPIN_COST_INDEX, IPIN_COST_INDEX,
  CHANX_COST_INDEX_START
}
 Index of the SOURCE, SINK, OPIN, IPIN, etc. member of device_ctx.rr_indexed_data. More...
 

Functions

constexpr bool is_pin (e_rr_type type)
 
constexpr bool is_chan (e_rr_type type)
 
constexpr bool is_src_sink (e_rr_type type)
 

Variables

constexpr auto EMPTY_BLOCK_ID = ClusterBlockId(-1)
 
constexpr auto INVALID_BLOCK_ID = ClusterBlockId(-2)
 
constexpr const char * EMPTY_BLOCK_NAME = "EMPTY"
 
constexpr int NO_FIXED_CHANNEL_WIDTH = -1
 
constexpr std::array< const char *, NUM_DIRECTIONSDIRECTION_STRING = {{"INC_DIRECTION", "DEC_DIRECTION", "BI_DIRECTION", "NO_DIRECTION"}}
 
constexpr std::array< t_rr_type, NUM_RR_TYPESRR_TYPES = {{SOURCE, SINK, IPIN, OPIN, CHANX, CHANY}}
 
constexpr std::array< const char *, NUM_RR_TYPESrr_node_typename {{"SOURCE", "SINK", "IPIN", "OPIN", "CHANX", "CHANY"}}
 

Detailed Description

This is a core file that defines the major data types used by VPR.

This file is divided into generally 4 major sections:

  1. Global data types and constants
  2. Packing specific data types
  3. Placement specific data types
  4. Routing specific data types

Key background file:

An understanding of libarchfpga/physical_types.h is crucial to understanding this file. physical_types.h contains information about the architecture described in the architecture description language

Key data structures: t_rr_node - The basic building block of the interconnect in the FPGA architecture

Cluster-specific main data structure: t_pb: Stores the mapping between the user netlist and the logic blocks on the FPGA architecture. For example, if a user design has 10 clusters of 5 LUTs each, you will have 10 t_pb instances of type cluster and within each of those clusters another 5 t_pb instances of type LUT. The t_pb hierarchy follows what is described by t_pb_graph_node

Macro Definition Documentation

◆ EPSILON

#define EPSILON   1.e-15

◆ FIRST_ITER_WIRELENTH_LIMIT

#define FIRST_ITER_WIRELENTH_LIMIT   0.85 /* If used wirelength exceeds this value in first iteration of routing, do not route */

◆ HUGE_NEGATIVE_FLOAT

#define HUGE_NEGATIVE_FLOAT   -1.e30

◆ HUGE_POSITIVE_FLOAT

#define HUGE_POSITIVE_FLOAT   1.e30

◆ MAX_SHORT

#define MAX_SHORT   32767

◆ NEGATIVE_EPSILON

#define NEGATIVE_EPSILON   -1.e-15

◆ NEVER_CLUSTER

#define NEVER_CLUSTER   -2

◆ NO_CLUSTER

#define NO_CLUSTER   -1

◆ NO_PREVIOUS

#define NO_PREVIOUS   -1

◆ NOT_VALID

#define NOT_VALID   -10000 /* Marks gains that aren't valid */

◆ TOKENS

#define TOKENS   " \t\n" /* Input file parsing. */

◆ UNDEFINED

#define UNDEFINED   -1

Typedef Documentation

◆ edge_idx_range

typedef vtr::Range<edge_idx_iterator> edge_idx_range

◆ t_arch_switch_fanin

typedef std::vector<std::map<int, int> > t_arch_switch_fanin

◆ t_chan_details

typedef vtr::NdMatrix<t_chan_seg_details, 3> t_chan_details

◆ t_clb_opins_used

typedef vtr::vector<ClusterBlockId, std::vector<std::vector<int> > > t_clb_opins_used

◆ t_edge_size

typedef uint16_t t_edge_size

Type used to express rr_node edge index.

◆ t_pb_routes

typedef vtr::flat_map2<int, t_pb_route> t_pb_routes

◆ t_rr_node_indices

typedef std::array<vtr::NdMatrix<std::vector<int>, 3>, NUM_RR_TYPES> t_rr_node_indices

◆ t_rr_type

typedef enum e_rr_type t_rr_type

Type of a routing resource node.

x-directed channel segment, y-directed channel segment, input pin to a clb to pad, output from a clb or pad (i.e. output pin of a net) and:

  • SOURCE
  • SINK

Enumeration Type Documentation

◆ e_balance_block_type_util

Enumerator
OFF 
ON 
AUTO 

◆ e_base_cost_type

Enumerator
DELAY_NORMALIZED 
DELAY_NORMALIZED_LENGTH 
DELAY_NORMALIZED_FREQUENCY 
DELAY_NORMALIZED_LENGTH_FREQUENCY 
DELAY_NORMALIZED_LENGTH_BOUNDED 
DEMAND_ONLY 
DEMAND_ONLY_NORMALIZED_LENGTH 

◆ e_block_pack_status

Enumerator
BLK_PASSED 
BLK_FAILED_FEASIBLE 
BLK_FAILED_ROUTE 
BLK_STATUS_UNDEFINED 

◆ e_check_route_option

enum e_check_route_option
strong
Enumerator
OFF 
QUICK 
FULL 

◆ e_cluster_seed

enum e_cluster_seed
strong

Selection algorithm for selecting next seed.

Enumerator
TIMING 
MAX_INPUTS 
BLEND 
MAX_PINS 
MAX_INPUT_PINS 
BLEND2 

◆ e_const_gen_inference

enum e_const_gen_inference
strong
Enumerator
NONE 

No constant generator inference

COMB 

Only combinational constant generator inference

COMB_SEQ 

Both combinational and sequential constant generator inference

◆ e_cost_indices

Index of the SOURCE, SINK, OPIN, IPIN, etc. member of device_ctx.rr_indexed_data.

Enumerator
SOURCE_COST_INDEX 
SINK_COST_INDEX 
OPIN_COST_INDEX 
IPIN_COST_INDEX 
CHANX_COST_INDEX_START 

◆ e_direction

enum e_direction : unsigned char
Enumerator
INC_DIRECTION 
DEC_DIRECTION 
BI_DIRECTION 
NO_DIRECTION 
NUM_DIRECTIONS 

◆ e_file_type

enum e_file_type
strong
Enumerator
PDF 
PNG 
SVG 
NONE 

◆ e_incr_reroute_delay_ripup

Enumerator
ON 
OFF 
AUTO 

◆ e_pack_pattern_molecule_type

Describes the molecule type.

Enumerator
MOLECULE_SINGLE_ATOM 

single atom forming a molecule (no pack pattern associated)

MOLECULE_FORCED_PACK 

more than one atom representing a packing pattern forming a large molecule

◆ e_packer_algorithm

Options for packing.

TODO: document each packing parameter

Enumerator
PACK_GREEDY 
PACK_BRUTE_FORCE 

◆ e_pad_loc_type

Are the pads free to be moved, locked in a random configuration, or locked in user-specified positions?

Enumerator
FREE 
RANDOM 
USER 

◆ e_place_algorithm

Enumerator
BOUNDING_BOX_PLACE 
PATH_TIMING_DRIVEN_PLACE 

◆ e_place_delta_delay_algorithm

Enumerator
ASTAR_ROUTE 
DIJKSTRA_EXPANSION 

◆ e_place_effort_scaling

Enumerator
CIRCUIT 

Effort scales based on circuit size only

DEVICE_CIRCUIT 

Effort scales based on both circuit and device size

◆ e_reducer

enum e_reducer
strong
Enumerator
MIN 
MAX 
MEDIAN 
ARITHMEAN 
GEOMEAN 

◆ e_route_bb_update

enum e_route_bb_update
strong
Enumerator
STATIC 

Router net bounding boxes are not updated

DYNAMIC 

Rotuer net bounding boxes are updated

◆ e_route_type

Enumerator
GLOBAL 
DETAILED 

◆ e_router_algorithm

Enumerator
BREADTH_FIRST 
TIMING_DRIVEN 

◆ e_router_initial_timing

Enumerator
ALL_CRITICAL 
LOOKAHEAD 

◆ e_router_lookahead

enum e_router_lookahead
strong
Enumerator
CLASSIC 

VPR's classic lookahead (assumes uniform wire types)

MAP 

Lookahead considering different wire types (see Oleg Petelin's MASc Thesis)

NO_OP 

A no-operation lookahead which always returns zero

◆ e_routing_budgets_algorithm

Enumerator
MINIMAX 
SCALE_DELAY 
DISABLE 

◆ e_routing_failure_predictor

Enumerator
OFF 
OFF 
OFF 
OFF 
SAFE 
AGGRESSIVE 

◆ e_rr_type

enum e_rr_type : unsigned char

Type of a routing resource node.

x-directed channel segment, y-directed channel segment, input pin to a clb to pad, output from a clb or pad (i.e. output pin of a net) and:

  • SOURCE
  • SINK
Enumerator
SOURCE 

A dummy node that is a logical output within a block – i.e., the gate that generates a signal.

SINK 

A dummy node that is a logical input within a block – i.e. the gate that needs a signal.

IPIN 
OPIN 
CHANX 
CHANY 
NUM_RR_TYPES 

◆ e_stage_action

Should a stage in the CAD flow be skipped, loaded from a file, or performed.

Enumerator
STAGE_SKIP 
STAGE_LOAD 
STAGE_DO 
STAGE_AUTO 

◆ e_timing_report_detail

Enumerator
NETLIST 
AGGREGATED 
DETAILED_ROUTING 
DEBUG 

◆ e_timing_update_type

enum e_timing_update_type
strong
Enumerator
FULL 
INCREMENTAL 
AUTO 

◆ e_unrelated_clustering

Enumerator
OFF 
ON 
AUTO 

◆ pfreq

enum pfreq
Enumerator
PLACE_NEVER 
PLACE_ONCE 
PLACE_ALWAYS 

◆ pic_type

enum pic_type
Enumerator
NO_PICTURE 
PLACEMENT 
ROUTING 

◆ PlaceDelayModelType

enum PlaceDelayModelType
strong
Enumerator
DELTA 

Delta x/y based delay model

DELTA_OVERRIDE 

Delta x/y based delay model with special case delay overrides

◆ sched_type

enum sched_type
Enumerator
AUTO_SCHED 
USER_SCHED 

◆ ScreenUpdatePriority

enum ScreenUpdatePriority
strong

For update_screen. Denotes importance of update.

By default MINOR only updates the screen, while MAJOR pauses graphics for the user to interact

Enumerator
MINOR 
MAJOR 

Function Documentation

◆ is_chan()

constexpr bool is_chan ( e_rr_type  type)

◆ is_pin()

constexpr bool is_pin ( e_rr_type  type)

◆ is_src_sink()

constexpr bool is_src_sink ( e_rr_type  type)

Variable Documentation

◆ DIRECTION_STRING

constexpr std::array<const char*, NUM_DIRECTIONS> DIRECTION_STRING = {{"INC_DIRECTION", "DEC_DIRECTION", "BI_DIRECTION", "NO_DIRECTION"}}

◆ EMPTY_BLOCK_ID

constexpr auto EMPTY_BLOCK_ID = ClusterBlockId(-1)

◆ EMPTY_BLOCK_NAME

constexpr const char* EMPTY_BLOCK_NAME = "EMPTY"

◆ INVALID_BLOCK_ID

constexpr auto INVALID_BLOCK_ID = ClusterBlockId(-2)

◆ NO_FIXED_CHANNEL_WIDTH

constexpr int NO_FIXED_CHANNEL_WIDTH = -1

◆ rr_node_typename

constexpr std::array<const char*, NUM_RR_TYPES> rr_node_typename {{"SOURCE", "SINK", "IPIN", "OPIN", "CHANX", "CHANY"}}

◆ RR_TYPES

constexpr std::array<t_rr_type, NUM_RR_TYPES> RR_TYPES = {{SOURCE, SINK, IPIN, OPIN, CHANX, CHANY}}