How To Get Started
Installation
The following installation procedure assumes that you have a vanilla Mesa 6 Alto partition with a reasonable amount of disk space available. The additional files beyond those which are left on a newly erased disk which you must have include RunMesa.run and Mesa.image. It is also a good idea to have XDebug.image on your disk and have the debugger installed so that if you run into problems the Thyme maintenance people have some hope of helping you. In Palo Alto the local directory which contains these files is [Ivy]<Mesa>.
To install Thyme on your machine retrieve [Cherry]<Thyme>Top>ThymeGet.cm and invoke it as a command file by typing @ThymeGet to the Alto Executive. This will retrieve the following files:
ThymeForm.thy A working input file to start editing with.
Extract.chipbcd A version of the extractor that is compatible with the current Thyme.
Thyme.bcd The simulator itself.
Thyme.errors Contains the text of the error messages Thyme generates .
ThymeBasics.thy Links the simulator to the model and function definitions.
MosModels.thybcd Contains the transistor model code.
StdFunctions.thybcd Contains the waveform generation code.
PlotPress.bcd Converts the .plot files generated by Thyme into .press files suitable for tranmission to Lilac.
PlotScreen.bcd Replots the first page of a .plot file on the screen.
Helvetica8.ks Font used to print characters on the plot.
If you start up Thyme and it simply hangs there with a cursor that is a circle with an arrow in it then you are probably missing the font file. The plotting software is starting at Helvetica8.ks, looking it up in the file directory, discovering it is not there, changing the font filename to Helvetica9.ks, looking for it, not finding it, etc. etc. until the string overflows or your patience runs out, whichever occurs first.
You must also retrieve the correct process definition file for the type of simulation you intend to do. These files are stored in the subdirectory [Cherry]<Thyme>ProcessDefs>. The filename depends on the type of process you are using, the minimum feature size in microns, and the temperature at which you intend to do your simulation.
See the section about circuit design pragmatics later in this document for a detailed discussion of how to choose the correct temperature. If you are learning how to do circuit simulation and know the process type and minimum feature size just use the highest temperature data available for your simulations rather than plunging off into a morass of detail that need not concern you right now. For example if you are using an NMOS process with a 4m feature size then you should retrieve the file [Cherry]<Thyme>ProcessDefs>NMos4.0u75.thy.
Note that the character in the filename is a "u" not a "m".
Process definition filenames have the form <process type>|<feature size>|<temperature>.thy.
Preparing Input
Thyme input may be generated in two ways. One is to sit down with your favorite text editor and type it in. The other is to lay out your circuit using Chipmonk and then apply the circuit extractor to your layout. In this section we will assume that you are doing the former, how to make Thyme work in the latter case we will handle subsequently. This section is an overview. As such much of the detail has been suppressed. Don't treat it as the gospel truth. That's saved for later.
The basic format of a Thyme file is:
library statements
circuit definition
output control
run control
and here is an example of one:
1 library[MosModels];
2 library[StdFunctions];
3 circuit={
4 !ThymeBasics.thy
5 !Nmos4.0u75.thy
6 in:node; out:node; Vdd:node;
7 powerSupply: voltage[Vdd, Gnd]= 5.0;
8 ?:capacitor[out,Gnd] = 0.01pF;
9 ?:Dep[out,out,Vdd | L ← 4, W ← 2];
10 ?:Enh[in,Gnd,out];
11 ?:RectWave[in|period← 4us, width ← 2us, tRise ← 0.1us, tFall ← 0.1us, tDelay ← 2us];
12 };
13 plot["Nmos Inverter (4 micron, 75 C)", :0.1us, -1, 6, in, out];
14 run[TMAX ← 10us];
Note that the line numbers appear here purely for expository purposes and are referred to below in parantheses.
The library statements (1-2) cause Thyme to load the model and function code. These statements must always appear and it is unlikely you will ever want to change them. If you think you do details are available further on in this document.
The circuit definition part (3-12) contains two references to other files which are to be included as if their contents were present in this file. The first one (4) defines the interface for the model code which was loaded in the library statements and the second one (5) tells the model code which particular process you are using. Again these statements always appear and it is unlikely you will change them except for the choice of the second filename. The rest of the circuit definition part (6-12) defines a simple inverter circuit that has a rectangular wave as input and a single capacitor as the output load.
All the statements defining the circuit have the form name:type;, where a name is an alpha followed by a sequence of alphnumerics and type is a name previously defined or a built in type. If you don't care to give a name to a particular instance then you may put a "?" in place of the name, Thyme will generate a name for you. If you want to use funny kinds of names that include characters such as ";" then you must surround the name with "$". A type must be defined before it is used; otherwise order does not matter.
A circuit is a collection of nodes, branches, and subcircuit instantiations. First the nodes are defined (6) and then the branches (7-8) and subcircuits (9-11) are instantiated using the nodes previously defined. Node definitions have the form:
<node names>: node
There is one predefined node, Gnd, the ground node. All voltages are referenced to it. Branch instantiations have the form:
<name>: <branch type>[<node name>, <node name>] = <expression>
Branches may be one of the following built in types: RESISTOR, CAPACITOR, INDUCTOR, VOLTAGE, and CURRENT. Each of these expects a numeric value to be following the "=" in units of volts, amps, ohms, farads, or henries. The left node name of a branch is considered to be the positive terminal of the branch.
All numbers read by Thyme are real although fixed point representations will be accepted and converted. Thyme has a primitive understanding of units of measurement. A unit may be specified with any number; it must immediately follow the number with no intervening spaces. Acceptable units are "A," "F," "H," "s," and "V," for amperes, farads, henries, seconds, and volts. Scaling factors may be prefixed onto a unit; the available ones are "M," "K" or "k," "m," "u," "n," and "p," which stand for mega-, kilo-, milli-, micro-, nano-, and pico- respectively, e.g. pF (8) stands for picofarads.
A subcircuit is another collection of nodes, branches and subcircuit instantiations. For the simple circuit we are dealing with here we do not need to know how to define our own subcircuits but we do need to know how to instantiate subcircuits since that is how transistors are implemented. Subcircuit instantiations have the form:
<name>: <circuit name>[<node names>|<actual paramter list>]
The circuits being instantiated here are a depletion transistor (9), an enhancement transistor (10), and a rectangular waveform generator (11). Transistors have their nodes in the order gate, source, drain. The actual parameters for a transistor are "L" and "W" which define the channel length and width respectively.
The plot statment (13) is the output control part of the input file. It tells Thyme to label a plot with "Nmos Inverter (4 micron, 75 C)", scale the x axis so that a one on the axis is equal to 0.1 microsecond, set the y axis min to -1 volt and max to 6 volts, and finally to plot the voltage on nodes "in" and "out".
The run statement (14) is the run control part of the input file. It causes Thyme to actually begin simulation, starting at time=0 and continuing until time is greater than or equal to TMAX, here ten microseconds.
Running It
Assume that you have prepared your input file as described in the previous section and that you have called it "Foo.thy". This section describes how to run Thyme, control it during execution and print your results.
The format of the command line to start Thyme looks like:
Thyme <file name>.<extension> <switches>
Currently the <switches> field, which is optional, may only be /c, which is the default and causes the color display to be used, or /-c to indicate that no color display is available. If you wish Thyme to read its input from "Foo.thy" then "Foo" for <file name>.<extension> is sufficient. If you have a file named "Foo.baz" where "baz" is not "thy" then the <extension> must be explicitly stated. If you do not specify a file name on the command line or if Thyme cannot find the file it will prompt you for a file name.
After Thyme has successfully opened the input file it will echo the input to the display as it is read while displaying the word "Thyme" in the cursor. If no error is detected during input then Thyme sets the cursor to a bomb and flattens the circuit so that each component is instantiated. Then the cursor changes to an exploded bomb and a few legality checks are performed on the exploded circuit. Finally the cursor will be set to a clock with one hand and the simulation will begin. Each time the solution of the circuit is advanced by one time step the hand on the clock will spin 90 degrees.
While the clock hand is spinning the keyboard is also being sampled at a low frequency. So, if you hold down Control, Left Shift, and some other key, Thyme will take the actions listed in the table below:
Key Action
Q Terminates the simulation and forces a dump file to be made.
T Terminates the simulation.
H Toggles the "hold" bit: if the "hold" bit is set, Thyme pauses when the
simulation is over. The state of the hold bit is displayed by video reversing
the cursor.
D Toggles the color display on and off.
Because the keyboard is being examined about once each second, you will have to hold the key down at least that long.
The listing of your input file is placed in mesa.typescript. Another file, <input file name>.log, is produced. This file contains any syntax or semantic errors that Thyme may have detected, as well as miscellaneous run-time information. The plot output will be placed in <input file name>.plot and any print output you may have requested will be placed in <input file name>.out<n>, where <n> is the number of the print statement.
Making Pictures
To convert your Foo.plot file into Foo.press type PlotPress Foo to the exec. Naturally Foo.press may be sent to your favorite printer using Empress. If you generated a color display while the simulation was running then you must send the .press file to a color printer such as Lilac, and if you generated a black and white display you should send the resultant press file to a black and white printer.
You can also put the first plot in a .plot file back up on the screen by typing PlotScreen Foo to the exec. Unfortunately there is no way to display more than the first plot.
If you are using Lilac as your printer then you should beware that it will not print more than 4 pages reliably and the first page invariably has registration problems. Plan accordingly.
If you are reading this document for the first time and have not yet run Thyme you should do so now before you read the rest of this.
Thyme and the Circuit Extractor
Suppose that you have laid out a circuit and would like to simulate it using Thyme. The first thing you do is run the circuit extractor which will produce a file say Foo.thy. This section explains what you need to do to provide the additional input Thyme requires to do a simulation.
The circuit extractor produces a file which describes the circuit in terms of the amount of area and periphery each of the interconnect layers contributes to each electrical node and the size and connection of each of the transistors. The interconnect size must be transformed into resistive-capactive networks which approximate the DC and AC loading the interconnect places on the circuit. The transistor sizes must be transformed into the parameters required by the transistor model code. This is done by a collection of circuits found in each of the process definition files.
If you were to lay out the inverter circuit used in the first example and extract it, the resulting file would look something like the following:
1 -- N o d e s
2
3 INPUT:node; ?:Stray[INPUT|aP];
4 -- Vdd:node; ?:Stray[Vdd|aD,pD];
5 -- Gnd:node; ?:Stray[Gnd|aD,pD]
6 OUTPUT:node; ?:Stray[OUTPUT|aM,aP,aD,pD];
7
8 -- T r a n s i s t o r s
9
10 Q1:DTran[OUTPUT,OUTPUT,Vdd];
11 Q2:ETran[INPUT,Gnd,OUTPUT];
The file which you must edit to run the circuit simulation using the extracted circuit should look like the following:
1 library[MosModels];
2 library[StdFunctions];
3 circuit={
4 Vdd:node;
5 powerSupply: voltage[Vdd, Gnd]= 5.0;
6 !ThymeBasics.thy
7 !Nmos4.0u75.thy
8 !Foo.thy
9 ?:capacitor[OUTPUT,Gnd] = 0.01pF;
10 ?:RectWave[in|period← 4us, width ← 2us, tRise ← 0.1us, tFall ← 0.1us, tDelay ← 2us];
11 };
12 plot["Nmos Inverter (4 micron, 75 C)", :0.1us, -1, 6, in, out];
13 run[tMax ← 10us];
The output capacitor still appears to model portions of the circuit which do not appear in the extracted description. The only real difference here is that the nodes and transistors of the circuit are no longer typed in but are included by line (8).
Circuit Specification
Suppose that you have a collection of circuits that you need to put into your simulation that are all essentially the same except for component values. An easy way to accomplish that task is to define your own circuit. The following skeleton shows how such circuits may be defined and then used.
1 circuit[<parameter definition list>] = {
2 <node names>: node;
3 <name>: circuit[<connection name list>|<parameter definition list>] = {
4 <node names>: node;
5 <name>: resistor[<node name>, <node name>] = <expression>;
6 };
7 <name>: resistor[<node name>, <node name>] = <expression>;
8 <name>: <circuit name>[<node names>|<actual parameter list>]
9 }
A subcircuit is defined in statements (3-6). The node names used in the definition of the resistor (5) may be from the node statment within the subcircuit (4) or from the connection name list that appears in the subcircuit definition statment (3). Variables used in the expression which computes the value of the resistor (5) may come from any of the parameter definition lists (1) or (3). The node names which appear in the first node statement (2) may be used in the instantiation of the subcircuit in statement (8).
Elements of lists are separated by commas. A parameter definition is either <name> or <name> ← <expression>, which gives the parameter a default value. An actual parameter has the form <name> ← <expression>; the order of appearance of the actual parameters does not matter. The usual rules and operators apply to <expressions>.
The example below defines a circuit which one can use to test the response of a two stage RC model of a diffusion line to a step input.
circuit[width ← 2, len ← 100, lambda ← 2.5] = {
diffusion: circuit[in, out|w, l, rho ← 35, cap ← 20e-5pF] = {
r: resistor[in, out] = rho*l/w;
c: capacitor[out, Gnd] = cap*l*w*lambda^2};
input, middle, output: node;
step: voltage[input, Gnd] = 5;
section1: diffusion[input, middle|l ← len/2, w ← width];
section2: diffusion[middle, output|l ← len/2, w ← width]}
Two of the parameters of the circuit diffusion have default values, the sheet resistivity, rho, and the area capacitance, cap.
More About Output Control
Output control is made up of <print specifications> and <plot specifications> which tell Thyme what sort of output to produce. The maximum number of <print specification>'s or <plot specification>'s is ten and they may be freely mingled. The file names of the output files specified by the <print specification>'s are generated by <input file name>.out<number> with the first one in sequence being numbered zero. The first <plot specification> determines what will appear on your computer's display; all the plots will have the same aspect ratio and format.
The formats for the <print specification> and <plot specification> are:
print[<time scale> <path name><selector><scale>, <path name><selector><scale>, ...]
plot[<title> <time scale> <minimum>, <maximum>, <path name><selector><scale>, ...]
A <path name> consists of <circuit instance name>/<circuit instance name>/.../<node or branch instance name>. The possible <selector> characters are:
Selector Selection
node or branch voltage
' derivative of node voltage
^ branch current (flows from the positive to the negative terminal)
@ branch value
A <scale> factor has the form ":<number>" when present; a <time scale> factor has the form ":<number>,". The value printed or plotted is the selected value divided by the scale factor. The <minimum> and <maximum> are numeric constants which define the limits of the graph. The optional <title> allows you to put some additional descriptive information on a graph. Its format is "<string>," where <string> is as defined in Mesa.
Referring to the RC example one might use the <plot specification>
plot["RC", :10ns, 0, 5, middle, output, section1/r, section1/r^:1mA]
This will plot the voltages at the nodes middle and output, the voltage across the first resistor, and the current through that resistor. The current has been scaled so that it will show up on a scale of zero through five. The string "RC" will be added to the heading of the graph.
More About Run Control
The basic function of run control is to indicate the length of time for which the simulation is to be run. The format of the run statement is:
run[<actual parameter list>]
The only allowed <expressions> are numeric constants. The parameter tMax determines the length of the simulation. More complex run control could consist of:
ic[<path name> ← <number>, ...];
checkpoint[<number>];
run[<actual parameter list>];
dump
Here the ic statement is used to establish desired initial conditions; one may set the initial voltage on a node or the initial current through an inductor. Elements not specified default to zero. Thyme normally will begin a simulation with all node voltages and inductor currents set to zero. One may also include an assignment of the form "* ← <number>" which will initialize all nodes to the given value. The dump statement tells Thyme to produce a file, in the format of an ic statement, containing the time, the node voltages, and the inductor currents when the simulation stopped. The name of this file is <input file name>.dump. Finally, the checkpoint statement will make Thyme produce periodic dump files so that you can restart your simulation if your computer fails; the <number> specifies the period in minutes.
Standard Support Files
The support files need to be understood by the more than casual user. This section explains the contents of those files in some detail.
ThymeBasics.thy
This file is the interface between the Thyme input file which the user writes and the Mesa code which models active devices such as transistors and diodes and provides time dependent voltage functions that act as the stimulus to the circuit. The active device models will not be explained because they are very complex. The notes on their use through the process files is the only explanation which is unique to Thyme. This explanation is provided in the next section.
There are four circuits which provide time dependent voltage sources. Each of these takes one node, output, as the actual node to which the voltage will be applied. Pulse and RectWave generate periodic waveforms. OneShot generates a single pulse, i.e. two transitions. Step generates a single transition. There are a number of parameters which are used to control these circuits. The following list explains each of these parameters. Not all of the parameters are used in each of the circuits. Every circuit has the notion of active and inactive periods of time. All of them allow the voltage levels for the active and inactive periods to be set independently. All of them are considered to be inactive at time 0.
amplitude Used by Pulse to add to the offset to set the voltage level produced during the active period.
offset Used by Pulse to set the voltage level used during the inactive period.
OnLevel, OffLevel Used by RectWave, OneShot, and Step to establish the active and inactive voltage levels respectively.
period Used by Pulse and RectWave to set the sum of the time of the active and inactive periods.
width Used by Pulse, RectWave, and OneShot to establish the active period. Note that the time that the output spends actually at the active level depends upon the rise and fall times, i.e. the rise and fall times are taken from the time during which the output is active.
tRise Used by Pulse, RectWave, OneShot, and Step to set the transition time from the inactive level to the active level.
tFall Used by Pulse, RectWave, and OneShot to set the transition time from the active level to the inactive level.
tDelay Used by Pulse, RectWave, OneShot, and Step to delay the beginning of whatever voltage generation the circuit is to perform. The output of the voltage supply will remain at the inactive level until the time specified by tDelay has expired.
The voltage sources have assertions which check that the width is less than the period and the sum of the rise and fall times are less than the pulse width.
Process Files
As we recall from the introduction each of the process files has a name of the form:
<process type>|<feature size>|<temperature>.thy
Where process type may be NMOS or CMOS, feature size may be 4.0u or 2.0u and temperature may be one of 25, 50 or 75 (in degrees centigrade). All the process files are stored on [Cherry]<Thyme>ProcessDefs>. The files which are actually available right now are:
CMOS2.0u25.thy - This is for an experimental 2.0m CMOS process.
NMOS4.0u25.thy - These files are for the standard NMOS process.
NMOS4.0u50.thy
NMOS4.0u75.thy
Within each of these files are a number of circuits that specify the electrical properties of each process. Both the active device parameters and the parasitic parameters are included.
NMOS has two active device types, enhancement and depletion N channel transistors. These are modeled by the circuits ETran and DTran respectively. Both the transistor circuits take the gate, source, and drain as node formals and have the length, L, and width, W, of the channel, as well as the source extension, sourceExtension, and the drain extension, drainExtension, as parameters. The bulk is assumed to be tied to ground.
There are several circuits used to model parasitic effects. WireCap models the capacitance from poly, 1rst layer metal, or 2nd layer metal to bulk by converting the area and perimeter into a fixed capacitor. Note that this does not take into account the difference in capacitance due to stacking of layers, e.g. if 1rst layer metal runs on top of poly the capacitance from 1rst layer metal to bulk will decrease due to the increased space between the metal and the bulk and if the poly and metal run parallel for a reasonable distance there will be a capacitor coupling the two lines together. DifCap models the capacitance and leakage of diffusion runs. WireRes produces a resistor to model the resistance of 2nd layer metal, 1rst layer metal, poly, or diffusion for those situations where the RC delay of a circuit is important.
Do not use the resistor models gratuitously since introducing nodes into your simulation with time constants greatly different from the time constants generated by the transistor - parasitic capacitance interactions will slow down Thyme substantially and can cause it to become numerically unstable.
ConRes is intended to model the resistance of a number of parallel contacts connecting two layers together. It may not be important for the 4m processes unless you stitch through contacts a lot but will become more important with the more advanced processes because the contact resistance increases with scaling instead of decreasing.
CMOS also has two active device types, enhancement N channel and enhancement P channel transistors. These are modeled by the circuits NETran and PETran respectively. These transistor circuits take the gate, source, and drain nodes as formals, just as the NMOS transistors do, but in addition take the bulk node. Presumably you will always connect the bulk of the N channel devices to ground and the bulk of the P channel devices to Vdd so perhaps we will change the circuit definitions to do this for you. Currently no parasitics are available for CMOS.