Script started on Tue 25 Oct 2005 07:36:02 PM EDT bash-2.05b$ # (Comments like this one were added later, and start with #.) # I start off with just the inverter.mag file. # The "inv_example.log" file is actually this script file. bash-2.05b$ ls -l inv* -rw-r--r-- 1 cscmcw wheel 698 Oct 11 20:37 inverter.mag -rw-r--r-- 1 cscmcw wheel 0 Oct 25 19:32 inv_example.log # Now I run magic. I will erase the label I used for the input, # and re-name it "Va". bash-2.05b$ magic Magic 7.1 - Compiled on Wed Oct 5 17:55:16 EDT 2005. CAD_HOME sets "~cad" to "/opt/cad/magic-7.1". flock_list directory created. Error opening flock_list/link. Using technology "scmos", version 8.2.8. MOSIS Scalable CMOS Technology for Standard Rules Using TrueColor, VisualID 0x23 depth 24 Loading modules: [help] [box] [drc] [label] [draw] [stack] [prs] [gate] [sel] Use scm-help ? for help on some scheme functions :load inverter.mag :erase label :label Va Moving label "Va" from space to polysilicon in cell inverter.mag. :save :extract Extracting inverter into inverter.ext: :quit # Now I see that it created a .ext file. bash-2.05b$ ls -l inv* -rw-r--r-- 1 cscmcw wheel 755 Oct 25 19:34 inverter.ext -rw-r--r-- 1 cscmcw wheel 694 Oct 25 19:33 inverter.mag -rw-r--r-- 1 cscmcw wheel 1536 Oct 25 19:33 inv_example.log # Convert the .ext file to a .spice file. bash-2.05b$ ext2spice -f spice3 inverter CAD_HOME sets "~cad" to "/opt/cad/magic-7.1". Memory used: 130k # Now see that we have a .spice file now. bash-2.05b$ ls -l inv* -rw-r--r-- 1 cscmcw wheel 755 Oct 25 19:34 inverter.ext -rw-r--r-- 1 cscmcw wheel 694 Oct 25 19:33 inverter.mag -rw-r--r-- 1 cscmcw wheel 288 Oct 25 19:35 inverter.spice -rw-r--r-- 1 cscmcw wheel 2048 Oct 25 19:34 inv_example.log # Here's an example of a way to include comments within a log file. bash-2.05b$ echo Download inverter.cir from web Download inverter.cir from web bash-2.05b$ echo and edit it to work with my file. and edit it to work with my file. # The editing was done in a different window. bash-2.05b$ !ls ls -l inv* -rw-r--r-- 1 cscmcw wheel 1149 Oct 25 19:36 inverter.cir -rw-r--r-- 1 cscmcw wheel 755 Oct 25 19:34 inverter.ext -rw-r--r-- 1 cscmcw wheel 694 Oct 25 19:33 inverter.mag -rw-r--r-- 1 cscmcw wheel 288 Oct 25 19:35 inverter.spice -rw-r--r-- 1 cscmcw wheel 2560 Oct 25 19:35 inv_example.log # Now look at the inverter.cir info. # You'll notice that the file size is a bit different, as is the timestamp. bash-2.05b$ ls -l inv* -rw-r--r-- 1 cscmcw wheel 1147 Oct 25 19:37 inverter.cir -rw-r--r-- 1 cscmcw wheel 755 Oct 25 19:34 inverter.ext -rw-r--r-- 1 cscmcw wheel 694 Oct 25 19:33 inverter.mag -rw-r--r-- 1 cscmcw wheel 288 Oct 25 19:35 inverter.spice -rw-r--r-- 1 cscmcw wheel 3072 Oct 25 19:36 inv_example.log # Here is the final .cir file. Notice the "Va" line. bash-2.05b$ cat inverter.cir inverter test .include inverter.spice .MODEL nfet NMOS LEVEL=3 PHI=0.700000 TOX=3.0600E-08 XJ=0.200000U TPG=1 + VTO=0.5666 DELTA=8.7630E-01 LD=9.0910E-10 KP=7.7684E-05 + UO=688.4 THETA=1.1640E-01 RSH=1.0310E+01 GAMMA=0.5904 + NSUB=1.3370E+16 NFS=5.9090E+11 VMAX=1.9740E+05 ETA=9.3470E-02 + KAPPA=2.1020E-01 CGDO=5.0000E-11 CGSO=5.0000E-11 + CGBO=3.1008E-10 CJ=2.7477E-04 MJ=5.5020E-01 CJSW=1.9263E-10 + MJSW=1.0000E-01 PB=9.9000E-01 * .MODEL pfet PMOS LEVEL=3 PHI=0.700000 TOX=3.0600E-08 XJ=0.200000U TPG=-1 + VTO=-0.7996 DELTA=2.4370E+00 LD=1.1000E-09 KP=1.8891E-05 + UO=167.4 THETA=9.5600E-02 RSH=1.0210E+01 GAMMA=0.3265 + NSUB=4.0890E+15 NFS=7.1500E+11 VMAX=1.2590E+05 ETA=8.2820E-02 + KAPPA=5.5040E+00 CGDO=5.0000E-11 CGSO=5.0000E-11 + CGBO=3.2338E-10 CJ=2.8023E-04 MJ=4.6284E-01 CJSW=2.1036E-10 + MJSW=1.2846E-01 PB=9.0211E-01 * * supply voltages * Vgnd GND 0 dc 0 Vdd Vdd 0 dc 5 * * input voltage source: Va Va 0 PULSE(0 5 5n 1n 1n 10n ) * analyses request *.dc Vin 0 5 0.004 .tran 0.01n 40n *.tf v(out) Vin *.ac dec 10 10 1000meg * * options .options abstol=1uA vntol=1mV reltol=0.01 .PROBE .end # Now let's simulate this circuit with Spice. bash-2.05b$ spice3 Note: can't find init file. Program: Spice, version: 3f4 Date built: Sun Nov 18 23:28:11 BRST 2001 Spice 5 -> source inverter.cir Circuit: inverter test Spice 6 -> run Warning: va: no DC value, transient time 0 value used Spice 7 -> plot va Voutput Spice 8 -> quit Warning: the following plot hasn't been saved: tran1 inverter test, Transient Analysis Are you sure you want to quit (yes)? yes Spice-3f4 done bash-2.05b$ exit Script done on Tue 25 Oct 2005 07:49:04 PM EDT # The above "plot" command brought up a nice window, which showed the output # behave like I expected for the input. # You can capture this window with a graphics utility program like "xv". # The workstations have a program called "gimp" that also allow you to # grab the image and save it as file. You may need to do this to print it # out.