Skip to content

Added Optional Attribute to RRGraph #2378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Sep 12, 2023
Merged

Conversation

saaramahmoudi
Copy link
Contributor

Description

Using tileable option with openfpga branch, we have different ptc assignment in CHANX/CHANY nodes. To generate the same format rr graph while having tileable="true" and tileable="false", We added a new tag to tag while writing the rr graph.

The picture below shows the difference in ptc assignment in CHANX/CHANY nodes. The ptc number for each part of wire increase linearly with starting point ptc number (0) and a twist number (in this case would be 1)

image

So, the new generated rr graph looks like this:
<node dir="" id="" type="CHANX"><loc ptc="0" twist="1" layer="" xlow="" xhigh="" ylow="" yhigh">

To be backward compatible with previously generated rrgraphs for master branch (where the ptc number doesn't change across the CHANX/CHANY nodes), the twist attribute is not required value (it is optional).

Related Issue

@ganeshgore

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 the VPR VPR FPGA Placement & Routing Tool label Aug 30, 2023
@saaramahmoudi
Copy link
Contributor Author

@vaughnbetz

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 think you can store this more efficiently, since a tileable architecture is fundamentally a flyweight.
(x,y,layer) -> rr_tile_data
rr_tile_data stores the ptc_twist_incr for each ptc_num.

We can land this in the interim if you like, but we should explore this flyweight. It would allow efficient storage of additional openFPGA data, as well as saving storage for this entry.

@saaramahmoudi
Copy link
Contributor Author

@vaughnbetz all suggestions applied, ready to be merged.

@vaughnbetz
Copy link
Contributor

It looks like this new vector is always allocated, so we'll have a memory footprint increase.

  1. Please run a big titan circuit and document what the peak memory increase is (should be small I imagine but probably not negligible).
  2. I think there should be an issue to either
  • Not allocate this array when it is not needed or
  • (even better) store it more efficiently by "flyweighting" the data (storing the data per unique tile, instead of per rr-node).
    If 2 can be done quickly I'd do it now. If there is time pressure to get this in and it can't be done now, we should have an issue tracking the update to improve memory footprint.

@saaramahmoudi
Copy link
Contributor Author

@vaughnbetz

The vector is defined but won't be allocated unless the graph type is UNIDIR_TILEABLE (rr_graph.cpp line 1371). I just checked for the normal flow and the memory foot print is the same. I will attach the titan benchmark shortly.

I agree that we can move to fly-weighting at some point, but it can take time (I will create an issue for it to track it)

@vaughnbetz
Copy link
Contributor

OK. In that case I think it's important to check the storage is allocate before accessing a member -- see my comment above.

@vaughnbetz
Copy link
Contributor

Thanks for adding the check. This is good to merge once CI passes.

@rs-dhow
Copy link

rs-dhow commented Sep 6, 2023

Thanks for adding twist="#". Your picture at the start of this convo says 0,1,2,3,4, but your code comment says:
//For example, an L4 wire would change tracks 4 times with metal shorts [e.g. 0, 2, 4, 6] and track 6 would drive a switch -- together this implements an L4 wire with only one layout tile.
The latter is consistent with current twisted ptc numbers (for INC_DIR) so we're OK.

Since Mahdi's original change altered e.g.
node_lookup_.add_node(node, ix, iy, node_type, node_ptc_num, SIDES[0]);
to
node_lookup_.add_node(node, ix, iy, node_type, node_ptc_num + (i*twist), SIDES[0]);
I had assumed that (i) each coordinate already had a ptc number and (ii) we didn't need to save twist in the node.

I noticed the convo about "flyweight" attributes and saving memory. Since twist = (ptc of adjacent coordinate) - (ptc of xlow,ylow), there are reduction possibilities someday.

Thanks again.

@saaramahmoudi
Copy link
Contributor Author

@vaughnbetz updated with master branch, ready to merge

@vaughnbetz
Copy link
Contributor

Merging, but I think the long term solution should be to use a flyweight ... there is significant repeated data in this solution.

@vaughnbetz vaughnbetz merged commit 1871d53 into master Sep 12, 2023
@vaughnbetz vaughnbetz deleted the tileable_rr_graph_write branch September 12, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants