Skip to content

Conversation

@tangxifan
Copy link
Contributor

@tangxifan tangxifan commented Oct 24, 2025

Description

This PR aims to enhance the direct connection builder of the tileable routing resource graph builder, with the following new feature:

  • It support any subtiles at any z in a tile as the starting point of a direct connection. Current direct builder requires the first subtile to be the starting point, which is very restrictive.
image

Related Issue

No issue is related. Stated in the description section.

Motivation and Context

Stated in the description section.

How Has This Been Tested?

  • All the existing tests passed.
  • Three new testcases have been added to the strong regression tests, each of which validate the new feature
    • DSP and BRAM sub-tiles are stacked in the same tile. The starting point of direct connections come from the DSP (the 3rd sub-tile) and ends at the BRAMs (the 1st and 2nd sub-tiles)
    • CLB, DSP and BRAM sub-tiles are stacked in the same tile. The starting of direction connections come from the DSP (the 2nd sub-tile) and ends at the BRAMs (the 3rd and 4th sub-tiles)
    • CLB, DSP and BRAM sub-tiles are stacked in the same tile. The starting of direction connections come from the DSP (the 4th sub-tile) and ends at the BRAMs (the 2nd and 3rd sub-tiles)
  • Added 3 new architecture files and a blif benchmark to validate the DSP-to-RAM direct connections

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code lang-netlist labels Oct 24, 2025
@tangxifan tangxifan changed the title [WIP] Now direct connection builder in tileable rr_graph supports any subtile index as the from_pin Now direct connection builder in tileable rr_graph supports any subtile index as the from_pin Oct 24, 2025
@tangxifan
Copy link
Contributor Author

@vaughnbetz This PR is ready for your review.

I notice this feature is missing for the regular rr_graph builder. We can add it if you want.

I have added @amin1377 as a potential reviewer.

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, except it needs a Doxygen comment on a new utility function.

I also find the (true == swap) style odd, but if you really like it I'm not dogmatic on that.

Adding this to the default rr-graph builder is a good idea, so if you can do that it would be good.

Does any documentation need to be updated?


bool is_empty_type(t_physical_tile_type_ptr type);
bool is_empty_type(t_logical_block_type_ptr type);
std::vector<int> find_sub_tile_indices_by_port_name(t_physical_tile_type_ptr type, std::string_view port_name);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have a doxygen comment describing the function purpose, return type and parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code comments have been added.

int relative_ipin = UNDEFINED;
if (clb_to_clb_directs[i].to_clb_pin_start_index
> clb_to_clb_directs[i].to_clb_pin_end_index) {
if (true == swap) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Odd style. I'd just put
if (swap)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adapted

}
} else {
relative_ipin = clb_to_clb_directs[i].to_clb_pin_start_index - offset;
if (true == swap) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Odd style. I'd use:
if (swap)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adapted

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, Xifan. I’d suggest adding the figure you included in the PR description to this document (Link)

return get_class_num_from_pin_physical_num(physical_type, pin_physical_num);
}

std::vector<int> find_sub_tile_indices_by_port_name(t_physical_tile_type_ptr type, std::string_view port_name) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@tangxifan: I’m a little confused here. Let’s say I have a tile that has 5 subtiles of the same type. All of those subtiles would have the same port name… How would you get the index of a subtile then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will get all the indices of the subtiles as long as the subtile has a port in the required name. These subtiles can all be the starting point of a direct connection.

@tangxifan
Copy link
Contributor Author

@vaughnbetz Thank you for the quick feedback. I have addressed the code comments.

Now the regular rr_graph generator supports the direct connections across subtiles. New testcases have to added to validate the regular rr_graph generator.

@github-actions github-actions bot added the docs Documentation label Oct 24, 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.

One minor nit in a comment, but other than that looks good to go.

bool is_empty_type(t_logical_block_type_ptr type);

/**
* @brief Returns the indices of sub tiles in a given physical type which contains the ports in a specified name. It will return all the sub tiles that contain the required port. Note that the sub tiles may be in different types
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nits: I think this should be:
"which contain the specified port name."
"Note that the sub tiles may be of different types"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@tangxifan
Copy link
Contributor Author

Thanks, Xifan. I’d suggest adding the figure you included in the PR description to this document (Link)

Thanks @amin1377 Doc has been updated.

@tangxifan
Copy link
Contributor Author

@vaughnbetz @amin1377 All the comments are addressed. CI is green. Please suggest if I can merge this PR.

@vaughnbetz
Copy link
Contributor

vaughnbetz commented Oct 24, 2025 via email

@tangxifan tangxifan merged commit 0502b83 into master Oct 24, 2025
30 checks passed
@tangxifan tangxifan deleted the xt_tileable_direct_strong branch October 24, 2025 23:59
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 lang-netlist VPR VPR FPGA Placement & Routing Tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants