From ddf8336bdbdbfa39b6047258ae5426207930d02c Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 28 Feb 2021 19:57:23 +0100 Subject: [PATCH] examples for creating svg output and plotting --- examples/svg/nmos_out_BSIM330_svg.sp | 76 ++++++++++++++++++++++++ examples/svg/nmos_out_BSIM330_various.sp | 74 +++++++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 examples/svg/nmos_out_BSIM330_svg.sp create mode 100644 examples/svg/nmos_out_BSIM330_various.sp diff --git a/examples/svg/nmos_out_BSIM330_svg.sp b/examples/svg/nmos_out_BSIM330_svg.sp new file mode 100644 index 000000000..e75315481 --- /dev/null +++ b/examples/svg/nmos_out_BSIM330_svg.sp @@ -0,0 +1,76 @@ +***** NMOS Transistor BSIM3 (Id-Vds) with Rd *** + +M1 2 1 3 4 n1 W=1u L=0.35u Pd=1.5u Ps=1.5u ad=1.5p as=1.5p +vgs 1 0 3.5 +vds 2 0 0.1 +vss 3 0 0 +vbs 4 0 0 + +* drain series resistor +R2 2 22 1k +M2 22 1 32 4 n1 W=1u L=0.35u Pd=1.5u Ps=1.5u ad=1.5p as=1.5p +vss2 32 0 0 + + +.options Temp=27.0 + +* BSIM3v3.3.0 model with modified default parameters 0.18µm +.model n1 nmos level=49 version=3.3.0 tox=3.5n nch=2.4e17 nsub=5e16 vth0=0.15 +.model p1 pmos level=49 version=3.3.0 tox=3.5n nch=2.5e17 nsub=5e16 vth0=-0.15 + +.control +* sim +dc vds 0 2 0.05 vgs 0 2 0.4 + +* plot +set xgridwidth=2 +set xbrushwidth=3 + +set nolegend + +* the default settings +* "svgwidth", "svgheight", "svgfont-size", "svgfont-width", "svguse-color", "svgstroke-width", "svggrid-width", +set svg_intopts = ( 1024, 768, 16, 0, 1, 2, 0 ) +* "svgbackground", "svgfont-family", "svgfont" +set svg_stropts= ( ) + +*** svg *** +set hcopydevtype = svg +set color0=white +set color1=blue +set color2=green +hardcopy plot_4.svg vss#branch title 'Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' + +set svg_intopts = ( 512, 384, 16, 0, 1, 2, 0 ) + +set color0=blue +set color1=white +set color2=red +hardcopy plot_5.svg vss#branch title 'Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' + +set svg_intopts = ( 512, 384, 16, 0, 0, 2, 2 ) + +set color0=black +set color1=yellow +set color2=white +hardcopy plot_6.svg vss#branch title 'Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' + +* for MS Windows only +if $oscompiled = 1 | $oscompiled = 8 + shell Start plot_4.svg + shell Start plot_5.svg + shell Start plot_6.svg +else +* for CYGWIN + shell xterm -e gs plot_4.svg & + shell xterm -e gs plot_5.svg & + shell xterm -e gs plot_6.svg & +end +.endc + +.end + + + + + diff --git a/examples/svg/nmos_out_BSIM330_various.sp b/examples/svg/nmos_out_BSIM330_various.sp new file mode 100644 index 000000000..a631265d0 --- /dev/null +++ b/examples/svg/nmos_out_BSIM330_various.sp @@ -0,0 +1,74 @@ +***** NMOS Transistor BSIM3 (Id-Vds) with Rd *** + +M1 2 1 3 4 n1 W=1u L=0.35u Pd=1.5u Ps=1.5u ad=1.5p as=1.5p +vgs 1 0 3.5 +vds 2 0 0.1 +vss 3 0 0 +vbs 4 0 0 + +* drain series resistor +R2 2 22 1k +M2 22 1 32 4 n1 W=1u L=0.35u Pd=1.5u Ps=1.5u ad=1.5p as=1.5p +vss2 32 0 0 + + +.options Temp=27.0 + +* BSIM3v3.3.0 model with modified default parameters 0.18µm +.model n1 nmos level=49 version=3.3.0 tox=3.5n nch=2.4e17 nsub=5e16 vth0=0.15 +.model p1 pmos level=49 version=3.3.0 tox=3.5n nch=2.5e17 nsub=5e16 vth0=-0.15 + +.control +* sim +dc vds 0 2 0.05 vgs 0 2 0.4 + +* plot +set xgridwidth=2 +set xbrushwidth=3 + +set nolegend +plot vss#branch title 'Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' +unset nolegend +set color0=white +plot vss2#branch vs v(22) title 'Series resistor: Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' + +*** postscript *** +set hcopydevtype = postscript +set hcopypscolor=0 ; background black +hardcopy plot_4.ps vss#branch title 'Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' +set hcopypscolor=1 ; background white +hardcopy plot_5.ps vss#branch title 'Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' +* for MS Windows only +if $oscompiled = 1 | $oscompiled = 8 + shell Start /B plot_4.ps + shell Start /B plot_5.ps +* for CYGWIN +else + shell xterm -e gs plot_5.ps & +end + +*** svg *** +set hcopydevtype = svg +*set color0=white +set color1=blue +hardcopy plot_4.svg vss#branch title 'Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' +*set color0=black +set color1=orange +hardcopy plot_5.svg vss#branch title 'Drain current versus drain voltage' xlabel 'Drain voltage' ylabel 'Drain current' +* for MS Windows only +if $oscompiled = 1 | $oscompiled = 8 + shell Start /B plot_4.svg + shell Start /B plot_5.svg +* shell Start /B plot_6.svg +* for CYGWIN +else + shell xterm -e gs plot_5.svg & +end +.endc + +.end + + + + +