Skip to content

CFDFC duplication for select units - #1144

Merged
herzamos merged 7 commits into
mainfrom
amos/select-duplication
Nov 13, 2026
Merged

herzamos merged 7 commits into
mainfrom
amos/select-duplication

Conversation

@herzamos

@herzamos herzamos commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

In FPGA20, section 4.4, when discussing select units it was mentioned that

It is interesting to note that the same effect could be achieved by handling the choices of the Select unit similar to the choices in the CFG graph—that is, by decoupling a CFDFC with a Select unit into two choice-free graphs (with each graph considering only one of the Select inputs).

The current implementation, simply assumes that the true input is the least executed one and ignores the false one.

if (channel == selOp.getFalseValue())

In this version, we create an additional CFDFC for each one that contains a select unit. We set the numbe rof executions of the "original" CFDFC to 0, such that it has no impact on the objective

double coef = (cfdfc->channels.size() * cfdfc->numExecs) / fTotalExecs;

This way we still get timing constraint sfor each channel, but avoid influencing the buffer placement. In the other CFDFC, we "remove" one of the two channels. Currently, we still delete the false input, assuming it is always the least executed one.

Next, it would probably be a good idea to get actual data on which branch is executed more, such that we can prioritize the most executed branch. Alternatively, we could follow the approach outlined in FPGA20

(1) we include into the throughput constraints each Select input channel
that is on a noncyclic path, as this latency will never compromise throughput; (2) if the Select has
a single input on a cyclic path, we exclude the corresponding input channel from the throughput
constraints; and (3) if the Select has both inputs on cyclic paths, we exclude the input channel
on the cycle with more sequential stages.

Fixes #1018

@herzamos

Copy link
Copy Markdown
Collaborator Author

This at the moment solves #1018, since we now have constraints for every single edge there is no deadlock anymore

@herzamos

Copy link
Copy Markdown
Collaborator Author

New approach:
Split every CFDFC containing one or more Select units in 2:

  • One CFDFC treats all select units as 3-inputs joins, and has its scaling factor in the total TP cost function hardcoded to 0. This CFDFC allows us to still get retiming constraints and avoid deadlocks (like 1018 mentioned here above), while having no impact in buffers placement.
  • The other CFDFC, similar to the legacy implementation, ignores the least executed input branch.

Comment thread .gitignore Resolved
@herzamos
herzamos force-pushed the amos/select-duplication branch from 2205845 to c997f76 Compare November 12, 2026 00:21
@Jiahui17
Jiahui17 marked this pull request as ready for review November 12, 2026 13:52
@Jiahui17

Copy link
Copy Markdown
Member

Also, if you add "fixes #1018", github will automatically link this pull request to the issue

when this PR gets merged, GH will close the issue as completed

@herzamos
herzamos force-pushed the amos/select-duplication branch from e8e5a1e to a1ade9c Compare November 13, 2026 12:31
@herzamos herzamos changed the title CFDFC extraction for select units CFDFC duplication for select units Nov 13, 2026
@herzamos
herzamos merged commit ed43dc3 into main Nov 13, 2026
9 checks passed
@herzamos
herzamos deleted the amos/select-duplication branch November 13, 2026 13:42
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.

[Buffers] Missing token retiming constraint for SelectOp causes deadlock

2 participants