Contexts¶
Classes¶
-
class VprContext : public Context¶
This object encapsulates VPR’s state.
There is typically a single instance which is accessed via the global variable g_vpr_ctx (see globals.h/.cpp).
It is divided up into separate sub-contexts of logically related data structures.
Each sub-context can be accessed via member functions which return a reference to the sub-context:
The default the member function (e.g. device()) return an const (immutable) reference providing read-only access to the context. This should be the preferred form, as the compiler will detect unintentional state changes.
The ‘mutable’ member function (e.g. mutable_device()) will return a non-const (mutable) reference allowing modification of the context. This should only be used on an as-needed basis.
Typical usage in VPR would be to call the appropriate accessor to get a reference to the context of interest, and then operate on it.
For example if we were performing an action which required access to the current placement, we would do:
void my_analysis_algorithm() { //Get read-only access to the placement auto& place_ctx = g_vpr_ctx.placement(); //Do something that depends on (but does not change) //the current placement... }
If we needed to modify the placement (e.g. we were implementing another placement algorithm) we would do:
void my_placement_algorithm() { //Get read-write access to the placement auto& place_ctx = g_vpr_ctx.mutable_placement(); //Do something that modifies the placement //... }
Note
The returned contexts are not copyable, so they must be taken by reference.
Structures¶
-
struct AtomContext : public Context¶
State relating to the atom-level netlist.
This should contain only data structures related to user specified netlist being implemented by VPR onto the target device.
Public Functions
-
inline AtomContext()¶
constructor
In the constructor initialize the list of pack molecules to nullptr and defines a custom deletor for it
Public Members
-
AtomNetlist nlist¶
Atom netlist.
-
inline AtomContext()¶
-
struct ClusteringContext : public Context¶
State relating to clustering.
This should contain only data structures that describe the current clustering/packing, or related clusterer/packer algorithmic state.
Public Members
-
ClusteredNetlist clb_nlist¶
New netlist class derived from Netlist.
-
ClusteredNetlist clb_nlist¶
-
struct Context¶
A Context is collection of state relating to a particular part of VPR.
This is a base class who’s only purpose is to disable copying of contexts. This ensures that attempting to use a context by value (instead of by reference) will result in a compilation error.
No data or member functions should be defined in this class!
Subclassed by AtomContext, ClusteringContext, ClusteringHelperContext, DeviceContext, FloorplanningContext, NocContext, PackingMultithreadingContext, PlacementContext, PlacerContext, PlacerMoveContext, PlacerRuntimeContext, PlacerTimingContext, PowerContext, RoutingContext, TimingContext, VprContext
-
struct DeviceContext : public Context¶
State relating the device.
This should contain only data structures describing the targeted device.
Public Members
-
DeviceGrid grid¶
The device grid.
This represents the physical layout of the device. To get the physical tile at each location (layer_num, x, y) the helper functions in this data structure should be used.
-
bool has_multiple_equivalent_tiles¶
Boolean that indicates whether the architecture implements an N:M physical tiles to logical blocks mapping.
-
t_chan_width chan_width¶
chan_width is for x|y-directed channels; i.e. between rows
-
std::unordered_map<int, int> rr_node_to_non_config_node_set¶
Reverse look-up from RR node to non-configurably connected node set (index into rr_nonconf_node_sets)
-
int virtual_clock_network_root_idx¶
rr_node idx that connects to the input of all clock network wires
Useful for two stage clock routing XXX: currently only one place to source the clock networks so only storing a single value
-
std::vector<std::map<int, int>> switch_fanin_remap¶
switch_fanin_remap is only used for printing out switch fanin stats (the -switch_stats option)
array index: [0..(num_arch_switches-1)]; map key: num of all possible fanin of that type of switch on chip map value: remapped switch index (index in rr_switch_inf)
-
DeviceGrid grid¶
-
struct PlacementContext : public Context¶
State relating to placement.
This should contain only data structures that describe the current placement, or related placer algorithm state.
Public Members
-
vtr::vector_map<ClusterBlockId, t_block_loc> block_locs¶
Clustered block placement locations.
-
vtr::vector_map<ClusterPinId, int> physical_pins¶
Clustered pin placement mapping with physical pin.
-
vtr::Matrix<t_grid_blocks> grid_blocks¶
Clustered block associated with each grid location (i.e. inverse of block_locs)
-
std::vector<t_pl_macro> pl_macros¶
The pl_macros array stores all the placement macros (usually carry chains).
-
t_compressed_block_grids compressed_block_grids¶
Compressed grid space for each block type.
Used to efficiently find logically ‘adjacent’ blocks of the same block type even though the may be physically far apart
-
std::string placement_id¶
SHA256 digest of the .place file.
Used for unique identification and consistency checking
-
std::unordered_map<int, int> phys_blk_type_to_agent_blk_type_map¶
Map physical block type to RL-agent block type.
RL-agent block types are the physical block types that are used in the netlist (at least one logical block in the netlist maps to). As an example: Having physical block types (EMPTY, LAB, DSP, IO), agent block types would be (LAB,IO) if netlist doesn’t contain DSP blocks. Key : physical (agent) block type index Value : agent (physical) block type index
-
vtr::vector_map<ClusterBlockId, t_block_loc> block_locs¶
-
struct PowerContext : public Context¶
State relating to power analysis.
This should contain only data structures related to power analysis, or related power analysis algorithmic state.
-
struct RoutingContext : public Context¶
State relating to routing.
This should contain only data structures that describe the current routing implementation, or related router algorithmic state.
Public Members
-
vtr::dynamic_bitset non_configurable_bitset¶
Information about whether a node is part of a non-configurable set.
(i.e. connected to others with non-configurable edges like metal shorts that can’t be disabled) Stored in a single bit per rr_node for efficiency bit value 0: node is not part of a non-configurable set bit value 1: node is part of a non-configurable set Initialized once when RoutingContext is initialized, static throughout invocation of router
-
t_net_routing_status net_status¶
Information about current routing status of each net.
-
vtr::dynamic_bitset non_configurable_bitset¶