home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / education / n / spice / docs / FTE / LPR / SPICEINTRO < prev    next >
Encoding:
Text File  |  1988-01-27  |  5.2 KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                A Short Introduction to SPICE3
  11.  
  12.  
  13.                      Wayne Christopher
  14.  
  15.                          CAD Group
  16.                        U. C. Berkeley
  17.  
  18.  
  19.  
  20.  
  21.  
  22.      SPICE3 is an interactive  circuit  simulation  program.
  23. You  can  find  details  about preparing SPICE3 decks in the
  24. SPICE3 Users' Guide - this paper assumes that you are  fami-
  25. liar  with  SPICE2. If you are not familiar with nutmeg, you
  26. should read the nutmeg manual page or A  Short  Introduction
  27. to Nutmeg before reading further.
  28.  
  29.      To start SPICE3, you should type
  30.  
  31.      spice input_deck
  32.  
  33. Where input_deck is the name of the SPICE3 deck you want  to
  34. run.  Alternately, you can just type
  35.  
  36.      spice
  37.  
  38. In which case SPICE3 will just start up  without  loading  a
  39. circuit.
  40.  
  41.      Then, if you have any .ac, .dc, .tran, or .op cards  in
  42. the  deck  and  you  want to run them as given, you can just
  43. type
  44.  
  45.      run
  46.  
  47. SPICE3 will runs the requested analyses and will prompt  you
  48. again  when  it is done and the data is available to you. If
  49. you want to do an analysis that is not asked for by  a  line
  50. in  the  deck, you can type the line just as you would write
  51. it in the deck, without the dot.  For instance, the command
  52.  
  53.      ac lin 20 0.99 1.01
  54.  
  55. will do an ac analysis with 20 frequency values between 0.99
  56. and 1.01.
  57.  
  58.      After the analysis is  done  and  you  get  the  SPICE3
  59. prompt,  the  values of the nodes are available to you as if
  60. you had loaded them into nutmeg.  For  instance,  you  could
  61.  
  62.  
  63.  
  64.                       December 9, 1985
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                            - 2 -
  71.  
  72.  
  73. then give a command like
  74.  
  75.      plot v(4) v(5)
  76.  
  77.      If you want to save the values in a  rawfile,  you  can
  78. then type
  79.  
  80.      write filename FREQ v(4) v(5)
  81.  
  82. to put the values of FREQ, v(4),  and  v(5)  into  filename.
  83. Note  that  the  scale  for  the vectors (frequency or time)
  84. should always be written, and should be first. If  you  want
  85. to save everything, you can type
  86.  
  87.      write filename all
  88.  
  89.      All nutmeg commands are available in SPICE3 -  you  can
  90. use  display,  asciiplot, help, and so forth. There are also
  91. many commands for tracing the analysis - you can  print  the
  92. values at a node for each time point or cause SPICE3 to stop
  93. whenever a value gets to a certain  point.  Descriptions  of
  94. the  commands  stop,  trace,  and  step  can be found in the
  95. SPICE3 manual page.
  96.  
  97.      After you are done with the values you  have  obtained,
  98. you  can  change the circuit and re-run the analysis. If you
  99. want to edit the circuit itself, you  can  use  the  command
  100. edit  -  it will put you into vi and let you change the cir-
  101. cuit in whatever way you want, and then when you are done it
  102. will re-load the circuit and let you run it again.  Also you
  103. can give another ac, dc, tran, or op command after the first
  104. one  completes.  (If  the analysis is not finished, i.e. you
  105. typed an interrupt, or made it stop, then you will  have  to
  106. type reset before you can re-run it.)
  107.  
  108.      Each separate analysis that you do will create  one  or
  109. more  sets of values.  Such a set of values is called a plot
  110. - if you have done several analyses, and you want to  switch
  111. from  the results of one to the results of another, the set-
  112. plot command will tell you which ones are available and  let
  113. you choose one.
  114.  
  115.      Here is a sample SPICE3 run:
  116.  
  117.  
  118. % spice
  119.  
  120. spice 10 -> source xtal.in
  121.  
  122. Circuit: crystal filter
  123.  
  124. spice 11 -> listing
  125.  
  126.         (listing of the circuit is printed)
  127.  
  128.  
  129.  
  130.                       December 9, 1985
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                            - 3 -
  137.  
  138.  
  139. spice 12 -> run
  140. spice 15 -> display
  141. Here are the vectors currently active:
  142.  
  143. Title: crystal filter
  144. Plotname: AC analysis curves.
  145. Date: Thu Sep 26 12:16:34 PDT 1985
  146.  
  147.         FREQ                    : frequency (complex, 20 long) [scale]
  148.         V(4)                    : voltage (complex, 20 long)
  149.         V(6)                    : voltage (complex, 20 long)
  150.         V(5)                    : voltage (complex, 20 long)
  151.  
  152.                 (and so on...)
  153.  
  154. spice 16 -> plot v(4)
  155.  
  156.                 (plot takes place)
  157.  
  158. spice 17 -> write outfile FREQ v(4)
  159. spice 18 -> ac lin 30 1 2
  160. spice 19 -> display
  161. Here are the vectors currently active:
  162.  
  163. Title: crystal filter
  164. Plotname: AC analysis curves.
  165. Date: Thu Sep 26 12:16:34 PDT 1985
  166.  
  167.         FREQ                    : frequency (complex, 30 long) [scale]
  168.         V(4)                    : voltage (complex, 30 long)
  169.         V(6)                    : voltage (complex, 30 long)
  170.         V(5)                    : voltage (complex, 30 long)
  171.  
  172.                 (and so on...)
  173.  
  174. spice 20 -> asciiplot v(4) > tempfile
  175.  
  176.                 (ascii plot takes place)
  177.  
  178. spice 21 -> shell lpr tempfile
  179.  
  180.                 (a printout is made of the ascii plot)
  181.  
  182. spice 22 -> quit
  183. Warning: the following plot hasn't been saved:
  184.         crystal filter, AC analysis curves.
  185.  
  186. Are you sure you want to quit? y
  187. Ok, later days...
  188. %
  189.  
  190.  
  191.      Note that SPICE3 will warn you if you have work in pro-
  192. gress that you haven't saved and might not want to lose.
  193.  
  194.  
  195.  
  196.                       December 9, 1985
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                            - 4 -
  203.  
  204.  
  205.      Any problems with SPICE3 should be sent to:
  206. Tom Quarles (quarles@ucbcad.berkeley.edu)
  207. and
  208. Wayne Christopher (faustus@ucbcad.berkeley.edu).
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                       December 9, 1985
  263.  
  264.  
  265.