Skip to content
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

Fixes issue when connecting passthru module ports #477

Merged
merged 5 commits into from
Jul 26, 2022

Conversation

clavin-xlnx
Copy link
Member

Also checks existing SiteInst placement to make sure not to overlap module instance placements.

…isting placement

Signed-off-by: Chris Lavin <clavin@xilinx.com>
@github-actions
Copy link

github-actions bot commented Jul 18, 2022

Unit Test Results

  33 files    33 suites   11m 19s ⏱️
532 tests 526 ✔️ 6 💤 0 ❌
534 runs  528 ✔️ 6 💤 0 ❌

Results for commit a9b2a40.

♻️ This comment has been updated with latest results.

Signed-off-by: Chris Lavin <clavin@xilinx.com>
src/com/xilinx/rapidwright/design/ModuleInst.java Outdated Show resolved Hide resolved
* @return True if placement was successful, false otherwise.
*/
public boolean place(Site newAnchorSite, boolean skipIncompatible){
public boolean place(Site newAnchorSite, boolean skipIncompatible, boolean allowOverlap){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be more descriptive to call the argument allowClobbering or allowOverwrite or simply force since it doesn't just overlap such that the module inst can still use the unused BELs -- the module inst's SiteInst appears to replace the existing SiteInst?

It's also not clear if that previous SiteInst will get unplaced correctly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Things are technically not lost and RapidWright still has tracking of each SiteInst location. This is how the block placer operates and can recover from placing a module instance on top of another, and then subsequently moving it elsewhere.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm. Let me wrap my head around that. Where is that overlapping placement tracked? If I asked the Design what SiteInst is located at a particular site, what answer would I get back just the last-placed SiteInst? If so, how would one get the ones "underneath" that one?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two stored locations. One global in Design, this would be the one "on top" and the other locally in the SiteInst itself. Clearly this is not a perfect system. When the block placer legalizes, that is when things are resolved. So, there is some intermediate situations where as you noted, if checking for placement on a Site that previously had two, but now has one SiteInst matching placement, it wouldn't be found globally, only locally. This issue doesn't manifest itself as when writing out a DCP, we iterate over SiteInst objects rather than the Design map.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you happen to know what holds a reference to the SiteInst that gets overwritten? I think it would be a good idea to document this behaviour. Historians from the future will thank you.

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two maps in the Design class that maintain the two different locations for placement. The user would see the discrepancy through the APIs Design.getSiteInstFromSite() vs Design.getSiteInsts(). Since each SiteInst keeps track of its own placement, getting a reference to the SiteInst and calling SiteInst.getSite() would be consistent in both the overlap/non-overlap case. However, the Design.getSiteInstFromSite() would not be consistent as this is a map from last placement on a particular site to its SiteInst and removing an overlap doesn't restore that map to the existing/prior placement.

@clavin-xlnx clavin-xlnx merged commit a9b2a40 into master Jul 26, 2022
@clavin-xlnx clavin-xlnx deleted the fix_modinst_connect branch July 26, 2022 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants