Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
8c2a4bb
add build_scatter_gather.cpp/.h files
soheilshahrouz Sep 5, 2025
7101847
move sb_not_here() and related function to a new file
soheilshahrouz Sep 5, 2025
514865c
Merge branch 'temp_num_layers_size_t' into temp_3d_sg
soheilshahrouz Sep 5, 2025
5572ec7
use t_physical_loc instead of x, y, layer arguments
soheilshahrouz Sep 5, 2025
557769c
check inter_cluster_rr in sb_not_here() instead of inside every singl…
soheilshahrouz Sep 5, 2025
70bea1c
rename SwitchPointOrder to e_switch_point_order
soheilshahrouz Sep 5, 2025
cc44a8e
find scatter/gather src/dst channels
soheilshahrouz Sep 6, 2025
7b5475c
remove redundant call to count_wire_type_sizes
soheilshahrouz Sep 7, 2025
57c3348
rename WireInfo to t_wire_info
soheilshahrouz Sep 7, 2025
642427b
move count_wire_type_sizes() to utils
soheilshahrouz Sep 7, 2025
1904fe8
move some common functions used by both switch-box and scatter-gather…
soheilshahrouz Sep 7, 2025
c1f2771
collect candidate wires for scatter-gather at each location
soheilshahrouz Sep 7, 2025
8359c63
move evaluate_num_conns_formula() to common utils
soheilshahrouz Sep 8, 2025
a575d95
replace tuples with structs
soheilshahrouz Sep 8, 2025
f900cf2
call alloc_and_load_scatter_gather_connections
soheilshahrouz Sep 9, 2025
333aa57
Fix bug where sg_link offsets would be uninitialized
AmirhosseinPoolad Sep 9, 2025
7abe75e
fix the condition for checking that only one offset is set
soheilshahrouz Sep 9, 2025
a5e7fd7
pass t_physical_loc instead of x/y/layer
soheilshahrouz Sep 9, 2025
44666fe
update alloc_and_load_inter_die_rr_node_indices() to accept t_bottlen…
soheilshahrouz Sep 10, 2025
9ea5a4d
store 3d t_bottleneck_link per x/y location
soheilshahrouz Sep 10, 2025
0932ddb
add chanz nodes based on interdie 3d links (SG)
soheilshahrouz Sep 10, 2025
0253916
remove custom 3d switch block stuff from rr graph
soheilshahrouz Sep 10, 2025
f6d1881
add inter-die 3d edges
soheilshahrouz Sep 10, 2025
53dd486
add arch_wire_switch
soheilshahrouz Sep 11, 2025
8a882c1
fix the bug in index assignment to chanz nodes
soheilshahrouz Sep 11, 2025
a3a9aec
rename add_interdie_3d_edges() to add_inter_die_3d_edges()
soheilshahrouz Sep 11, 2025
2dd1731
some minor clean ups
soheilshahrouz Sep 11, 2025
0f5ae7a
add layer_low/high to RR graph API to support CHANZ nodes that span m…
soheilshahrouz Sep 12, 2025
5dbe2e1
update t_rr_node::length() to handle CHANZ nodes
soheilshahrouz Sep 12, 2025
a6c40a9
update get_min_cross_layer_delay() to use CHANZ nodes
soheilshahrouz Sep 12, 2025
25ddc9a
doxygen comment for t_wire_cost_map
soheilshahrouz Sep 12, 2025
0cb5979
find starting chanxy and chanz nodes separately
soheilshahrouz Sep 12, 2025
e6ec35e
update set_lookahead_map_costs() and fill_in_missing_lookahead_entrie…
soheilshahrouz Sep 12, 2025
df26028
parse axis="z" for segment type
soheilshahrouz Sep 14, 2025
40d89f0
alloc_and_load_rr_indexed_data supports CHANZ
soheilshahrouz Sep 15, 2025
cb85f96
counz CHANZ segments in count_rr_segment_types()
soheilshahrouz Sep 15, 2025
8866821
make e_switch_block_type enum class and move it to switchblock_types.h
soheilshahrouz Sep 16, 2025
55e93a3
update 3d_sb SIV architecture file to add scatter-gather patterns for…
soheilshahrouz Sep 17, 2025
50b3569
remove above and under sides
soheilshahrouz Sep 17, 2025
c44189f
remove unused arguments of build_inter_die_3d_rr_chan()
soheilshahrouz Sep 17, 2025
0c4ca72
move Fc_xofs to alloc_and_load_rr_graph()
soheilshahrouz Sep 17, 2025
b118f01
use std::string_view instead of chan* and converting it to string
soheilshahrouz Sep 17, 2025
417f6a9
doxygen comments in build_scatter_gather.h and utils.h
soheilshahrouz Sep 17, 2025
b794872
doxygen comments for static functions in build_scatter_gather.cpp
soheilshahrouz Sep 17, 2025
019a8e5
make format
soheilshahrouz Sep 17, 2025
87312f1
Merge remote-tracking branch 'origin/master' into temp_3d_sg
soheilshahrouz Sep 17, 2025
c35a77f
remove layer member vars from t_switchblock_edge
soheilshahrouz Sep 18, 2025
25185f3
fix compilation error in test_fasm
soheilshahrouz Sep 18, 2025
6833d1c
clean some doxygen comments
soheilshahrouz Sep 18, 2025
1ca2ea2
remove strong scatter gather test
soheilshahrouz Sep 18, 2025
6da700b
remove scatter gather test from task list
soheilshahrouz Sep 18, 2025
3336f28
add a chanz wire and mux to SIV cb 3d arch file
soheilshahrouz Sep 18, 2025
e70ce87
remove k6_sg arch file
soheilshahrouz Sep 18, 2025
c187d71
add chanz segment and switch to 3d_k4_N4_90nm.xml
soheilshahrouz Sep 18, 2025
8ebd707
remove above and under directions from a comment in parse_switchblock…
soheilshahrouz Sep 19, 2025
20dbfe6
add chan_type_to_index()
soheilshahrouz Sep 19, 2025
7e2a68f
write rr_index_info only when echo is enabled
soheilshahrouz Sep 19, 2025
15dfee5
short --> char for layer getter methods
soheilshahrouz Sep 19, 2025
293e6e7
Merge remote-tracking branch 'origin/master' into temp_3d_sg
soheilshahrouz Sep 19, 2025
61c8885
snake case
soheilshahrouz Sep 19, 2025
b4f3e75
address remaining PR comments on auto and commenting
soheilshahrouz Sep 19, 2025
01ddeae
comment explaining how chan_type_dim_size is determined
soheilshahrouz Sep 24, 2025
cf69e63
rename index_to_correct_channels to index_to_correct_sg_channels
soheilshahrouz Sep 24, 2025
96eacbe
use count() method instead of find() to see if a wire_type exist in w…
soheilshahrouz Sep 24, 2025
bbfb7c0
typo
soheilshahrouz Sep 24, 2025
d9d2169
Merge remote-tracking branch 'origin/master' into temp_3d_sg
soheilshahrouz Sep 24, 2025
1b799d7
handle CHANZ nodes in overuse report
soheilshahrouz Sep 24, 2025
0bfc909
error out when simple lookahead is used with a 3-d arch
soheilshahrouz Sep 24, 2025
cd6e0fd
use explicit type for scatter and gather wire candidates
soheilshahrouz Sep 26, 2025
89344bf
warning message when scatter/gather has no target channels
soheilshahrouz Sep 26, 2025
454fd79
add comments
soheilshahrouz Sep 26, 2025
322f30f
add warning messages for zero fanin fanout
soheilshahrouz Sep 26, 2025
da7d010
error out when compressed router lookahead is used with a 3d arch
soheilshahrouz Sep 26, 2025
a5517e1
update the arch reference to say that SG is only supported in 3D with…
soheilshahrouz Sep 26, 2025
7d9358e
updated comments in 3d_sb_siv arch file
soheilshahrouz Sep 26, 2025
0c58fb3
use rng to shuffle wire candiates
soheilshahrouz Sep 26, 2025
eeb9dbf
make format
soheilshahrouz Sep 26, 2025
8d5b442
update the arch reference to for segment z axis
soheilshahrouz Sep 26, 2025
1be6dca
Merge remote-tracking branch 'origin/master' into temp_3d_sg
soheilshahrouz Sep 26, 2025
6bf3b24
use 'LZ' segment for 3d sg_link
soheilshahrouz Sep 28, 2025
3d00065
remove custom_3d_sb_fanin_fanout cmd option from config files
soheilshahrouz Sep 28, 2025
c39e001
Merge remote-tracking branch 'origin/master' into temp_3d_sg and reso…
soheilshahrouz Sep 30, 2025
d8e92c4
fix typos in architecture reference
soheilshahrouz Oct 1, 2025
18a3eaa
remove redundant coordinate checks in check_rr_node()
soheilshahrouz Oct 1, 2025
8fad9e7
add a TODO item to inter_layer_connections_limited_to_opin()
soheilshahrouz Oct 1, 2025
b3d2174
store layer_low and layer_high next to each other in a pair
soheilshahrouz Oct 1, 2025
c9362fc
move 3d rr graph functions to a dedicated file
soheilshahrouz Oct 1, 2025
ccd98a5
chanz nodes' layer range is initialized based on SG locs
soheilshahrouz Oct 1, 2025
c642623
make format
soheilshahrouz Oct 1, 2025
21e7287
add parallel_segment_index and chan_type member vars to t_bottleneck_…
soheilshahrouz Oct 1, 2025
ccf667b
initialize the cost index of CHANZ nodes based on the segment type th…
soheilshahrouz Oct 1, 2025
1a5fab8
fix compilation warning in 3d rr graph generation
soheilshahrouz Oct 1, 2025
2334819
fix compilation error in build_scatter_gather.cpp
soheilshahrouz Oct 1, 2025
05166a5
fix seg fault
soheilshahrouz Oct 1, 2025
e8cfa82
remove 3d arch file from arch/titan
soheilshahrouz Oct 5, 2025
fdccbc5
Merge remote-tracking branch 'origin/master' into temp_3d_sg
soheilshahrouz Oct 5, 2025
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
Prev Previous commit
Next Next commit
doxygen comments in build_scatter_gather.h and utils.h
  • Loading branch information
soheilshahrouz committed Sep 17, 2025
commit 417f6a96513c65a22289d513ed3f565c0c7e9c21
3 changes: 2 additions & 1 deletion libs/librrgraph/src/base/rr_graph_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,12 @@ class RRGraphBuilder {
node_storage_.set_node_ptc_num(id, new_ptc_num);
}

/** @brief set the layer number at which RRNodeId is located at */
/// @brief Set the low layer coordinate where the given node is located at.
inline void set_node_layer_low(RRNodeId id, int layer){
node_storage_.set_node_layer_low(id, layer);
}

/// @brief Set the high layer coordinate where the given node is located at.
inline void set_node_layer_high(RRNodeId id, int layer){
node_storage_.set_node_layer_high(id, layer);
}
Expand Down
34 changes: 11 additions & 23 deletions libs/librrgraph/src/base/rr_graph_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,12 @@ class t_rr_graph_storage {
return node_fan_in_[id];
}

/** @brief Find the layer number that RRNodeId is located at.
* It is zero if the FPGA only has one die.
* The layer number start from the base die (base die: 0, the die above it: 1, etc.)
*/
// short node_layer(RRNodeId id) const{
// return node_layer_[id];
// }
/// @brief Returns the lowest layer where the given node is located at.
short node_layer_low(RRNodeId id) const {
return node_layer_low_[id];
}

/// @brief Returns the highest layer where the given node is located at.
short node_layer_high(RRNodeId id) const {
return node_layer_high_[id];
}
Expand Down Expand Up @@ -915,13 +910,14 @@ class t_rr_graph_storage {
/** @brief Fan in counts for each RR node. */
vtr::vector<RRNodeId, t_edge_size> node_fan_in_;

/** @brief
* Layer number that each RR node is located at
* Layer number refers to the die that the node belongs to. The layer number of base die is zero and die above it one, etc.
* This data is also considered as a hot data since it is used in inner loop of router, but since it didn't fit nicely into t_rr_node_data due to alignment issues, we had to store it
* in a separate vector.
*/
// Layer number refers to the die that the node belongs to.
// The layer number of base die is zero and die above it one, etc.
// This data is also considered as a hot data since it is used in inner loop of router,
// but since it didn't fit nicely into t_rr_node_data due to alignment issues, we had to store it in a separate vector.

/// @brief The lowest layer number where a given node is located at.
vtr::vector<RRNodeId, char> node_layer_low_;
/// @brief The highest layer number where a given node is located at.
vtr::vector<RRNodeId, char> node_layer_high_;

/**
Expand Down Expand Up @@ -1107,20 +1103,12 @@ class t_rr_graph_view {
return node_fan_in_[id];
}

/**
* @brief Retrieve the layer (die) number where the given RRNodeId is located.
*
* @param id The RRNodeId for which to retrieve the layer number.
* @return The layer number (die) where the RRNodeId is located.
*/
// short node_layer(RRNodeId id) const {
// return node_layer_[id];
// }

/// @brief Retrieve the lowest layer (die) number where the given RRNodeId is located.
short node_layer_low(RRNodeId id) const {
return node_layer_low_[id];
}

/// @brief Retrieve the highest layer (die) number where the given RRNodeId is located.
short node_layer_high(RRNodeId id) const {
return node_layer_high_[id];
}
Expand Down
2 changes: 1 addition & 1 deletion libs/librrgraph/src/base/rr_node.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "rr_node.h"
#include "rr_graph_storage.h"

//Returns the max 'length' over the x or y direction
//Returns the max 'length' over the x or y or z direction
short t_rr_node::length() const {
return std::max({storage_->node_yhigh(id_) - storage_->node_ylow(id_),
storage_->node_xhigh(id_) - storage_->node_xlow(id_),
Expand Down
40 changes: 30 additions & 10 deletions vpr/src/route/rr_graph_generation/build_scatter_gathers.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,45 @@

#include <vector>

/// Identifies a specific channel location in the device grid.
struct t_chan_loc {
t_physical_tile_loc location;
e_rr_type chan_type;
e_side side;
t_physical_tile_loc location; ///< Physical grid location of the channel
e_rr_type chan_type; ///< Type of routing channel (e.g., CHANX, CHANY)
e_side side; ///< Side of the reference switch block the channel lies on
};

/// Represents a wire candidate for scatter/gather connections.
struct t_sg_candidate {
t_chan_loc chan_loc;
t_wire_switchpoint wire_switchpoint;
t_chan_loc chan_loc; ///< Channel location (coordinates, type, side) where the wire lies.
t_wire_switchpoint wire_switchpoint; ///< Wire index and its valid switchpoint
};

/// Represents a scatter/gather bottleneck connection between two locations.
struct t_bottleneck_link {
t_physical_tile_loc gather_loc;
t_physical_tile_loc scatter_loc;
int arch_wire_switch;
std::vector<t_sg_candidate> gather_fanin_connections;
std::vector<t_sg_candidate> scatter_fanout_connections;
t_physical_tile_loc gather_loc; ///< Source switchblock location.
t_physical_tile_loc scatter_loc; ///< Destination switchblock location.
int arch_wire_switch; ///< The switch (mux) used to drive the bottleneck wire.
std::vector<t_sg_candidate> gather_fanin_connections; ///< Wires driving the bottleneck link at `gather_loc`
std::vector<t_sg_candidate> scatter_fanout_connections; ///< Wires driven by the bottleneck link at `scatter_loc`
};

/**
* @brief Builds scatter/gather bottleneck connections across the device grid.
*
* For each scatter/gather pattern, this routine finds candidate gather and scatter
* wires, evaluates connection limits from user-specified formulas, and creates
* bottleneck links between the corresponding locations. Both intra-die and inter-die
* (3D) connections are handled.
*
* @param scatter_gather_patterns List of scatter/gather connection patterns.
* @param inter_cluster_rr Flags indicating whether each layer has inter-cluster routing resources.
* @param segment_inf Wire segment type information.
* @param chan_details_x Channel details for horizontal routing channels.
* @param chan_details_y Channel details for vertical routing channels.
* @param nodes_per_chan Channel width data.
* @param interdie_3d_links Output: matrix storing inter-die (3D) bottleneck links.
* @return Vector of intra-die bottleneck links.
*/
std::vector<t_bottleneck_link> alloc_and_load_scatter_gather_connections(const std::vector<t_scatter_gather_pattern>& scatter_gather_patterns,
const std::vector<bool>& inter_cluster_rr,
const std::vector<t_segment_inf>& segment_inf,
Expand Down
1 change: 0 additions & 1 deletion vpr/src/route/rr_graph_generation/build_switchblocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ struct t_wireconn_scratchpad {
std::vector<t_wire_switchpoint> scratch_wires;
};


/************ Function Declarations ************/

/* Compute the wire(s) that the wire at (x, y, from_side, to_side, from_wire) should connect to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include "rr_types.h"
#include "vtr_expr_eval.h"

//
// Static Function Declarations
//

/**
* Returns wire segment length based on either:
* 1) the wire length specified in the segment details variable for this wire (if this wire segment doesn't span entire FPGA)
Expand Down Expand Up @@ -88,6 +92,10 @@ static bool is_core_sb(const DeviceGrid& grid, const t_physical_tile_loc& loc) {
return is_core;
}

//
// Static Function Definitions
//

static bool match_sb_xy(const DeviceGrid& grid,
const t_physical_tile_loc& loc,
const t_specified_loc& specified_loc) {
Expand Down Expand Up @@ -243,6 +251,10 @@ static int get_wire_segment_length(e_rr_type chan_type,
return wire_length;
}

//
// Non-static Function Definitions
//

bool sb_not_here(const DeviceGrid& grid,
const std::vector<bool>& inter_cluster_rr,
const t_physical_tile_loc& loc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ int get_switchpoint_of_wire(e_rr_type chan_type,
int seg_coord,
e_side sb_side);

/**
* @brief Evaluates a connection formula for scatter/gather and custom switchblock patterns.
*
* Sets variables "from" and "to" to the given wire counts and evaluates
* the formula string using the provided parser
*/
int evaluate_num_conns_formula(vtr::FormulaParser& formula_parser,
vtr::t_formula_data& formula_data,
const std::string& num_conns_formula,
Expand Down