Skip to content

Conversation

@AmirhosseinPoolad
Copy link
Contributor

@AmirhosseinPoolad AmirhosseinPoolad commented Nov 11, 2025

This PR adds the last piece of functionality for modeling 2.5D architectures in upstream VPR: Actually cutting down the wires and connections that cross between the dice.

I had an issue with code duplication and there are still some functions that look very similar but do different things. I tried my best to keep the duplication to the lowest level functions and have more general higher level functions that wrap them but there's still some remaining. If you have an idea to do this in a better way please let me know.

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code labels Nov 11, 2025
@AmirhosseinPoolad AmirhosseinPoolad changed the title [WIP] RR Graph - Cut interposer crossing wires RR Graph - Cut interposer crossing wires Nov 12, 2025
@github-actions github-actions bot added the docs Documentation label Nov 12, 2025
Copy link
Contributor

@AlexandreSinger AlexandreSinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Some comments.

Copy link
Contributor

@amin1377 amin1377 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Amir!

RRNodeId src_node = rr_graph.edge_src_node(edge_id);
RRNodeId sink_node = rr_graph.edge_sink_node(edge_id);

// TODO: ignoring ChanZ nodes for now
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate a bit more on why chanz is ignored? My guess is that since this code is focused on the 2.5D architecture, the assumption is that chanz is not stretched across the 2D plane but along the Z-axis, so the interposer line wouldn’t apply to it. If that’s the case, I’d also add an ASSERT_DEBUG here to ensure that x_low == x_high and y_low == y_high.

Copy link
Contributor Author

@AmirhosseinPoolad AmirhosseinPoolad Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't thought about 3D architectures that also have interposer cut lines so I'm honestly not sure what should happen to edges to connect to/from chanz nodes. I think this needs further discussions about what it even means to have an architecture like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd update the comment to say that we don't allow interposers in the Z dimension (z is for die-stacking, and an interposer in a die stacking dimension is not currently manufacturable).

Copy link
Contributor

@soheilshahrouz soheilshahrouz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Amir!

}
}

void update_interposer_crossing_nodes_in_spatial_lookup_and_rr_graph_storage(const RRGraphView& rr_graph, const DeviceGrid& grid, RRGraphBuilder& rr_graph_builder, const std::vector<std::pair<RRNodeId, int>>& sg_node_indices) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the line is too long
the function name is too long

@github-actions github-actions bot added the libarchfpga Library for handling FPGA Architecture descriptions label Nov 17, 2025
Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; some commenting upgrades and a few changes suggested.


/** @brief Removes a given list of RREdgeIds for the RR Graph.
* This method does not preserve the order of edges. If you're
* calling it after partition_edges has been called, you need
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"you need to call it again" --> you will need to call partition_edges again

edge_remapped_.erase(edge_remapped_.begin() + edge_list_end + 1, edge_remapped_.end());

VTR_ASSERT(edge_dest_node_.size() == (starting_edge_count - rr_edges_to_remove.size()));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should set partitioned = false here

}

/** @brief Returns a range of all edges in the RR Graph.
* This method does not depend on the edges begin correctly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

begin -> being

/** @brief Adds a batch of edges.*/
void alloc_and_load_edges(const t_rr_edge_info_set* rr_edges_to_create);

/** @brief Removes a given list of RREdgeIds for the RR Graph.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'for the RR' -> 'from the RR'
'has been called, you need to call it again' -> 'has been called, you need to call partition_edges again'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should say this operation is O(num_edges) in the RR graph, so it should not be called often and edges should be removed in bulk if at all possible.


int layer = rr_graph.node_layer_low(src_node);

for (int cut_loc_y : grid.get_horizontal_interposer_cuts()[layer]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain this a bit. If the start (drive point) of the src node of the edge is on a different side of the interposer than the sink node of the edge drive point, the edge starts on a piece of wire that should be cut by the interposer. Mark it for removal.

* @brief Update a CHANY node's bounding box in RRGraph and SpatialLookup entries.
* This function assumes that the channel node actually crosses the cut location and
* might not function correctly otherwise.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment the params -- there are a lot so good to document.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put an assert in for the channel node crosses the cut location?

* might not function correctly otherwise.
*
* This is a low level function, you should use cut_channel_node that wraps this up in a nicer API.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document params

if (node_direction == Direction::INC) {
// Anything to the right of cut_loc_x shouldn't exist
rr_graph_builder.set_node_coordinates(node, x_low, y_low, cut_loc_x, y_high);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add assert that the node crosses the cut location (or just return without doing anything and update the comment).

#include "rr_spatial_lookup.h"
#include "vpr_error.h"
#include "vtr_assert.h"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment what this file is for.
Add an ascii art showing where the interposer boundary is / what wires are cut / where channels are vs. the interposer for the same coordinate (e.g. y).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation lang-cpp C/C++ code libarchfpga Library for handling FPGA Architecture descriptions VPR VPR FPGA Placement & Routing Tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants