General Rules for the Input File

In this topic:

Statements and Continuation of Statements

The input file for the SIMPLIS package is organized into different statements. Ordinarily, the end of a line signifies the end of a statement. However, a statement can be continued on to the next line by using the line continuation character, the plus sign ('+'). Refer to Continuation of Statements for more about the continuation of statements.

Blank Characters

Within a single statement, the data are organized into different fields. Fields are separated by one or more spaces or tabs. Spaces and tabs are called blank characters. While blank characters must be used to separate different fields, the presence of at least one blank character between two groups of non blank characters does not always mean the two groups of characters belong to two different fields. Blank characters may be present within a single field. In general, blank characters are used to separate different fields or to improve the readability of the input file.

Blank Lines

Blank lines can be placed anywhere in the input file to make the file more readable. Blank lines have no effect on the execution of the program.

Comment Statements

Comment statements are used to make the input file more readable. A comment is identified by an asterisk ('*') as the first character, at the beginning of a line. Comment statements which are several lines long must have a comment character at the beginning of each line. Comment statements are ignored during program execution.

In-line Comments

An in-line comment is a comment that starts in the middle of a line. The in-line comment is identified by the semicolon character, (';'), placed at the beginning of the comment section. The portion of the line to the right of the in-line comment symbol is ignored by SIMPLIS. For example, in SIMPLIS, the following two lines are equivalent:

RC 1 0 1K ;esr of c1
RC 1 0 1K

Continuation of Statements

A statement can be continued to the next line by using the line continuation character, the plus sign ('+'). Any line whose first non blank character is the line continuation character is considered the continuation of the previous line. For example, the following lines form one single statement:

V1 1 0 PUL V1=0 V2=1
+ FREQ=1MEG DRATIO=0.1 DELAY=0.1
+ OFF_UNTIL_DELAY=YES

A comment statement cannot be followed by a line continuation statement.

Device Names

The name of a device is formed by the concatenation of two parts: the element keyword and the individual name. The element keyword is a character string of one or two characters. The individual name is a character string of arbitrary length. You should keep the individual name descriptive and short (no more than sixteen characters).

Element Keyword

The table below shows the relationship between each element keyword and the type of corresponding circuit elements.

Element Keyword Type of Element
R Linear Resistor
L Linear Inductor
C Linear Capacitor
V Independent Voltage Source
I Independent Current Source
M Linear Mutual Inductance
E Linear Voltage-Controlled Voltage Source
G Linear Voltage-Controlled Current Source
H Linear Current-Controlled Voltage Source
F Linear Current-Controlled Current Source
!T Ideal Transformer
Q Simple Transistor Switch
S Simple Switch
!R Piecewise-Linear Resistor
!L Piecewise-Linear Inductor
!C Piecewise-Linear Capacitor
!D Simple Logic Gates
X Instantiation of subcircuits

Individual Name

An individual name is a string made up of zero or more characters from the following character set:

Alphabetic characters a-z A-Z
Numeric characters 0-9
Underscore _

Examples of Device Names

The following entries are all legal device names for inductors:

L La LA L1 L_MAG

Model Names and Subcircuit Names

SIMPLIS supports the concept of device models and subcircuits in the input file. The name of a model or a subcircuit is a string that is made up of the same characters as those outlined in See Individual Name for the individual name of a device. In addition, each of the following conditions must also be satisfied:

  1. A model name or a subcircuit name must have at least one character.
  2. A model or subcircuit name must contain at least one alphabet character.
  3. The first character in a model or subcircuit name must not be the underscore character ('_').

Uppercase vs. Lowercase

SIMPLIS is case sensitive to individual device names . For example, the following device names are two different inductors:

La
LA

However, SIMPLIS is not case sensitive to element keywords . For example, the following names are the same inductor:

La
la

because the first character ('l' or 'L') is the element keyword for a device name.

The interpretation of the model names and subcircuit names follows the same interpretation as the operating system of the host. If the operating system is case sensitive to file names, then SIMPLIS is case sensitive to model names and subcircuit names. If the operating system is not case sensitive to file names, then SIMPLIS is not case sensitive to model names and subcircuit names. For example, UNIX operating systems are case sensitive, while Windows operating systems are not.

