sky130: use special_nfet_01v8 model for sub-0.42um nfets - #304
Open
ThVerg wants to merge 1 commit into
Open
Conversation
The sky130 magic techfile splits nfet extraction on device width: device msubcircuit sky130_fd_pr__nfet_01v8 nfet,scnfet ... w>=0.42 device msubcircuit sky130_fd_pr__special_nfet_01v8 scnfet ... w<0.42 ptx always emitted spice["nmos"], so every gate built from a minimum-width device (drc["minwidth_tx"] = 0.36) was netlisted as sky130_fd_pr__nfet_01v8 while magic extracted it as sky130_fd_pr__special_nfet_01v8. netgen then reported a device class mismatch in each such cell: Circuit 1: sky130_fd_pr__special_nfet_01v8 (1) | Circuit 2: (no matching element) Circuit 1: (no matching element) | Circuit 2: sky130_fd_pr__nfet_01v8 (1) The signed-off macros shipped in sky130A/libs.ref/sky130_sram_macros use special_nfet_01v8 at this geometry, so this restores the naming those were built with. ptx now asks the technology for a narrow-device model, keyed by width. Technologies that declare no such model are unaffected, and there is no equivalent split for pfets so only the nmos is declared. After this change pinv and pinv_dec report "Netlists match uniquely" where they previously mismatched. Verified with ngspice that special_nfet_01v8 resolves through sky130.lib.spice, so characterization is unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcKSuKSchDEd7MqT8AffpN
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.
Problem
On sky130, LVS reports a device class mismatch in every cell built from a minimum-width nfet:
The sky130 magic techfile selects the nfet device model by width:
ptxalways emitsspice["nmos"], and sky130 setsdrc["minwidth_tx"] = 0.360, so minimum-width devices are netlisted assky130_fd_pr__nfet_01v8while magic extracts them assky130_fd_pr__special_nfet_01v8. Wider devices (e.g.w=0.74u) are unaffected, which is why only some gates fail.The signed-off macros shipped in
sky130A/libs.ref/sky130_sram_macrosuse the special device at exactly this geometry:so this restores the naming those macros were built with.
Change
ptx.get_model_name()asks the technology for a narrow-device model keyed by width, and sky130 declares:Technologies that declare neither key keep the existing behaviour. There is no equivalent width split for pfets in the techfile, so only the nmos model is declared.
Verification
pinvandpinv_decgo fromNetlists do not matchtoNetlists match uniquelyon asky130_sram_1rw_tinybuild (magic 8.3.568, netgen 1.5.323, open_pdks f3b5e46).special_nfet_01v8resolves throughsky130.lib.spice; a 0.36/0.15 device biased at 1.8V simulates in ngspice (183uA), so characterization is unaffected.nmos_vtgunchanged and builds end to end.03_ptx_*_test.pyresults are unchanged (they fail identically with and without this patch in my environment, on klayout DRC setup).Scope
This fixes the device-class half of sky130 LVS only; it does not make LVS clean on its own. Two further mismatches remain, both outside the scope of this patch:
sky130_fd_bd_sramcells netlist their pull-ups assky130_fd_pr__special_pfet_pass, but that device does not exist in current open_pdks — magic extractssky130_fd_pr__special_pfet_latch(ppu). This looks like naming drift in the pinned cell library.pnand2extracts 7 nets against 6 in the netlist, which is a connectivity difference rather than a naming one.Happy to split those out separately if useful.