Emit decoupling metadata for tscircuit/checks - #2953
Open
0hmX wants to merge 8 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
0hmX
marked this pull request as ready for review
July 31, 2026 15:52
seveibar
reviewed
Jul 31, 2026
seveibar
left a comment
Contributor
There was a problem hiding this comment.
you should throw the warning in tscircuit/checks!
you may need to use tscircuit/core to add METADATA to the circuit json such that the warning can be thrown!
seveibar
reviewed
Jul 31, 2026
| ) { | ||
| sourcePortAttributes.should_have_decoupling_capacitor = true | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
can you move this stuff to capacitor
seveibar
reviewed
Jul 31, 2026
| sourcePortAttributes, | ||
| sourcePortLabels: port_hints, | ||
| parentNormalComponentName: parentNormalComponent?.config.componentName, | ||
| }) |
Contributor
There was a problem hiding this comment.
can it be moved to capacitor?
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a cross-package implementation of the chip-power-pin decoupling check:
@tscircuit/coredetermines each chip pin's decoupling requirement while rendering JSX and serializes that intent into Circuit JSON.@tscircuit/checksreads the serialized metadata, evaluates circuit connectivity, and emits the warning.This keeps component semantics in core and DRC warning ownership in checks.
End-to-end workflow
pinAttributesonto the generatedsource_port.should_have_decoupling_capacitorusing this precedence:shouldHaveDecouplingCapacitorvalue wins.providesPower: trueresolves tofalsebecause a power-source output should not require a local decoupling capacitor.requiresPowervalue resolves to the same boolean.true.{ "type": "source_port", "should_have_decoupling_capacitor": true, "recommended_decoupling_capacitor_capacitance": "100nF" }simple_chipport that requires decoupling, checks looks for a two-pinsimple_capacitorwith:source_pin_missing_trace_warning, including the recommended capacitance in the message when supplied.runAllNetlistChecks.False-positive behavior
shouldHaveDecouplingCapacitor: falseis preserved in Circuit JSON and suppresses the warning.providesPower: trueare serialized with the requirement set tofalse.requires_power === true && provides_power !== true.Cross-repository PRs
Both changes are required for the complete JSX → Circuit JSON → connectivity check → warning workflow.
Validation