Integer Entries

Some input statements may have fields or parameters which are required to be integers. The legal format for an integer entry is:

[-]d[d...]

where

[-] is the optional negative sign associated with a negative integer,
d is a numeral in the range of 0 through 9, and
[d...] is an optional string of extra digits.
The following are legal entries:
-34 0 25 -27 301

The following are illegal integer entries:

- +1 23. 24.5

They are illegal integer entries because

  1. The negative sign is not followed by a numeral;
  2. +1 begins with a positive sign, which is illegal;
  3. The numbers 23. and 24.5 have decimal points.

Floating-point Entries

From time to time, a certain field or parameter in a statement calls for a floating-point entry. A floating-point entry can be typed in several possible formats:

  1. Integer format
  2. Simple floating-point format
  3. Exponential format
  4. Engineering format

Integer Format in Floating-point Entries

Whenever a floating-point entry is expected, the entry can be typed in the integer format as defined in Integer Entries if the corresponding entry turns out to be an integer. For example, if 34 is to be typed as a floating-point entry, it can be typed as 34 without the accompanying decimal point.

Simple Floating-point Format

The simple floating-point format is defined as

[-]d[d...].[d...] or [-].d[d...]
where
[-] is the negative sign associated with a negative integer,
d is a numeral in the range of 0 through 9,
. is the decimal point, and
[d...] is an optional string of extra digits.
Examples of the use of the simple floating-point format are:
9.37 -0.5 1001.76

Similar to an integer entry, a floating-point entry cannot begin with a positive sign.

Exponential Floating-point Format

The exponential floating-point format is defined as

[if]E[+-]d[d] or [sfpf]E[+-]d[d]
where
[if] is a number in the integer format,
[sfpf] is a number in the simple floating-point format,
E is either the character e or the character E,
[+ -] is either the positive sign or the negative sign,
d is a numeral in the range of 0 through 9, and
[d] is an optional extra digit in the exponent.
The following examples are equivalent entries:
27000 2.7e+04 27E+3

Engineering Floating-point Format

The engineering floating-point format is defined as

[if]S  or  [sfpf]S  or  [efpf]S
where
[if] is a number in the integer format,
[sfpf] is a number in the simple floating-point format,
[efpf] is a number in the exponential floating-point format, and
S is one of the character strings used to represent one of the scale factors. The string can be entered in either lower or upper case.
The following examples are equivalent entries:
27k 27K 27000 27000 2.7E+4 27e-03MEG

The table below shows all the engineering prefixes recognized by SIMPLIS, and their corresponding scale values.

Prefix Types
Symbol Prefix Scale Factor
F femto 10 -15
P pico 10 -12
N nano 10 -9
U micro 10 -6
M milli 10 -3
K kilo 10 +3
MEG mega 10 +6
G giga 10 +9
T tera 10 +12

Illustrations of Legal and Illegal Floating-point Entries

The following entries are all valid floating-point entries:

0 -3 3. 0.3 31.12 -.12E-06 3.12e+3 1.1K -150U

The entries 0 and -3 are in integer format. The entries 3., 0.3, and 31.12 are in simple floating-point format. The entries -.12E-06 and 3.12e+3 are in exponential format. The entries 1.1K and -150U are in engineering format.

The following are illegal floating-point entries:

+0.7 3.12E+345 4.7 K

They are illegal because

  1. +0.7 contains the illegal positive sign;
  2. The exponent in 3.12E+345 is more than two digits long;
  3. 4.7 K has an extra space between the number 4.7 and the scale factor K.

Units

SIMPLIS works with System Internationale (SI) units. The table below gives a summary of all units expected for different types of variables. Units are not allowed to be specified with the values of the corresponding variables. For example, a capacitance of 1.25 microfarads may be represented by 1.25U or 0.00000125, but not 1.25UF or 0.00000125F.

Unit Types
Variable Units
Time second
Resistance ohm
Capacitance farad
Inductance henry
Voltage volt
Current ampere
Charge coulomb

Length of Fields and Lines

Each field of entry should be restricted to no more than 80 characters long. Each input line should be restricted to no more than 160 characters long. This restriction does not limit the length of a statement since it can continue over several lines through the line continuation character.