Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
68
Добавлен:
06.06.2017
Размер:
3.31 Mб
Скачать

.DC

General Form (SPICE files only)

Linear sweep type

.DC [LIN] <v1> <start1> <end1> <increment1> +<v2> <start2> <end2> <increment2>]

Log sweep type

.DC <OCT | DEC>

+<v1> <start1> <end1> <points1 per octave or decade>

+[<v2> <start2> <end2> <points2 per octave or decade>]

List sweep type

.DC <v1> LIST <value>* [<v2> LIST <value>*]

<v1> and <v2> must be one of the following:

1.The name of an independent source in the circuit. e.g. VCC

2.A model parameter name in the form:

<model type> <model name(parameter name)> e.g. NPN QF(BF)

3.Operating temperature in the form: TEMP

4.A symbolic parameter in the form:

PARAM <symbolic parameter name> e.g. PARAM temp1

Sweep specifications can be different for <v1> and <v2>. That is, you can use linear sweeping for one variable and log for the other.

Examples

.DC VIN1 -.001 .001 1U

.DC VCC 0 5 0.1 IB 0 0.005 0.0005

.DC DEC RES RMOD(R) 1m 100 5

.DC PARAM FILTER_Q 10 20 1

.DC VCC LIST 4.0 4.5 5.0 5.5 6.5 VEE LIST 24 25 26

297

.DEFINE

General Form1 (Schematics only)

.DEFINE [{LOT[t&d]=<n>[%]}] <text1> <text2>

