-
Notifications
You must be signed in to change notification settings - Fork 419
Add tileable RR Graph #3134
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
base: master
Are you sure you want to change the base?
Add tileable RR Graph #3134
Conversation
…rilog-to-routing into add_tileable_rr_graph
Hi @AlexandreSinger, I think the PR is ready for your first round of review. I'd appreciate it if you could take a look. Thanks! |
Hi @soheilshahrouz, This PR is ready for your review. Since you're familiar with the RR Graph code, it would be great if you could take a look at the tileable RR Graph implementation. |
…rilog-to-routing into add_tileable_rr_graph
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.
Hi @amin1377 thanks for bringing this in! I recognize not all of this is your code. Overall the code is well structured however it needs some code style and data structure cleanup so it can fit in better with the rest of the VTR flow.
Some. of the data structure changes can be made into issues; however, the coding style things should probably be fixed now.
|
||
.. note:: These options are required | ||
|
||
In the OpenFPGA architecture file, you may define additional attributes for each VPR's direct connection: |
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.
Are we destinguishing OpenFPGA architecture files from regular architecture files?
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.
Based on the meeting we had before, I guess the conclusion was to not support all OpenFPGA features in the standard RR Graph generation (at least for now). As a result, I’m creating a separate section to clearly outline the additional features that are exclusively supported by the tileable RR Graph.
doc/src/vpr/VIB.rst
Outdated
@@ -0,0 +1,254 @@ | |||
.. _VIB: | |||
|
|||
VIB Architecture |
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.
What does VIB. I think this file also needs some context. Why is it here? Who should be using this architecture?
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.
Good point. I moved it under the Tileable Architecture section. The vib.rst file explains what VIB is. In short, VIB combines the connection block (CB), switch block (SB), and intra-block crossbar into a single block. As a result, each tile consists of two sub-blocks: the functional block and the VIB (Versatile Interconnect Block). This design facilitates switch architecture exploration and ideally improves router flexibility.
vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_gsb.cpp
Outdated
Show resolved
Hide resolved
vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_gsb.cpp
Outdated
Show resolved
Hide resolved
vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_gsb.cpp
Outdated
Show resolved
Hide resolved
vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_node_builder.h
Outdated
Show resolved
Hide resolved
vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_node_builder.cpp
Outdated
Show resolved
Hide resolved
…rilog-to-routing into add_tileable_rr_graph
Thanks @AlexandreSinger; reviewing this amount of code is no small task, and I really appreciate your time. I've addressed your comments. Regarding your suggestions about replacing the vector of vectors with VTR data structures: while I agree with them in principle, I didn’t apply all of them since this part of the code is not performance-critical. I think the code is now ready for the next round of reviews. I’ve also added @AmirhosseinPoolad to help with it. |
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.
Thanks for this PR.
Since it's a large one, I’ve reviewed some files for now and will go through the rest soon.
@@ -2336,8 +2387,13 @@ struct t_arch { | |||
//If the layout is not specified in the command line options, this variable will be set to "auto" | |||
std::string device_layout; | |||
|
|||
std::vector<t_vib_grid_def> vib_grid_layouts; |
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.
Add a doxygen comment for this with ///
@@ -700,6 +700,10 @@ void ProcessMemoryClass(t_pb_type* mem_pb_type) { | |||
mem_pb_type->model_id = LogicalModelId::INVALID(); | |||
|
|||
mem_pb_type->modes[0].num_interconnect = mem_pb_type->num_ports * num_pb; | |||
|
|||
std::stringstream ss; |
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.
give a meaningful name to ss
std::string err_msg = (std::stringstream() << "Memory pb_type " << mem_pb_type->name << " has no interconnect").str();
VTR_ASSERT_MSG(mem_pb_type->modes[0].num_interconnect > 0, msg.c_str());
@@ -13,8 +13,11 @@ | |||
* @param segment_inf Unified list of all segments. | |||
* @param seg_index_map Map from unified to axis-specific segment indices. | |||
* @param parallel_axis Axis to filter segments by. | |||
* @param keep_original_index Whether to keep the original index of the segment. Currently, | |||
* it is only set to true when building the tileable rr_graph. |
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.
All @param
descriptions before this are aligned. It's probably a good idea to keep them aligned
@@ -2,14 +2,17 @@ | |||
|
|||
std::vector<t_segment_inf> get_parallel_segs(const std::vector<t_segment_inf>& segment_inf, | |||
t_unified_to_parallel_seg_index& seg_index_map, | |||
enum e_parallel_axis parallel_axis) { | |||
enum e_parallel_axis parallel_axis, | |||
bool keep_original_index) { |
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.
Might not be a bad idea to add a comment in front of keep_original_index
to mention its default value
`bool keep_original_index/=false/
std::vector<t_segment_inf> result; | ||
for (size_t i = 0; i < segment_inf.size(); ++i) { | ||
if (segment_inf[i].parallel_axis == parallel_axis || segment_inf[i].parallel_axis == BOTH_AXIS) { | ||
result.push_back(segment_inf[i]); | ||
result[result.size() - 1].seg_index = i; | ||
if (!keep_original_index) { | ||
result[result.size() - 1].seg_index = i; |
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.
result.back()
is more readable
short node_bend_start(RRNodeId id) const { | ||
return node_bend_start_[id]; | ||
} | ||
short node_bend_end(RRNodeId id) const { |
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.
add empty line
@@ -804,6 +844,9 @@ int t_rr_graph_view::node_track_num(RRNodeId id) const { | |||
int t_rr_graph_view::node_class_num(RRNodeId id) const { | |||
return get_node_class_num(node_storage_, node_ptc_, id); | |||
} | |||
int t_rr_graph_view::node_mux_num(RRNodeId id) const { |
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.
empty line
vtr::array_view_id<RRNodeId, const t_rr_node_data> node_storage, | ||
vtr::array_view_id<RRNodeId, const t_rr_node_ptc_data> node_ptc, | ||
RRNodeId id) { | ||
auto node_type = node_storage[id].type_; |
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.
auto
@@ -571,6 +574,11 @@ t_edge_size t_rr_graph_storage::num_non_configurable_edges(RRNodeId node, const | |||
return num_edges(node) - num_configurable_edges(node, rr_switches); | |||
} | |||
|
|||
bool t_rr_graph_storage::edge_is_configurable(RREdgeId edge, const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) const { | |||
auto iswitch = edge_switch(edge); |
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.
auto
const pugiutil::loc_data& loc_data); | ||
|
||
static void process_bend(pugi::xml_node Node, std::vector<int>& list, std::vector<int>& part_len, bool& is_bend, const int len, const pugiutil::loc_data& loc_data); | ||
|
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.
This file is already too large
I think these functions should be moved to a new source file
Merging OpenFPGA branch into master branch. PR #2135 explains features of OpenFPGA.