Router Lookahead

e_router_lookahead

enum class e_router_lookahead

Router lookahead types.

Values:

enumerator CLASSIC

VPR’s classic lookahead (assumes uniform wire types)

enumerator MAP

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

enumerator COMPRESSED_MAP

Similar to MAP, but use a sparse sampling of the chip.

enumerator EXTENDED_MAP

Lookahead with a more extensive node sampling method.

enumerator NO_OP

A no-operation lookahead which always returns zero.

RouterLookahead

class RouterLookahead

The base class to define router lookahead.

This class is used by different parts of VPR to get an estimation of the cost, in terms of delay and congestion, to get from one point to the other.

Subclassed by ClassicLookahead, CompressedMapLookahead, ExtendedMapLookahead, MapLookahead, NoOpLookahead

Public Functions

virtual float get_expected_cost(RRNodeId node, RRNodeId target_node, const t_conn_cost_params &params, float R_upstream) const = 0

Get expected cost from node to target_node.

Attention

Either compute or read methods must be invoked before invoking get_expected_cost.

Parameters:
  • node – The source node from which the cost to the target node is obtained.

  • target_node – The target node to which the cost is obtained.

  • params – Contain the router parameter such as connection criticality, etc. Used to calculate the cost based on the delay and congestion costs.

  • R_upstream – Upstream resistance to get to the “node”.

Returns:

virtual void compute(const std::vector<t_segment_inf> &segment_inf) = 0

Compute router lookahead (if needed)

Parameters:

segment_inf

virtual void compute_intra_tile() = 0

Initialize the data structures which store the information about intra-cluster resources.

Attention

This function is called in the routing stage.

virtual void read(const std::string &file) = 0

Read router lookahead data (if any) from specified file.

Attention

May be unimplemented, in which case method should throw an exception.

Parameters:

file – Name of the file that stores the router lookahead.

virtual void read_intra_cluster(const std::string &file) = 0

Read intra-cluster router lookahead data (if any) from specified file.

Attention

May be unimplemented, in which case method should throw an exception.

Parameters:

file – Name of the file that stores the intra-cluster router lookahead.

virtual void write(const std::string &file) const = 0

Write router lookahead data (if any) to specified file.

Attention

May be unimplemented, in which case method should throw an exception.

Parameters:

file – Name of the file to write the router lookahead.

virtual void write_intra_cluster(const std::string &file) const = 0

Write intra-cluster router lookahead data (if any) to specified file.

Attention

May be unimplemented, in which case method should throw an exception.

Parameters:

file – Name of the file to write the intra-cluster router lookahead.

virtual float get_opin_distance_min_delay(int physical_tile_idx, int from_layer, int to_layer, int dx, int dy) const = 0

Retrieve the minimum delay to a point on the “to_layer,” which is dx and dy away, across all the OPINs on the physical tile identified by “physical_tile_idx.”.

Parameters:
  • physical_tile_idx – The index of the physical tile from which the cost is calculated

  • from_layer – The layer that the tile is located on

  • to_layer – The layer on which the destination is located

  • dx – Horizontal distance to the destination

  • dy – Vertical distance to the destination

Returns:

Minimum delay to a point which is dx and dy away from a point on the die number “from_layer” to a point on the die number “to_layer”.

MapLookahead

class MapLookahead : public RouterLookahead

Current VPR RouterLookahead implementation.

make_router_lookahead

std::unique_ptr<RouterLookahead> make_router_lookahead(const t_det_routing_arch &det_routing_arch, e_router_lookahead router_lookahead_type, const std::string &write_lookahead, const std::string &read_lookahead, const std::vector<t_segment_inf> &segment_inf, bool is_flat)

Force creation of lookahead object.

Attention

This may involve recomputing the lookahead, so only use if lookahead cache cannot be used.

Parameters:
  • det_routing_arch

  • router_lookahead_type

  • write_lookahead

  • read_lookahead

  • segment_inf

  • is_flat

Returns:

Return a unique pointer that points to the router lookahead object

get_cached_router_lookahead

const RouterLookahead *get_cached_router_lookahead(const t_det_routing_arch &det_routing_arch, e_router_lookahead router_lookahead_type, const std::string &write_lookahead, const std::string &read_lookahead, const std::vector<t_segment_inf> &segment_inf, bool is_flat)

Returns lookahead for given rr graph.

Attention

Object is cached in RouterContext, but access to cached object should performed via this function.

Parameters:
  • det_routing_arch

  • router_lookahead_type

  • write_lookahead

  • read_lookahead

  • segment_inf

  • is_flat

Returns:

invalidate_router_lookahead_cache

void invalidate_router_lookahead_cache()

Clear router lookahead cache (e.g. when changing or free rrgraph).