Skip to content

Conversation

AmirhosseinPoolad
Copy link
Contributor

@AmirhosseinPoolad AmirhosseinPoolad commented Sep 8, 2025

This PR contains an initial proposal for a new interposer tag. To define an interposer cut, you would add an <interposer_cut dim=x|y loc=val> tag under a <layout> tag that defines the location of the cut and the axis of the cut. This tag would then have multiple <interdie_wire> children specifying the connections between the two sides of the cut-line.

<interdie_wire sg_name="interposer_conn_sg" sg_link="X4" offset_start="0" offset_end="2" offset_increment="1" num=50/>

  • sg_name: name of the scatter-gather pattern to be used for the connections
  • sg_link: name of the sg_link to be used for the connections
  • offset_start,end,increment: Connections can be laid out in various offsets from the cut-line, these options
  • num: number of scatter-gather patterns to be instantiated at each switchblock location

Example:

image

Note that in this example we have 3 different switchblock locations and 3*50=150 sg patterns would be instantiated.

@github-actions github-actions bot added libarchfpga Library for handling FPGA Architecture descriptions lang-cpp C/C++ code labels Sep 8, 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.

Suggest doxygen comments right away ...

@vaughnbetz
Copy link
Contributor

Syntax of the interposer tag looks good. You'll need to add documentation for it. Make sure you explain that the offset etc. defines the start points of the sg_links (they always go towards the interposer, even if bidirectional).
Once this is done, we should make a new section in the architecture tutorial showing how to model a sample interposer device.

@github-actions github-actions bot added the docs Documentation label Sep 14, 2025
@AmirhosseinPoolad AmirhosseinPoolad changed the title [RFC] [WIP] Interposer tag Interposer tag Sep 14, 2025
@AmirhosseinPoolad
Copy link
Contributor Author

I think the code is ready for review now! @vaughnbetz @soheilshahrouz

.. arch:tag:: <interposer_cut dim=x|y loc="int"/>
:req_param dim: Dimension or axis of the cut. 'X' or 'x' means a horizontal cut while 'Y' or 'y' means a vertical cut.
:req_param loc: Location of the cut. Currently only absolute positions are supported.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be an equation, or does it have to be a number? Should say ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe that's what absolute positions means?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it was absolute versus relative [to device height/width] position, as in numbers only. Changed the comment to say "integer values" instead.

.. figure:: scatter_gather_images/interposer_diagram.png
An example of how specifying interposers in VTR works. Connections between the two sides of a cut are first severed. The two sides are then reconnected using scatter_gather patterns. Note that there are 'num' of each pattern at each switchblock locations.
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. I think the figure should show the die-crossing wires at each x location, since that's what would happen.
  2. On the figure or in the text, say the length of the sg_link wire in this case is 3.

Copy link
Contributor

Choose a reason for hiding this comment

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

I assume the interposer cuts all layers? Should say that too. Or say it only supports 1 layer architectures for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure about what happens with 3D architectures and interposers. The idea I had was that each layer could have it's own independent cut lines to keep everything flexible. This might make physical sense for a 2 layer face-to-face stacked chip, but I'm not sure about that either.

Right now the code does independent cut lines for each layer, but I could change it if you think it wouldn't make physical sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with that. I'd mention that somewhere in the docs, unless it is super-obvious from its position in the various tags.

*/
struct t_interposer_cut_inf {
e_interposer_cut_dim dim; ///< Dimension or axis of interposer cut
int loc; ///< Location of the cut on the grid
Copy link
Contributor

Choose a reason for hiding this comment

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

Give an example for this one. If the interposer cut is at y = 13, is the cut above or below the tiles with coordinate y = 13?

struct t_interdie_wire_inf {
std::string sg_name; ///< Name of the scatter-gather pattern to be used for the interdie connection
std::string sg_link; ///< Name of the scatter-gather link to be used for the interdie connection
int offset_start; ///< Starting point of scatter-gather instantiations
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can beef up these comments a bit. If the interposer cut is at y = 13, is an offset of 0 for an upward going sg_link a switch block / wire start point at y = 13? For a downward going wire with a cut at y = 13, is an offset of 0 a sg_link wire start point at y = 14?
Are the start and end points inclusive (I think they are, but you should say that).

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.

I suggest a few more commenting updates, and it would be good to get the grid_def data structure in the online documentation (maybe as another item in the grid tab).

Or, maybe we should put the architecture file capturing structs (grid_def and interposer) in a new Doxygen tab for architecture constructs?

* <-------------->
* repeatx
*
* startx/endx and endx/endy define a rectangular region instances dimensions.
Copy link
Contributor

Choose a reason for hiding this comment

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

instances -> instance's


std::string block_type; //The block type name

int priority = 0; //Priority of the specification.
Copy link
Contributor

Choose a reason for hiding this comment

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

Make these member comments Doxygen format

* and 'H' (device height). Formulas can be evaluated using parse_formula()
* from expr_eval.h.
*/
struct t_grid_loc_spec {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should build these into the grid part of the VPR API documentation on the web. You'd need to edit some doxyfile for that, and add an overview at the top of this struct saying this is used to capture the user's specification of the architecture will eventually be turned into a flattened grid.

// that come from a common definition.
};

enum class GridDefType {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add Doxygen comment.


struct t_layer_def {
std::vector<t_grid_loc_def> loc_defs; //The list of block location definitions for this layer specification
std::vector<t_grid_loc_def> loc_defs; ///< List of block location definitions for this layer specification
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to make an overall Doxygen comment for what this struct is intended for.

@github-actions github-actions bot added the VPR VPR FPGA Placement & Routing Tool label Sep 18, 2025
@AmirhosseinPoolad
Copy link
Contributor Author

Added the requested changes. For now, I added the doxygen documentation for the grid structs in the grid tab of VPR, but it might be useful to have a LibArchFPGA specific tab. Unfortunately much of LibArchFPGA is not Doxygen documented so it won't be much of a tab.

@soheilshahrouz
Copy link
Contributor

Is there a test for parsing this new tag?

@vaughnbetz
Copy link
Contributor

I like the idea of a libarchfpga tab, even if it is currently sparse. Could you add that?

@soheilshahrouz is also right that you should add a parsing test.

@AmirhosseinPoolad
Copy link
Contributor Author

Added a test and also a libarchfpga tab to docs. The added tab is pretty sparse at the moment, but I think fixing that would go beyond the scope of this PR.

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, but I have two minor nits about the high-level doxygen comments. If you fix those, it's good to merge.

Physical Types
========

These types are used to capture user's intended architecture specification and will be later turned into a flattened device grid according to the device's size.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment isn't right ; this goes with the grid defs, but not the physical 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.

I used the grid defs page as a template for the other pages and forgot to change this one's description. Fixed it now.

Scatter-Gather Types
========

These types store information about about scatter-gather patterns
Copy link
Contributor

Choose a reason for hiding this comment

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

about scatter-gather routing patterns (I'd add the word routing).

@vaughnbetz vaughnbetz merged commit 35542cd into master Sep 20, 2025
30 checks passed
@vaughnbetz vaughnbetz deleted the interposer_parsing branch September 20, 2025 01:51
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.

3 participants