where t&d is [ [/<lot#>][/GAUSS|UNIFORM|WCASE]]

Examples

.Define V1 (2*t*sin(2*pi*T))

.DEFINE RVAL 128.5K

.DEFINE {LOT=10%} LVAL 1200MH

.DEFINE {LOT/1/GAUSS=10%} CVAL 1200NF

This form of the statement is used to create and define the value of a symbolic variable. It substitutes <text2> for <text1> everywhere except for text from the PART attribute Value field and model parameter name text. While you can't use this statement to change the name of a part or a model parameter name, you can use it to change the name of the model itself.

General Form2 (Schematics only)

.DEFINE <name(<p1>[,<p2>][...,<pn>])> f(<p1>[,<p2>][...,<pn>])

where f() is some expression involving the parameters <p1>[,<p2>][.. .,<pn>]

This form of the statement works exactly like C language macros, substituting in at run time the values of <p1>[,<p2>][...,<pn>]. It is also similar to the SPICE

.FUNC statement.

Examples:

Macro formulas

.DEFINE F1(A,B) (A+2*B)

.DEFINE THREE(Y,A,B,C) IF(Y>C,C,IF(Y>B,B,A))

.DEFINE DISTANCE(X,Y,Z) POW(X*X+Y*Y+Z*Z,0.5)

String replacement

A good example of string replacement occurs in digital STIM devices. These devices require a COMMAND attribute string to describe their behavior. A typical command might be:

298 Chapter 20: Command Statements

.define SQUAREWAVE

+0NS 0

+LABEL=START

++10NS 1

++10NS 0

++10NS GOTO START 10 TIMES

In the STIM COMMAND attribute we enter "SQUAREWAVE ". Later when an analysis is run, MC7 substitutes the lengthy text.

.DEFINE statements are frequently used for the STIM COMMAND attribute, PLA DATA attribute, Nonlinear Table Source TABLE attribute, and Laplace Table Source FREQ attribute.

Symbolic variables

The following lets you globally assign or even step the W and L of all MOSFETs that use the MX model statement.

.DEFINE W1 2U

.DEFINE L1 .3U

.MODEL MX NMOS (W=W1 L=L1....)

User functions

This function lets you easily calculate collector power in a transistor.

.DEFINE PC(Q) VCE(Q)*IC(Q)

With this definition, PC(Q10) would plot the collector power in transistor Q10.

The HOT function below flags excessive instantaneous transistor collector power by returning a 1.

.DEFINE HOT(Q,MAX) IF((VCE(Q)*IC(Q)>MAX),1,0)

With this definition, HOT(QX3,100MW) would plot a 1 if QX3's instantaneous transistor collector power exceeded 100 mW.

Define statements within a circuit are local to that one circuit. However, the define statements in the MCAP.INC file are globally available to all circuits. This file is accessed from the User Definitions item on the Options menu. It can be edited by the user.

299

.END

General Form (SPICE files only)

.END

Examples

.END

This statement specifies the end of the circuit definition. All circuit descriptions and commands must come before the .END statement.

300 Chapter 20: Command Statements

.ENDS

General Form (SPICE files only and schematic text areas only)

.ENDS [<subcircuit name>]

Examples

.ENDS

.ENDS FILTER

This statement terminates a subcircuit description. The optional subcircuit name label is used only for clarification.

301

.FUNC

General Form (SPICE or schematics)

.FUNC <name(<p1>[,<p2>][...,<pn>])> f(<p1>[,<p2>][...,<pn>])

This command is similar to the macro form of the .DEFINE command and is included as a separate command because it is sometimes used in commercial models. The function name must not be the same as any of the predefined functions such as sin, cos, exp, etc.

Examples

.FUNC MAX3(A,B,C) MAX(MAX(A,B),C)

.FUNC QUAD(A,B,C,X) A*X^2+B*X+C

.FUNC DIVIDER(A,B,C) V(B,C)/V(A,C)

302 Chapter 20: Command Statements

.HELP

General Form (Schematics only)

.HELP <parameter name> <"help text">

This command places parameter help text in a macro schematic. The help text is displayed in the Status bar of the Attribute dialog box when a macro is placed or edited and the cursor is over parameter name.

<parameter name> should be one of the macro parameters listed in the

.PARAMETERS statement.

Here are several examples:

.HELP VP "Peak magnitude of the output signal"

.HELP KF "Frequency sensitivity in Hz/Volt"

303

.IC

General Forms (SPICE or schematics) Analog nodes

.IC <V(<analog node1>[,<analog node2>]) = <voltage value>>*

Inductors

.IC <I(<inductor>) = <current value>>*

Digital nodes

.IC <D(<digital node>) = <digital value>>*

Examples

.IC V(VOUT)=2.0

.IC I(L1)=6.0 V(3)=2

.IC D(1440)=0

.IC D(DIN)=X D(12)=1

The .IC statement assigns initial voltages, inductor currents, and digital logic states during the AC and transient analysis operating point calculation, and during the first data point in DC analysis. It assigns the analog or digital value to the node or branch and holds the value during the entire operating point calculation. After the operating point calculation, the node is released. If a .NODESET and an .IC statement are both present in the circuit, the .IC statement takes precedence. That is, the .NODESET statement is ignored.

Note, using .IC statements to set the voltage across inductors or voltage sources is futile. During the operating point calculation inductor voltages are set to zero, and voltage sources assume their TIME=0 value.

The IC statement works as follows in AC and transient analysis:

1.If transient analysis is being run and the Operating Point option is enabled or if AC analysis is being run, a DC operating point is calculated. The values specified in the .IC statement are fixed during the operating point calculation.

2.If transient analysis is being run and the Operating Point option is disabled: A DC operating point is not calculated. The initial condition appearing in the

.IC statement and device initializations are assigned, and the first time point of transient analysis begins using these initial values.

304 Chapter 20: Command Statements

.INCLUDE

General Form (SPICE or schematics)

.INC[LUDE] <"Filename">

Examples

.INCLUDE "C:\MC7\DATA\EX1DEF.TXT"

.INC "C:\MC7\DATA\MYSMALL.LIB"

This statement copies statements from an external text file into a schematic or SPICE file prior to an analysis. This is useful if you have an external text file library of model statements or you want all your statements contained in a separate DOS file. Use the Text tool in the Schematic Editor to add the statement to a schematic. <"Filename"> may include a path. The quotation marks are optional.

This command includes all of the text in the file and can quickly exhaust memory if the included file is large. It should only be used with small text files. For large files, use the .LIB command.

305

.LIB

General Form (SPICE or schematics)

.LIB ["Filename"]

Examples

.LIB

.LIB "C:\MC7\DATA\BIPOLAR.LIB"

The .LIB command is both an alternative and a supplement to placing model statements in a schematic or SPICE file. It accesses device models from binary library files (*.LBR) or .MACRO, .MODEL, or .SUBCKT statements from text files (*.LIB). "Filename" is any legal file name and may include a path. Quotation marks are optional. There is no default extension, so you must include the file name extension. .LIB files may contain .MODEL, .SUBCKT, .MACRO, .ENDS,

.PARAM, or .LIB statements. Other statements are ignored. Lines are nullified with a "*" at the start of the line. A ";" nullifies the remaining portion of the line.

"Filename" defaults to NOM.LIB. The original NOM.LIB supplied with MC7 accesses the entire Model library by listing each of the constituent model library files. The default command .LIB NOM.LIB is automatically applied to every circuit and is the main access mechanism to the MC7 Model library.

Whenever MC7 needs model information from a macro statement, model statement, or a subcircuit it will look in these places in the order shown:

If the circuit is a schematic:

In the grid text or text area.

In the file named in the File attribute (if the device has one).

In any file listed in a .LIB statement contained within the circuit.

In any file named in the master NOM.LIB file.

If the circuit is a SPICE text file:

In the circuit description text.

In any file listed in a .LIB statement contained within the circuit.

In any file named in the master NOM.LIB file.

When searching for model library files, MC7 scans the library folders specified at File / Paths. If more than one folder is specified, it searches in left to right order. Should the search fail, an error message is issued. Generally, MC7 first looks for model information locally within the circuit, then globally in the library folders.

306 Chapter 20: Command Statements

Соседние файлы в папке Micro-Cap v7.1.6
  • #
    06.06.20171.32 Кб60model.CNT
  • #
    06.06.201776.72 Кб62MODEL.HLP
  • #
    06.06.20173.72 Кб60NETHASP.INI
  • #
    06.06.2017450 б59os.dat
  • #
    06.06.2017545 б63READ.ME
  • #
    06.06.20173.31 Mб68RM.PDF
  • #
    06.06.2017226.69 Кб61setup.bmp
  • #
    06.06.201795 б59SETUP.INI
  • #
  • #
    06.06.201749 б60setup.lid
  • #
    06.06.20172.04 Mб59Standard.cmp