Conversation
rohanku
commented
Sep 25, 2026
Contributor
- fix(sky130): preserve MOS parameters that Substrate does not model
- fix(spectre): escape signal names in save and ic statements
`convert_spice_mos` built a `MosParams` from `w`, `l` and `nf * m * mult` and dropped every other parameter, so importing a SPICE netlist through the `Sky130` schema silently lost information: * Junction areas and perimeters (`ad`, `as`, `pd`, `ps`) were discarded. The SKY130 models default these to zero, so a round trip removed all source/drain junction capacitance. For the foundry SRAM bitcell this cut the capacitance a 64-row column presents to a bit line from 7.30 fF to 2.83 fF, making read timing optimistic by 60%. * Stress parameters (`sa`, `sb`, `sd`) and resistances (`nrd`, `nrs`) were discarded. * `m` and `mult` were folded into `nf`. The models treat all three differently -- `nf` is a finger count that divides the supplied width, `m` is an instance multiplier, and `mult` only appears in the mismatch-slope expressions -- so collapsing them changes the device. `Primitive::Mos` now carries an `extra` map of the parameters Substrate does not model, populated on import and merged back in on export. `nf` is taken from the `nf` parameter alone. Where a schema derives a key that can also appear in `extra` -- `mult` for SRC NDA, `m` and `mult` for CDS -- the two are multiplied, since both are device multipliers. MOSFETs that Substrate generates itself carry an empty `extra` and are unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`save` and `ic` wrote the name of a `SimSignal::Raw` verbatim. Spectre only accepts `[`, `]` and `#` in an identifier when they are escaped, so saving a bus bit or a node imported from layout -- `din[0]`, or `...Xdff_6.a_1800_291#` -- made Spectre reject the netlist during circuit read-in rather than run. `Spectre::escape_path` escapes those characters while preserving what gives a path its meaning: `.` between hierarchy elements, `:` before a terminal, and the `*`/`?` wildcards that `save` accepts. It is applied through a new `SimSignal::to_netlist_string`, so only the two netlisting call sites change; result lookup still uses the unescaped name, which is what Spectre reports back. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.