Skip to content

[Packer] Prepacker handling of pack pattern pins with net fanout > 1 #2996

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

Open
amin1377 opened this issue Apr 22, 2025 · 1 comment
Open

Comments

@amin1377
Copy link
Contributor

In the packer, molecules are formed first, followed by clusters. Molecules are created based on pack patterns defined in the architecture file. To form them, all possible molecule patterns are first extracted from the architecture and sorted in decreasing order of the number of blocks, so that larger pack patterns are attempted first.

Next, the atom netlist blocks are traversed to determine whether a pack pattern can be formed. When analyzing a candidate block, we check which blocks are connected to the pins involved in the pack pattern to decide if they can be included in the molecule. However, if the fanout of a net connected to a pack pattern pin is greater than one, the connected block is skipped.

This restriction exists to prevent issues in cases where a pack pattern includes a LUT and a register, and both the registered and unregistered outputs of the LUT are used. In architectures where only one of these outputs (registered or unregistered) can be routed to the LE output, forming such a molecule would result in a packing failure.

However, this restriction causes problems for patterns like carry chains. For example, in architectures where the COUT of a hard adder is both connected to the CIN of the next adder in the chain and to a separate block, the molecule is not formed. The packer sees that the COUT pin has multiple sinks and skips it.

To resolve this, PR #2991 adds a special case for chain patterns: when analyzing a chain pattern, we no longer discard blocks connected to nets with fanout greater than one.

To make the solution more general, we would need to analyze the architecture file before forming molecules, in order to determine whether multi-fanout nets should be considered for non-chain patterns, or, conversely, whether they should be excluded even for chain patterns.

@vaughnb-cerebras
Copy link

Totally agree!

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

No branches or pull requests

2 participants