Closed
Description
Motivation of Refactoring effort
A detailed technical plan can be found at link
The overall refactoring effort aims to
- create a unified data structure
RRGraphView
as a centralized storage for all the routing resource graph -related information. See Fig. 1 - create a set of frame view object from the centralized storage
RRGraph
for client functions, which are suitable forrr_graph builder
,placer
,router
,GUI
,timing analyzer
etc. See Fig. 2. - This is to avoid massive updates to the codes of client functions when there is a change on the unified data structure.
- Also it avoid large memory footprint for client functions, since each client function may only use a small portion (typically <50%) APIs of the unified object.
Fig. 1 Illustration of the relationship between data structures
Fig. 2 Different levels of frame views of routing resource graphs to satisfy various needs from client functions.
The result/benefits of the refactoring efforts is
- The routing resource graph can be decoupled from VPR's core engine as a library. Unit tests can be enabled
- It is much easier for developers to develop custom routing resource graph builders thanks to the APIs of the unified data structure
RRGraph
. A routing resource graph builder can be a library, decoupled from VPR's core engine. Many checking codes can be efficiently merged into the data structure and developers can save a lot of efforts in writing the atom-level sanity checks. - Ensure that each client functions have a clean view of the routing resource graph, i.e.
RRGraphView
. In other words, routing resource graph will be read-only and only accessors are exposed to client functions. Developers have no worries on developing their own placer/router etc.
Checklist
RRGraphBuilder API to be refactored:
- set_node_type() Add a new API
set_node_type()
toRRGraphBuilder
#1847 - set_node_ptc_num() Add a new API set_node_x_num() to RRGraphBuilder #1872
- set_node_pin_num() Add a new API set_node_x_num() to RRGraphBuilder #1872
- set_node_track_num() Add a new API set_node_x_num() to RRGraphBuilder #1872
- set_node_class_num() Add a new API set_node_x_num() to RRGraphBuilder #1872
- set_node_coordinates() Add a new API set_node_coordinates() to RRGraphBuilder #1853
- set_node_cost_index() Add a new API set_node_cost_index() to RRGraphBuilder #1884
- set_node_rc_index() Add a new API set_node_rc_index() to RRGraphBuilder #1887
- set_node_capacity() Add a new API set_node_capacity() to RRGraphBuilder #1855
- set_node_direction() Add a new API set_node_direction() to RRGraphBuilder #1856
- add_node_side() Add a new API add_node_side() to RRGraphBuilder #1889
- reserve_nodes() Add a new APIs reserve_nodes() and resize_nodes to RRGraphBuilder #1905
- resize_nodes() Add a new APIs reserve_nodes() and resize_nodes to RRGraphBuilder #1905
-
add_node()Removed because it is not currently used in rr_graph builder; Will think it later. - reserve_edges() Add a new APIs reserve_edges(), emplace_back_edges() and alloc_and_load_edges() to RRGraphBuilder #1892
- emplace_back_edges() Add a new APIs reserve_edges(), emplace_back_edges() and alloc_and_load_edges() to RRGraphBuilder #1892
- alloc_and_load_edges() Add a new APIs reserve_edges(), emplace_back_edges() and alloc_and_load_edges() to RRGraphBuilder #1892
- count_rr_switches() Add a new API count_rr_switches() to RRGraphBuilder #1896
- remap_rr_node_switch_indices() Add a new API remap_rr_node_switch_indices() to RRGraphBuilder #1897
- make_edges_as_rr_switch_ids() Add a new API make_edges_as_rr_switch_ids() to RRGraphBuilder #1902
- partition_edges() Add a new API partition_edges() to RRGraphBuilder #1900
- init_fan_in() Add a new API init_fan_in() to RRGraphBuilder #1903
- validate() Add a new API validate() to RRGraphBuilder #1899
RRGraphView API to be refactored:
- node_type() RRGraphView::node_type() Implementation #1742
- node_type_string() RRGraphView node_type_string(), node_side_string() Implementation #1873
- node_rc_index() RRGraphView node_R(), node_C(), node_rc_index() Implementation #1816
- node_R() RRGraphView node_R(), node_C(), node_rc_index() Implementation #1816
- node_C() RRGraphView node_R(), node_C(), node_rc_index() Implementation #1816
- node_xlow/ylow/xhigh/yhigh() RRGraphView node_xlow(), node_xhigh(), node_ylow(), node_yhigh() Implementation #1819
- node_capacity() RRGraphView::node_capacity() Implementation #1780
- node_cost_index() RRGraphView node_cost_index() Implementation #1843
- node_direction() RRGraphView::node_direction() Implementation #1791
- node_direction_string() RRGraphView::node_direction() Implementation #1791
- is_node_on_specific_side() RRGraphView is_node_on_specific_side() Implementation #1862
- node_side_string() RRGraphView node_type_string(), node_side_string() Implementation #1873
- node_ptc_num()/node_pin_num()/node_track_num()/node_class_num() RRGraphView node_ptc_num(), node_pin_num(), node_class_num(), node_track_num() Implementation #1908
- fan_in() RRGraphView::node_fan_in() Implementation #1799
- edges()/num_edges() RRGraphView edges(), num_edges(), configurable_edges(), non_configurable_edges(), num_configurable_edges(), num_non_configurable_edges() Implementation #1917
- configurable_edges()/non_configurable_edges()/num_configurable_edges()/num_non_configurable_edges() RRGraphView edges(), num_edges(), configurable_edges(), non_configurable_edges(), num_configurable_edges(), num_non_configurable_edges() Implementation #1917
- first_edge()/last_edge() RRGraphView::node_first_edge() Implementation #1916
- edge_sink_node()/edge_switch() RRGraphView edge_sink_node()/edge_switch() Implementation #1930
- nodes() RRGraphView nodes() Implementation #1932
- rr_segments() RRGraphView rr_segments() Implementation #1910
- rr_switches() RRGraphView rr_switches() Implementation #1945