Add support for external-FET SMPSs - #54
Open
cs42 wants to merge 1 commit into
Open
Conversation
Model HS/shunt/inductor cuts via PDN_ROLE=PATH and switch-leg stamps so VIN/VOUT stay separate rails; add ty to CI with scoped excludes instead of a repo-wide reformat. Co-authored-by: Cursor <cursoragent@cursor.com>
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
High-current SMPS designs often use a controller plus external FETs, a sense shunt, and an inductor. FYPA’s existing REGULATOR model assumes the current boundaries sit on the IC itself (internal FETs). If you instead annotate the power path as a plain
SERIESchain (VIN → HS → L → HS → VOUT) while both rails are voltage-forced, the solver effectively shorts the rails through RDSon — which is exactly wrong for IR / copper analysis where the interesting current is large.This PR extends the same
VoltageRegulatorMNA element so those stages work properly:PDN_ROLE=PATHon FETs / shunt / inductor (PDN_R+ optional pin filters).REGULATORhost:PDN_SMPS_TOPOLOGY,PDN_SW1_NET/PDN_SW2_NET, usualIN_*/OUT_*.PDN_SMPS_HOSTonly when ambiguous).k·i_vstamps (not SERIES to GND).BUCK/BOOST/BUCKBOOST, plusINVERTERfor multi-phase / motor-style drivers that share the same “don’t SERIES-star the bus” problem but are not a voltage step-up/down.So the feature is aimed at external-FET SMPS (especially high current), and as a side effect cleans up related external-FET architectures that previously needed weaker equivalents.
Docs: user guide § regulators (PATH / host vs part params) and README role table. Tests cover bind/cut, buck/boost coeffs, INVERTER, Kelvin shunt, ambiguous host, and internal-FET regression.
Test plan
uv run pytest tests/test_smps_external_path.py tests/test_regulator_direction.pyuv run ruff check .anduv run ty checkPATH+ hostSW1/SW2); confirm VIN and VOUT stay separate rails and path currents look plausibleINVERTERmulti-phase REGULATOR: DC bus and phase nets are not one SERIES mega-railPATHparts behaves as today’s internal-FET SMPS