Skip to content

Add a new API count_rr_switches() to RRGraphBuilder #1896

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

Merged
merged 4 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions vpr/src/device/rr_graph_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ class RRGraphBuilder {
node_storage_.add_node_side(id, new_side);
}

/** @brief Counts the number of rr switches needed based on fan in to support mux
* size dependent switch delays. */
inline size_t count_rr_switches(
size_t num_arch_switches,
t_arch_switch_inf* arch_switch_inf,
t_arch_switch_fanin& arch_switch_fanins) {
return node_storage_.count_rr_switches(num_arch_switches, arch_switch_inf, arch_switch_fanins);
}

/* -- Internal data storage -- */
private:
/* TODO: When the refactoring effort finishes,
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/route/rr_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ static void alloc_rr_switch_inf(t_arch_switch_fanin& arch_switch_fanins) {
auto& device_ctx = g_vpr_ctx.mutable_device();

/* allocate space for the rr_switch_inf array */
size_t num_rr_switches = device_ctx.rr_nodes.count_rr_switches(
size_t num_rr_switches = device_ctx.rr_graph_builder.count_rr_switches(
device_ctx.num_arch_switches,
device_ctx.arch_switch_inf,
arch_switch_fanins);
Expand Down