Skip to content

Interface for determining package pins - #38

Draft
robtaylor wants to merge 7 commits into
mainfrom
packagepins
Draft

Interface for determining package pins#38
robtaylor wants to merge 7 commits into
mainfrom
packagepins

Conversation

@robtaylor

@robtaylorrobtaylor commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

Package Pin Interface

This PR implements a structured interface for determining package pins in ChipFlow.

Key Changes

  1. Added abstract methods to define standard pin types in package definitions:

    • Power and ground pins
    • Clock pins
    • Reset pins
    • JTAG pins
    • Heartbeat pins
  2. Implemented these methods in both package types:

    • BareDiePackageDef
    • QuadPackageDef
  3. Enhanced the Package class to:

    • Support new pin types
    • Initialize pins from package definitions
    • Support both legacy and new pin formats
  4. Added comprehensive tests in test_package_pins.py

  5. Created documentation in docs/package_pins.md

Backward Compatibility

The implementation maintains backward compatibility with the existing TOML configuration format while introducing a new, more flexible format.

Ready for Review

All tests are passing, and the implementation is ready for review.

@github-actions

github-actionsBot commented Feb 12, 2025

Copy link
Copy Markdown
PR Preview Action v1.6.2

🚀 View preview at
https://chipflow-lib.docs.chipflow-infra.com/pr-preview/pr-38/

Built to branch gh-pages at 2025-07-07 11:00 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment threadchipflow_lib/platforms/utils.py Outdated
Comment threadchipflow_lib/platforms/utils.py Outdated

@property
@abc.abstractmethod
def heartbeat(self) -> Dict(int, Pin):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The clock in some cases comes as two pins close to each other to be connected to XTAL.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

hmm, good point. Is that a config option to generate a oscillator?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Currently we have nothing to specify use of XTAL, this needs to be added somehow.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The clock in some cases comes as two pins close to each other to be connected to XTAL.

If you have external crystal you will need a crystal oscillator analog block on the chip. The actual clock will then be an output of this oscillator.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What also can happen is that clock is delivered as differential signal; but this can also be for digital signals. Likely only to add when use case is there.

@robtaylorrobtaylor linked an issue Feb 14, 2025 that may be closed by this pull request
@robtaylor
robtaylor marked this pull request as ready for review March 18, 2025 13:28
@robtaylor

Copy link
Copy Markdown
ContributorAuthor

I've updated this PR to implement a complete interface for package pins as discussed.

Key enhancements:

  1. Implemented all abstract methods in both package types with sensible defaults
  2. Added support for new power pin format while maintaining backward compatibility
  3. Created comprehensive tests with 76% code coverage
  4. Added documentation explaining the new interface

All tests are passing. Ready for review!

@github-actions

github-actionsBot commented May 1, 2025

Copy link
Copy Markdown
TestsSkippedFailuresErrorsTime
90 💤0 ❌9 🔥4.118s ⏱️

@gatecatgatecat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Haven't looked through the tests yet, but these are my comments so far

Comment threadchipflow_lib/config_models.py Outdated
Comment threadchipflow_lib/config_models.py Outdated
Comment threadchipflow_lib/pin_lock.py Outdated
Comment threadchipflow_lib/platforms/utils.py Outdated
core_jtag: JTAGPins

def to_set(self) -> Set[Pin]:
return {p for pp in self.core_power for p in asdict(pp).values()} | \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is the asdict doing here?

Comment threadchipflow_lib/platforms/utils.py Outdated
Comment threadchipflow_lib/platforms/utils.py Outdated
Comment threadchipflow_lib/platforms/utils.py Outdated
ret = []
for q in range(0,3):
ret.append(sorted(quadrants[q]))
return ret

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's worth noting that this won't give pins in bonding pad order which might be relevant in some cases - this can only be determined on a pattern-by-package (or by custom design in the case of a substrate or RDL for a WLCSP package).

An example for the PGA144 we used for the previous tapeout is the table on page 3 of https://europractice-ic.com/wp-content/uploads/2019/06/CD_PGA144.pdf but this is always going to differ

Comment threadchipflow_lib/platforms/utils.py Outdated
Comment threaddocs/chipflow-toml-guide.rst Outdated
Comment threaddocs/chipflow-toml-guide.rst Outdated
@robtaylor
robtaylorforce-pushed the packagepins branch 9 times, most recently from 7d71c83 to 5fc63cfCompareJuly 2, 2025 10:06
@robtaylor
robtaylorforce-pushed the packagepins branch 3 times, most recently from 3ec99b5 to 203e0d6CompareJuly 2, 2025 12:08
@robtaylor
robtaylor changed the base branch from main to sim-commonJuly 2, 2025 15:10
@robtaylor
robtaylorforce-pushed the packagepins branch 2 times, most recently from 2ceb202 to d63aa26CompareJuly 3, 2025 10:40
Base automatically changed from sim-common to mainJuly 11, 2025 17:20
@robtaylor
robtaylor marked this pull request as draft July 12, 2025 15:31
@robtaylor

Copy link
Copy Markdown
ContributorAuthor

Has some WIP for better pin allocation.

This should become shell and padring aware

@robtaylor

Copy link
Copy Markdown
ContributorAuthor

This is massively outdated, but keeping it around as there were some good ideas that need extracting

Sign up for freeto 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.

Add power, clock, jtag and heartbeat pins to package definitions

4 participants

@robtaylor@lanserge@gatecat@stafverhaegen-chipflow