From b5cccf4f551647b54abcc924948d9545e153036a Mon Sep 17 00:00:00 2001 From: PhillipRambo Date: Tue, 10 Feb 2026 11:45:51 +0100 Subject: [PATCH] push new utils for kpex --- utils/PEX_Demo/pex/kpex.sh | 27 +++++++++++++++++ .../inverter__inverter/magic_RC/inverter.ext | 23 ++++++++++++++ .../magic_RC/inverter.res.ext | 1 + .../magic_RC/inverter_MAGIC_RC_Script.tcl | 25 ++++++++++++++++ .../magic_RC/inverter_MAGIC_report.rdb.gz | Bin 0 -> 642 bytes .../magic_RC/inverter.ext | 24 +++++++++++++++ .../magic_RC/inverter.res.ext | 28 ++++++++++++++++++ .../magic_RC/inverter_MAGIC_RC_Script.tcl | 25 ++++++++++++++++ .../magic_RC/inverter_MAGIC_report.rdb.gz | Bin 0 -> 1038 bytes 9 files changed, 153 insertions(+) create mode 100755 utils/PEX_Demo/pex/kpex.sh create mode 100644 utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.ext create mode 100644 utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.res.ext create mode 100644 utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter_MAGIC_RC_Script.tcl create mode 100644 utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter_MAGIC_report.rdb.gz create mode 100644 utils/PEX_Demo/pex/pex_output/inverter_flat__inverter/magic_RC/inverter.ext create mode 100644 utils/PEX_Demo/pex/pex_output/inverter_flat__inverter/magic_RC/inverter.res.ext create mode 100644 utils/PEX_Demo/pex/pex_output/inverter_flat__inverter/magic_RC/inverter_MAGIC_RC_Script.tcl create mode 100644 utils/PEX_Demo/pex/pex_output/inverter_flat__inverter/magic_RC/inverter_MAGIC_report.rdb.gz diff --git a/utils/PEX_Demo/pex/kpex.sh b/utils/PEX_Demo/pex/kpex.sh new file mode 100755 index 00000000..c332b811 --- /dev/null +++ b/utils/PEX_Demo/pex/kpex.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +# Hardcoded paths (except PDK stuff) + +LAYOUT_PATH="../layout/inverter.gds" +SCHEMATIC="../simulations/inverter.spice" + + +PDK_NAME="ihp_sg13g2" +MAGICRC="$PDK_ROOT/$PDK/libs.tech/magic/ihp-sg13g2.magicrc" # The magicrc file for your PDK, used during extraction + + +# Run parasitic extraction with kpex +kpex \ + --pdk "$PDK_NAME" \ + --magic \ + --schematic "$SCHEMATIC" \ + --gds "$LAYOUT_PATH" \ + --magicrc "$MAGICRC" \ + --magic_mode RC \ + --magic_cthresh 0.02 \ + --magic_rthresh 50 \ + --magic_short resistor \ + --magic_merge conservative \ + --out_dir ./pex_output + diff --git a/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.ext b/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.ext new file mode 100644 index 00000000..85ef5539 --- /dev/null +++ b/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.ext @@ -0,0 +1,23 @@ +timestamp 0 +version 8.3 +tech ihp-sg13g2 +style ngspice() +scale 1000 1 0.5 +resistclasses 3000000 67000 110 88 88 88 88 18 11 +parameters sg13_lv_nmos l=l w=w a1=as p1=ps a2=ad p2=pd +parameters sg13_lv_pmos l=l w=w a1=as p1=ps a2=ad p2=pd +port "Vout" 2 266 -211 298 -173 m1 +port "Vin" 3 95 -213 127 -175 m1 +port "Vdd" 5 -205 318 -173 356 m1 +port "Gnd" 4 20 -732 52 -694 m1 +node "ptap1_0.sub!" 0 0 28 -796 isosub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +node "Vout" 1 392.446 266 -211 m1 0 0 0 0 91916 2354 0 0 0 0 0 0 0 0 0 0 0 0 +node "Vin" 0 646.659 95 -213 m1 0 0 0 0 13590 482 0 0 0 0 0 0 0 0 0 0 0 0 +node "Vdd" 1 153.076 -205 318 m1 0 0 0 0 42800 1364 0 0 0 0 0 0 0 0 0 0 0 0 +equiv "Vdd" "ntap1_0.well" +substrate "Gnd" 0 0 20 -732 m1 0 0 0 0 21536 1036 0 0 0 0 0 0 0 0 0 0 0 0 +cap "Vout" "Vdd" 131.55 +cap "Vout" "Vin" 100.772 +cap "Vin" "Vdd" 144.819 +device msubckt sg13_lv_nmos 67 -562 68 -561 l=90 w=200 "Gnd" "Vin" 180 0 "Gnd" 200 13600,536 "Vout" 200 13600,536 +device msubckt sg13_lv_pmos 67 9 68 10 l=90 w=400 "Vdd" "Vin" 180 0 "Vdd" 400 27200,936 "Vout" 400 27200,936 diff --git a/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.res.ext b/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.res.ext new file mode 100644 index 00000000..086c80d3 --- /dev/null +++ b/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.res.ext @@ -0,0 +1 @@ +scale 1000 1 0.5 diff --git a/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter_MAGIC_RC_Script.tcl b/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter_MAGIC_RC_Script.tcl new file mode 100644 index 00000000..54be41a3 --- /dev/null +++ b/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter_MAGIC_RC_Script.tcl @@ -0,0 +1,25 @@ +# Generated by kpex 0.3.6 +crashbackups stop +drc off +gds read /home/pedersen/projects/IHP-AnalogAcademy/utils/PEX_Demo/layout/inverter.gds +load inverter +select top cell +flatten inverter_flat +load inverter_flat +cellname delete inverter -noprompt +cellname rename inverter_flat inverter +select top cell +extract path /home/pedersen/projects/IHP-AnalogAcademy/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC +extract all +ext2sim labels on +ext2sim +extresist tolerance 1 +extresist all +ext2spice short resistor +ext2spice merge conservative +ext2spice cthresh 0.02 +ext2spice extresist on +ext2spice subcircuits top on +ext2spice format ngspice +ext2spice -p /home/pedersen/projects/IHP-AnalogAcademy/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC -o /home/pedersen/projects/IHP-AnalogAcademy/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter.pex.spice +quit -noprompt diff --git a/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter_MAGIC_report.rdb.gz b/utils/PEX_Demo/pex/pex_output/inverter__inverter/magic_RC/inverter_MAGIC_report.rdb.gz new file mode 100644 index 0000000000000000000000000000000000000000..01007d71b67def30607f2dcacdad62f88532f837 GIT binary patch literal 642 zcmV-|0)71-iwFP!000001JzeckDD+Uyzj3-xnwJaS9l~TgjLm6s~)zhs;bwO7aU~O z*a#f7{QKJGk>JpW(xu6sn9nvd_F#ETc=w!Pt%5~~DA~?z!|#s z(M?#uoEA(^00U2;gwc%_Ca{bPlr#RKDQa4v6cK>+9l}tyq>#V@Fj~lp(Oi!q#!Ugz zQasHL#DKw+Q$SJmWi1LVBp`#)!@K)W@3oK5tN^hP4NciB2PkvVR6dol7Hq~nf+!!I!-%E%qLYSd`6Rid{5|;}@~4B;A>*6vGv)Jm z$<21%%l!Z=6u<0(ztuV1X661V{=u{dZYSQBsqH-C>XBr$ywI-u&8+gtXLat^`3g%^ z@}pThcUS(a@Fbe*fI+v?8HzA!(}ts?q(OuSB7?o_d1LM2yA zq8-2`49%{Tec2u}lw%YlR!4Sd4(f)MW*O{VKp9B8^;ZDz`;Q`vD5tniDS4~i+J@sS zbbh(;yr99BvGxUaH$yDP@B^)3Xq-Gyhi2#0`IfZ-dF75-hP!g59o(9>;6ANH;X9sE z$YGPZ*5>+^yC#fSdJEg|HbIY9>!8_U3idWrI@V?Ll{;n`_Cj|I-w#^kt~gry3iSO+ zypq}TdcE>pftD(q#;f)^Wz7F@3A%a{9dTkUjkO&duqBQ%$34OJ#jMO4G9@kbgd!gwI8^8WVl-ptSAnfJzVFYW?gTH-h% zQ8;KJMQuqq97hup&IYYTI_=o4i{T45#`7pnI}L?~N z5_*1TN_@<&%y5WfFO6cR(rDfpW8de(nD^r#dt(~Z?Xt_PL7^{F(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