-
Notifications
You must be signed in to change notification settings - Fork 414
Move rr_graph_reader & rr_graph_writer to librrgraph. #2101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move rr_graph_reader & rr_graph_writer to librrgraph. #2101
Conversation
…graph(), and check_rr_node().
…), write_rr_graph(), and find_create_rr_rc_data().
Notes
|
Todo list on this PR:
|
@oscarcheng105 Please fix the code format errors: https://github.com/verilog-to-routing/vtr-verilog-to-routing/runs/7440223859?check_suite_focus=true |
Memo @oscarcheng105
|
Needs a make format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oscarcheng105 Just some comments to categorize source files.
Also, to group header files, we need your information about what are the client functions of these data types/structures.
There are five major clients of RRGraph:
- Placer
- Router
- routing resource graph builder
- GUI (drawer)
- Timing analyzer
Suggest to follow this thread to group headers. We can go through them one by one, once you can provide details.
NOTES
-
The following is a list of files that references the migrated data-structures mentioned previously:
e_graph_type/t_graph_type in
graph_type.h
- First Layer
rr_graph_uxsdcxx_serializer.h
(librrgraph)rr_graph_reader.h
(librrgraph)check_rr_graph_.h
(librrgraph)rr_graph.h
(vpr/src/route)
- Second Layer
rr_graph_uxsdcxx_serializer.h
->rr_graph_writer.h
(librrgraph)rr_graph.h
->place_and_route.h
(vpr/src/base)rr_graph.h
->vpr_api.cpp
(vpr/src/base)rr_graph.h
->route_common.cpp
(vpr/src/route)rr_graph.h
->router_delay_profiling.cpp
(vpr/src/route)rr_graph.h
->time_place_lookup.cpp
(vpr/src/place)rr_graph.h
->main.cpp
(utils/route_diag/src)
- Third Layer
place_and_route.cpp
->place.cpp
(vpr/src/place)place_and_route.cpp
->test_connection_router.cpp
(vpr/test)
t_unified_to_parallel_seg_index in
unified_to_parallel_seg_index.h
- First Layer
get_parallel_segs.h
(librrgraph)rr_graph_uxsdcxx_serializer.h
(librrgraph)rr_graph2.h
(vpr/src/route)
- Second Layer
rr_graph2.h
->clock_network_builders.h
(vpr/src/route)rr_graph2.h
->rr_graph.cpp
(vpr/src/route)
- Third Layer
clock_network_builders.h
->rr_graph_clock.h
(vpr/src/route)
e_route_type in
route_type.h
- First Layer
check_rr_graph.h
(librrgraph)vpr_types.h
(vpr/src/base)
- Second Layer
vpr_types.h
->read_options.h
(vpr/src/base)vpr_types.h
->stats.cpp
(vpr/src/base)vpr_types.h
->check_route.cpp
(vpr/src/route)vpr_types.h
->draw_types.h
(vpr/src/draw)
- Fourth Layer
draw_types.h
->draw_global
->draw.h
(vpr/src/draw)
e_base_cost_type in
base_cost_type.h
- First Layer
rr_graph_reader.h
(librrgraph)rr_graph_uxsdcxx_serializer.h
(librrgraph)vpr_types.h
(vpr/src/base)
- Second Layer
rr_graph_uxsdcxx_serializer.h
->rr_graph_writer.h
(librrgraph)vpr_types.h
->read_options.h
(vpr/src/base)vpr_types.h
->rr_graph.cpp
(vpr/src/route)vpr_types.h
->rr_graph_indexed_data.cpp
(vpr/src/route)
e_cost_indices in
cost_indices.h
- First Layer
rr_graph_uxsdcxx_serializer.h
(librrgraph)vpr_types.h
(vpr/src/base)
- Second Layer
vpr_types.h
->rr_graph.h
(vpr/src/route)vpr_types.h
->rr_graph_indexed_data.cpp
(vpr/src/route)vpr_types.h
->router_lookahead_map.cpp
(vpr/src/route)vpr_types.h
->router_lookahead.h
(vpr/src/route)vpr_types.h
->route_timing.h
(vpr/src/route)
- Third Layer
rr_graph.h
->router_lookahead_extended_map.cpp
(vpr/src/route)
- Fourth Layer
vpr_types.h
->rr_graph2.h
->clock_connection_builders.cpp
(vpr/src/route)
t_chan_width in
chan_width.h
- First Layer
check_rr_graph.h
(librrgrpah)rr_graph_reader.h
(librrgraph)rr_graph_writer.h
(librrgraph)rr_graph_uxsdcxx_serializer.h
(librrgraph)vpr_types.h
(vpr/src/base)
- Second Layer
vpr_types.h
->place_and_route.h
(vpr/src/base)vpr_types.h
->vpr_api.h
(vpr/src/base)vpr_types.h
->vpr_context.h
(vpr/srce/base)vpr_types.h
->timing_place_lookup.cpp
(vpr/src/place)vpr_types.h
->build_switchblocks.h
(vpr/src/route)vpr_types.h
->cb_metrics.cpp
(vpr/src/route)vpr_types.h
->route_common.cpp
(vpr/src/route)vpr_types.h
->router_delay_profiling.h
(vpr/src/route)vpr_types.h
->rr_graph.h
(vpr/src/route)vpr_types.h
->rr_graph2.cpp
(vpr/src/route)vpr_types.h
->rr_graph_sbox.cpp
(vpr/src/route)
- Third Layer
rr_graph.h
->rr_graph_clock.cpp
(vpr/src/route)
- Fourth Layer
rr_graph.h
->main.cpp
(utils/route_diag/src)
- First Layer
…zer, find_create_rr_rc_data.
…nd_load_rr_indexed_data.cpp to librrgraph/src/util
@acomodi: we suggest you review this in case it interacts with the interchange format; also a big restructuring so worth reviewing in any case. |
To do: please add vtr and titan QoR data to sh[ow no degradations in runtime, or unexpected QoR changes. See the developer guide and check both the vtr and titan benchmarks. |
Templates to provide QoR test summary: #1972 (comment) Documentation about test: https://docs.verilogtorouting.org/en/latest/README.developers/#tests |
@vaughnbetz @tangxifan |
|
||
static bool has_adjacent_channel(const t_rr_node& node, const DeviceGrid& grid); | ||
static bool has_adjacent_channel(const RRGraphView& rr_graph, const DeviceGrid& grid, const t_rr_node& node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a mark here. This function need a refactoring. We should use RRNodeId
rather than t_rr_node
which is now an internal data of RRGraph
@@ -494,13 +497,13 @@ void check_rr_node(int inode, enum e_route_type route_type, const DeviceContext& | |||
//Don't worry about disconnect PINs which have no adjacent channels (i.e. on the device perimeter) | |||
bool check_for_out_edges = true; | |||
if (rr_type == IPIN || rr_type == OPIN) { | |||
if (!has_adjacent_channel(rr_graph.rr_nodes()[inode], device_ctx.grid)) { | |||
if (!has_adjacent_channel(rr_graph, grid, rr_graph.rr_nodes()[inode])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a mark, rr_nodes() just expose the internal node storage directly to client function, which should be avoid. I suggest to rework this function later.
vtr-verilog-to-routing/libs/librrgraph/src/base/rr_graph_view.h
Lines 442 to 445 in 7989197
/** @brief Return the node-level storage structure for queries from client functions */ | |
inline const t_rr_graph_storage& rr_nodes() const { | |
return node_storage_; | |
} |
@@ -138,9 +138,11 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) { | |||
bool highlight_rr_nodes(int hit_node) { | |||
t_draw_state* draw_state = get_draw_state_vars(); | |||
|
|||
//TODO: fixed sized char array may cause overflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vaughnbetz I am not sure why there is a fixed-length message string here. But it looks dangerous to me. Just a reminder here. See if you do need to fix it.
…-to-routing into librrgraph_vpr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@vaughnbetz : I have gone through another round of code view. I am satisfied with the code changes. QoR results have been uploaded as well, showing almost zero overhead on critical metric. Waiting for your decision.
Thanks! Merged. |
Description
In this PR
rr_graph_reader
andrr_graph_writer
from vpr/src/route are moved to librrgraph. We also avoid dependencies from vpr and try moving the vpr dependencies to the according libraries.MOVED/ADDED FILES
librrgraph
to avoid vpr dependencies:rr_graph_reader.h/.cpp
rr_graph_writer.h/.cpp
rr_graph_uxsdcxx_serializer.h
uxsdcxx
generatorrr_graph.xsd
rr_metadata.h/.cpp
rr_rc_data.h/.cpp
check_rr_graph.h/.cpp
rr_graph_utils.h/.cpp
rr_graph_storage_utils.h
describe_rr_node.h/.cpp
get_parallel_segs.h/.cpp
alloc_and_load_rr_indexed_data.h/.cpp
libarchfpga
to avoid vpr dependencies:device_grid.h/.cpp
histogram.h/.cpp
graph_type.h
chan_width.h
route_type.h
cost_indices.h
base_cost_type.h
unified_to_parallel_seg_index.h
libvtrutil
to avoid vpr dependencies:vpr_error.h/.cpp
MAJOR CODE CHANGES
DeviceContext
are now passed in directly as parameters to avoid dependency onDeviceContext
(VprContext
):load_rr_file
write_rr_graph
rr_node_metadata
rr_edge_metadata
add_rr_node_metadata
add_rr_edge_metadata
find_create_rr_rc_data
check_rr_graph
check_rr_node
describe_rr_node
alloc_and_load_rr_indexed_data
*Parameters of subroutines local to the module are also changed accordingly regarding the parameter change from above.
rr_graph_uxsdcxx_serializer.h
to accommodate the parameter changes:std::vector<t_rr_rc_data>* rr_rc_data
added toRrGraphSerializer
const int virtual_clock_network_root_idx
added toRrGraphSerializer
const bool echo_enabled
added toRrGraphSerializer
const char* echo_file_name
added toRrGraphSerializer
MetadataStorage<int>* rr_node_metadata_
added toMetadataBind
MetadataStorage<std::tuple<int, int, short>>* rr_edge_metadata_
added toMetadataBind
DeviceGrid
removed fromvpr/src/route
, moved tolibarchfpga
histogram
removed fromvpr/src/util
, moved tolibarchfpga
t_unified_to_parallel_seg_index
removed fromrr_graph2.h
, moved tolibarchfpga
get_parallel_segs
removed fromrr_graph2.h
, moved tolibarchfpga
e_route_type
removed fromvpr_types.h
, moved tolibarchfpga
e_base_cost_type
removed fromvpr_types.h
, moved tolibarchfpga
e_cost_indices
removed fromvpr_types.h
, moved tolibarchfpga
t_chan_width
removed fromvpr_types.h
, moved tolibarchfpga
describe_rr_node
removed fromrr_graph.h
, moved tolibrrgraph
alloc_and_load_rr_indexed_data
removed fromrr_graph_indexed_data.h
, moved tolibrrgraph
e_graph_type
(akat_graph_type
) removed fromrr_graph.h
, moved tolibrrgraph
rr_graph_util
(vpr/src/route) merged tolibrrgraph
OTHER CODE CHANGE
VTR_ENABLE_CAPNPROTO
added tolibrrgraph/CMakeLists.txt
generate_rr_graph_serializers
moved fromvpr/CMakeLists.txt
to `librrgraph/CMakeLists.txtUPDATES
io
for files regarding read/write purposes.utils
for utility functions.base
for rest of the files in librrgraph.rr_graph_type.h
(librrgraph/base) for builder/general usage:e_graph_type
ingraph_type.h
e_route_type
inroute_type.h
t_chan_width
inchan_width.h
t_unified_to_parallel_seg_index.h
inunified_to_parallel_seg_index.h
rr_graph_cost.h
(librrgraph/base) for router usage:e_base_cost_type
inbase_cost_type.h
e_cost_indices
incost_indices.h
Related Issue
Motivation and Context
As devised by the mentor #2000
How Has This Been Tested?
The changes passed the two regression tests
vtr_reg_basic
andvtr_reg_strong
.Types of changes
Checklist: