Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 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
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
16 changes: 4 additions & 12 deletions libs/libarchfpga/src/echo_arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
}

switch (arch->sb_type) {
case (WILTON):
case e_switch_block_type::WILTON:
fprintf(Echo, "\tSwitch Block: type wilton fs %d\n", arch->Fs);
break;
case (UNIVERSAL):
case (e_switch_block_type::UNIVERSAL):
fprintf(Echo, "\tSwitch Block: type universal fs %d\n", arch->Fs);
break;
case (SUBSET):
case e_switch_block_type::SUBSET:
fprintf(Echo, "\tSwitch Block: type subset fs %d\n", arch->Fs);
break;
default:
Expand All @@ -201,7 +201,7 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
fprintf(Echo, "\tInput Connect Block Switch Name Within a Same Die: %s\n", arch->ipin_cblock_switch_name[ipin_cblock_switch_index_within_die].c_str());

//if there is more than one layer available, print the connection block switch name that is used for connection between two dice
for (const auto& layout : arch->grid_layouts) {
for (const t_grid_def& layout : arch->grid_layouts) {
int num_layers = (int)layout.layers.size();
if (num_layers > 1) {
fprintf(Echo, "\tInput Connect Block Switch Name Between Two Dice: %s\n", arch->ipin_cblock_switch_name[ipin_cblock_switch_index_between_dice].c_str());
Expand Down Expand Up @@ -257,14 +257,6 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
//wire_switch == arch_opin_switch
fprintf(Echo, "\t\t\t\ttype unidir mux_name for within die connections: %s\n",
arch->switches[seg.arch_wire_switch].name.c_str());
//if there is more than one layer available, print the segment switch name that is used for connection between two dice
for (const auto& layout : arch->grid_layouts) {
int num_layers = (int)layout.layers.size();
if (num_layers > 1) {
fprintf(Echo, "\t\t\t\ttype unidir mux_name for between two dice connections: %s\n",
arch->switches[seg.arch_inter_die_switch].name.c_str());
}
}
} else { //Should be bidir
fprintf(Echo, "\t\t\t\ttype bidir wire_switch %s arch_opin_switch %s\n",
arch->switches[seg.arch_wire_switch].name.c_str(),
Expand Down
4 changes: 3 additions & 1 deletion libs/libarchfpga/src/logic_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ enum class e_parallel_axis {
/** Y_AXIS: Data that describes an y-directed wire segment (CHANY) */
Y_AXIS,
/** BOTH_AXIS: Data that can be applied to both x-directed and y-directed wire segment */
BOTH_AXIS
BOTH_AXIS,
/** Z_AXIS: Data that describes an z-directed wire segment (CHANZ) */
Z_AXIS
};

/*
Expand Down
33 changes: 13 additions & 20 deletions libs/libarchfpga/src/parse_switchblocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using vtr::t_formula_data;
/*---- Functions for Parsing Switchblocks from Architecture ----*/

//Process the desired order of a wireconn
static void parse_switchpoint_order(const char* order, SwitchPointOrder& switchpoint_order);
static void parse_switchpoint_order(std::string_view order, e_switch_point_order& switchpoint_order);

/**
* @brief Parses an inline `<wireconn>` node using its attributes.
Expand Down Expand Up @@ -86,7 +86,7 @@ static void parse_comma_separated_wire_points(const char* ch, std::vector<t_wire
static void parse_num_conns(std::string num_conns, t_wireconn_inf& wireconn);

/* Set connection from_side and to_side for custom switch block pattern*/
static void set_switch_func_type(SBSideConnection& conn, const char* func_type);
static void set_switch_func_type(SBSideConnection& conn, std::string_view func_type);

/* parse switch_override in wireconn */
static void parse_switch_override(const char* switch_override, t_wireconn_inf& wireconn, const std::vector<t_arch_switch_inf>& switches);
Expand Down Expand Up @@ -282,13 +282,13 @@ static t_wire_switchpoints parse_wireconn_from_to_node(pugi::xml_node node, cons
return wire_switchpoints;
}

static void parse_switchpoint_order(const char* order, SwitchPointOrder& switchpoint_order) {
if (order == std::string("")) {
switchpoint_order = SwitchPointOrder::SHUFFLED; //Default
} else if (order == std::string("fixed")) {
switchpoint_order = SwitchPointOrder::FIXED;
} else if (order == std::string("shuffled")) {
switchpoint_order = SwitchPointOrder::SHUFFLED;
static void parse_switchpoint_order(std::string_view order, e_switch_point_order& switchpoint_order) {
if (order == "") {
switchpoint_order = e_switch_point_order::SHUFFLED; //Default
} else if (order == "fixed") {
switchpoint_order = e_switch_point_order::FIXED;
} else if (order == "shuffled") {
switchpoint_order = e_switch_point_order::SHUFFLED;
} else {
archfpga_throw(__FILE__, __LINE__, "Unrecognized switchpoint order '%s'", order);
}
Expand Down Expand Up @@ -328,19 +328,18 @@ static void parse_comma_separated_wire_points(const char* ch, std::vector<t_wire
}

static void parse_num_conns(std::string num_conns, t_wireconn_inf& wireconn) {
//num_conns is now interpretted as a formula and processed in build_switchblocks
// num_conns is now interpreted as a formula and processed in build_switchblocks
wireconn.num_conns_formula = num_conns;
}

//set sides for a specific conn for custom switch block pattern
static void set_switch_func_type(SBSideConnection& conn, const char* func_type) {
static void set_switch_func_type(SBSideConnection& conn, std::string_view func_type) {

if (std::string(func_type).length() != 2) {
if (func_type.length() != 2) {
archfpga_throw(__FILE__, __LINE__, "Custom switchblock func type must be 2 characters long: %s\n", func_type);
}

// Only valid sides are right, top, left, bottom, above and under
if (std::string(func_type).find_first_not_of("rtlbauRTLBAU") != std::string::npos) {
if (func_type.find_first_not_of("rtlbRTLB") != std::string::npos) {
archfpga_throw(__FILE__, __LINE__, "Unknown direction specified: %s\n", func_type);
}

Expand All @@ -352,12 +351,6 @@ static void set_switch_func_type(SBSideConnection& conn, const char* func_type)
archfpga_throw(__FILE__, __LINE__, "Unknown permutation function specified, cannot go from side to same side: %s\n", func_type);
}

// We don't allow specification of patterns that imply edges going over 2 or more layers
// (this doesn't seem electrically logical), so we disallow going from above/under to above/under.
if ((to_side == ABOVE || to_side == UNDER) && (from_side == ABOVE || from_side == UNDER)) {
archfpga_throw(__FILE__, __LINE__, "Unknown permutation function specified, cannot go from above/under to above/under: %s\n", func_type);
}

conn.set_sides(from_side, to_side);
}

Expand Down
32 changes: 4 additions & 28 deletions libs/libarchfpga/src/physical_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <unordered_map>
#include <string>
#include <map>
#include <unordered_map>
#include <limits>
#include <unordered_set>

Expand Down Expand Up @@ -1686,28 +1685,6 @@ enum class SegResType {
/// String versions of segment resource types
constexpr std::array<const char*, static_cast<size_t>(SegResType::NUM_RES_TYPES)> RES_TYPE_STRING{"GCLK", "GENERAL"};

/// Defines the type of switch block used in FPGA routing.
enum e_switch_block_type {
/// If the type is SUBSET, I use a Xilinx-like switch block where track i in one channel always
/// connects to track i in other channels.
SUBSET,

/// If type is WILTON, I use a switch block where track i
/// does not always connect to track i in other channels.
/// See Steve Wilton, PhD Thesis, University of Toronto, 1996.
WILTON,

/// The UNIVERSAL switch block is from Y. W. Chang et al, TODAES, Jan. 1996, pp. 80 - 101.
UNIVERSAL,

/// The FULL switch block type allows for complete connectivity between tracks.
FULL,

/// A CUSTOM switch block has also been added which allows a user to describe custom permutation functions and connection patterns.
/// See comment at top of SRC/route/build_switchblocks.c
CUSTOM
};

enum e_Fc_type {
ABSOLUTE,
FRACTIONAL
Expand Down Expand Up @@ -1746,22 +1723,22 @@ struct t_segment_inf {
* specified in the architecture file. If -1, this value was not set in the
* architecture file and arch_wire_switch should be used for "DEC_DIR" wire segments.
*/
short arch_wire_switch_dec = -1;
short arch_wire_switch_dec = ARCH_FPGA_UNDEFINED_VAL;

/**
* @brief Same as arch_opin_switch but used only for decremental tracks if
* it is specified in the architecture file. If -1, this value was not set in
* the architecture file and arch_opin_switch should be used for "DEC_DIR" wire segments.
*/
short arch_opin_switch_dec = -1;
short arch_opin_switch_dec = ARCH_FPGA_UNDEFINED_VAL;

/**
* @brief Index of the switch type that connects output pins (OPINs) to this
* segment from another die (layer). Note that this index is in relation to
* the switches from the architecture file, not the expanded list of switches
* that is built at the end of build_rr_graph.
*/
short arch_inter_die_switch = -1;
short arch_inter_die_switch = ARCH_FPGA_UNDEFINED_VAL;

/**
* @brief The fraction of logic blocks along its length to which this segment can connect.
Expand All @@ -1783,7 +1760,7 @@ struct t_segment_inf {
/// The capacitance of a routing track, per unit logic block length.
float Cmetal;

enum e_directionality directionality;
e_directionality directionality;

/**
* @brief Defines what axis the segment is parallel to. See e_parallel_axis
Expand Down Expand Up @@ -1841,7 +1818,6 @@ inline bool operator==(const t_segment_inf& a, const t_segment_inf& b) {
&& a.length == b.length
&& a.arch_wire_switch == b.arch_wire_switch
&& a.arch_opin_switch == b.arch_opin_switch
&& a.arch_inter_die_switch == b.arch_inter_die_switch
&& a.frac_cb == b.frac_cb
&& a.frac_sb == b.frac_sb
&& a.longline == b.longline
Expand Down
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/read_fpga_interchange_arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,7 @@ struct ArchReader {
arch_->Chans.chan_y_dist.xpeak = 0;
arch_->Chans.chan_y_dist.dc = 0;
arch_->ipin_cblock_switch_name.push_back(std::string("generic"));
arch_->sb_type = WILTON;
arch_->sb_type = e_switch_block_type::WILTON;
arch_->Fs = 3;
default_fc_.specified = true;
default_fc_.in_value_type = e_fc_value_type::FRACTIONAL;
Expand Down
Loading
Loading