Product Documentation
Spectre Circuit Simulator Components and Device Models Reference
Product Version 23.1, June 2023

Linear N Port (nport)

An N-port takes its characteristics from an S, Y, or Z-parameter data file. An N-port can have as many ports as described in the data file. Each pair of terminals in the `nport' instance statement represents one port. Because there is no limit to the number of ports, there is no limit to the number of terminals. However, the terminals must be specified in pairs and you must specify at least one pair. The order of the pairs is the same as the order of the ports in the data file. Any missing ports are ignored.

The S, Y, or Z-parameter data file specifies the characteristics of the N-port. You can scale the frequency axis with the scale parameter. The frequencies in the data file are then multiplied by scale before the simulator uses them. The default scale factor is unity. In addition to Spectre's native format, the S, Y, or Z-parameters can be in Touchstone or CITIfile format, and the data can be given as: real-imag, mag-deg, mag-rad, db-deg, or db-rad.

An internal thermal noise model is used in noise analysis. However, if you provide frequency-dependent noise data, this data is used to build a noise model. Currently, the Touchstone format accepts the two-port noise parameters (NFmin, Gamma (Gopt, Bopt) and Rn), while Spectre's native format accepts both two-port noise parameters and noise correlation matrix.

If interp=linear or spline is specified, the impulse response is calculated and the convolution-based method is used for simulation in the time domain. It is assumed that the S, Y, or Z-parameter data is complete and smooth enough to be safely interpolated or extrapolated in the frequency range from fdelta to fmax, and to DC. N-port can be used to model different kinds of systems. The default setting of the impulse response and convolution algorithm is made for typical N-port applications. See the notes below on when and how to set some of the controlling parameters.

Linear interpolation or cubic spline is used for data in polar form. A simple algorithm removes 2 pi jumps in the phase data. Frequency points where the data is measured must therefore be close enough to avoid an excessive number of jumps. Unfortunately, noisy phase data can cause unnecessary warning messages. The number of frequency domain samples used for FFT is fmax/fdelta with the upper limit of maxn. It might be necessary to increase maxn for extremely large average group delays. When usewindow is set to yes, the data in the frequency domain is multiplied by the Kaiser-Bessel window function with smoothing parameter set to one.

If interp=rational is specified, the data is interpolated and extrapolated using a rational function fit to the data. The degree of rational interpolation is automatically selected based on the values of abserr and relerr, unless ratorder is given, in which case relerr and abserr are ignored in selecting the order of the rational function interpolation. It is recommended to allow the simulator to automatically select the rational interpolation order.

When interp=bbspice and nport_bbspice_to_linear=yes are specified, then if:

If the S, Y, or Z-parameter data contains noise, abserr and relerr should be set so that the fitting procedure can ignore the noise, for example, by setting abserr above the noise floor and/or relaxing relerr as necessary.

Because the fitting procedure can take a long time for complicated data, the reduced order model (ROM) file option is available to store and re-use the rational interpolation function in subsequent simulations.

It is not practical to rely on extrapolated data.

If the matrixform parameter is set to yes, nport becomes a state-space model. A state-space model is a set of state space equations in matrix form describing a linear system. The equations are in the following form:

E(dx/dt) = Ax + Bu

y = Cx + K(du/dt) + Du

where u is the input vector, y is the output vector, and x is the internal-state vector. A, B, C, D, E, and K are coefficient matrices.

Refer to the notes on state-space models for detailed information on how to use the parameters.

Sample Instance Statement

x1 (a1 0 b1 0 b3 0) ndata file="sparam2.data"

Sample Model Statement

model ndata nport file="sparam.data" scale=1

This device is not supported within altergroup.

Synopsis

Name  t1  b1  [t2]  [b2] ... ModelName <parameter=value> ...
Name  t1  b1  [t2]  [b2] ... nport <parameter=value> ...

Terminals must be given in pairs.

Model Synopsis

model ModelName nport <parameter=value> ...

Instance Parameters

m=1

Multiplicity factor.

file

S-parameter data file name.

com_file

S-parameter data compress file name.

datafmt

The format of the S-parameter data file. If this parameter is not specified, Spectre detects the format by itself. Possible values are spectre, touchstone, citi, rfm, and bnp.

scale=1

Frequency scale factor.

interp=nport_default_interp

Method to interpolate S-parameter data, only valid for datafmt=spectre/touchstone/citi/bnp. Where 'interp' is not specified, by default it adheres to the global option nport_default_interp.
Possible values are spline, rational, linear and bbspice.

matrixform=no

Flag for matrix form input. Possible values are yes and no.

isnoisy=yes

Should nport generate noise. Possible values are yes and no.

Spline/Linear interpolation parameters

fmax (Hz)

Maximum frequency of interest. Default is three times the highest frequency found in the S-parameter file.

fdelta (Hz)

Frequency sampling interva, automatically calculated by the simulator. If you specify the parameter explicitly, adaptive sampling is disabled.

maxn=131072

Maximal order of impulse response. Cannot exceed 262144.

impnoiselevel=1.0e-4

Noise level threshold for impulse responses used in causality enforcement.

imptrunc=1.0e-4

Impulse response truncation threshold relative to the maximum absolute value. The head and tail of the impulse response below imptrunc is removed to speed up the simulation.

gmin=1.0e-9

Adding gmin (minimum conductance) to nport terminals for tran and hb analysis.

datatrunc=1.0e-4

Relative truncation threshold for the S-parameter data.

usewindow=no

Use smooth data windowing function. Possible values are yes and no.

dcextrap=constant

     Long delay DC extrapolation method. dcextrap = bbspice is valid only for freq-domain analysis.
Possible values are constant, unwrap, hpunwrap and bbspice.

hfextrap=constant

High-frequency extrapolation method for frequency-domain simulation. hfextrap = bbspice is valid only for freq-domain analysis.
Possible values are constant, linear and bbspice.

Passivity checking and enforcement parameters

passivity=check

Check and enforce passivity of S parameters. For interp=bbspice, default value is fit_enforce. For more information, see passivity.
Possible values are no, check, enforce, fit_weak_enforce, and fit_enforce

pabstol=-1.0e-6

Absolute tolerance of passivity criteria for original s-parameter data.

Causality correction parameters

causality=fmax

Correct the S-parameter data to ensure that the system is causal. auto takes long time to perform causality correction. fmax_active can be used for active data. Possible values are no, fmax, auto, fmax_active, and bbspice.

Rational interpolation parameters

relerr=0.01

Maximum relative allowed tolerance for rational interpolation errors. Deviations of the nport model from the supplied S-parameter data of relative magnitude less than relerr are mostly ignored.

abserr=1e-4

Maximum absolute allowed tolerance for rational interpolation errors. Deviations of the nport model from the supplied S-parameter data of absolute magnitude less than abserr are ignored.

romdatfile

File used for storing time-domain reduced order model (ROM).

ratorder

Order of rational function to use in fitting the S-parameter data. If this argument is given, relerr and abserr are ignored in selecting the order of the rational function interpolation. If ratorder is not specified, the simulator attempts to select an order of rational interpolation that satisfies the criteria implied by abserr and relerr.

Noise parameters

trise (C)

Temperature rise from ambient.

thermalnoise=yes

Should nport generate noise. Possible values are yes and no.

noisemodel

Use either the internal thermal noise model or the externally supplied noise data in the S-parameter data file. The default behavior is to use external data whenever it is available. When interp=bbspice, externally supplied noise data is ignored and the broadbandspice rational fitting model is used to get the noise model. Possible values are internal and external.

noisecorr=complex

Setting noisecorr to real forces the nport noise correlation matrix to be real-valued. The parameter is used for backward compatibility only. Its value is determined automatically and its use is not recommended because it can lead to an incorrect answer. The simulator generates a warning if the noise correlation matrix is complex while the value of noisecorr is set to real. Possible values are real and complex.

Matrixform state-space model parameter

porttypes=[...]

A vector of integers that defines the types of ports. Use 0 for input port, 1 for output port, and 2 for both input and output ports.

portquantities=[...]

A vector of integers that defines the quantities of ports. Use 0 for voltage and 1 for current.

matrixfile

Matrix entry data file name.

matrixA=[...]

Non-zero entries in coefficient matrix A. Its format is [ ... row_i col_j value_ij ... ].

matrixB=[...]

Non-zero entries in coefficient matrix B. Its format is [ ... row_i col_j value_ij ... ].

matrixC=[...]

Non-zero entries in coefficient matrix C. Its format is [ ... row_i col_j value_ij ... ].

matrixD=[...]

Non-zero entries in coefficient matrix D. Its format is [ ... row_i col_j value_ij ... ].

matrixE=[...]

Non-zero entries in coefficient matrix E. Its format is [ ... row_i col_j value_ij ... ].

matrixK=[...]

Non-zero entries in coefficient matrix K. Its format is [ ... row_i col_j value_ij ... ].

acmodel=freqdomain

Alters nport behavior in small signal analyses: sp, ac, and xf. The default value is freqdomain. Possible values are freqdomain and timedomain.

outfile

File used for storing the equivalent S-parameter data based on corresponding time-domain model. The file format is touchstone. The instance name is added as a suffix and the file extension is added automatically.

bbsfreqband=[...]

The frequency band of interest. More weight will be added to this frequency band to increase the accuracy of BBspice fitting at this band. The parameter takes a vector with the first element is the start frequency point and the second element is the end freq point..

maxdelay (C)

Related Topics

Model Syntax

Important note about spline and linear interpolation parameters

Circuit Components

Model Syntax

model modelName nport parameter=value ...

Model Parameters

file

S-parameter data file name.

datafmt

The format of the S-parameter data file. If this parameter is not specified, Spectre detects the format by itself. Possible values are spectre, touchstone, citi, rfm, and bnp.

scale=1

Frequency scale factor.

dcextrap=constant

Long delay DC extrapolation method, dcextrap = bbspice is valid only for freq-domain analysis.
Possible values are constant, unwrap, hpunwrap and bbspice.

matrixform=no

Flag for matrix form input. Possible values are yes and no.

Spline/Linear interpolation parameters

interp=linear

Method to interpolate S-parameter data, only valid for datafmt=spectre/touchstone/citi/bnp.
Possible values are spline, rational, linear and bbspice.

fmax (Hz)

Maximum frequency of interest. Default is three times the highest frequency provided in the S-parameter file.

fdelta (Hz)

Frequency sampling interval automatically calculated by the simulator. If you specify the parameter explicitly, adaptive sampling is disabled.

maxn=131072

Maximal order of impulse response. Cannot exceed 262144.

impnoiselevel=1.0e-4

Noise level threshold for the impulse responses used in causality enforcement.

imptrunc=1.0e-4

Relative truncation threshold for the impulse response.

gmin=1.0e-9

Adding gmin (minimum conductance) to nport terminals for tran and hb analysis.

datatrunc=1.0e-4

Relative truncation threshold for the S-parameter data.

usewindow=no

Use smooth data windowing function. Possible values are yes and no.

hfextrap=constant

Long delay high-frequency extrapolation method. hfextrap = bbspice is valid only for freq-domain analysis.
Possible values are constant, linear and bbspice.

Passivity checking and enforcement parameters

passivity=check

Check and enforce passivity of s parameters. For interp=bbspice, default value is fit_enforce. For more information, see passivity. Possible values are no, check, enforce, fit_weak_enforce, and fit_enforce.

pabstol=-1.0e-6

Absolute tolerance of passivity criteria.

Causality correction parameters

causality=fmax

Correct the S-parameter data to ensure that the system is causal. The default value is fmax. auto takes a long time to perform causality correction. Possible values are no, fmax, and auto.

Noise parameters

trise=0 C

Default temperature rise from ambient.

thermalnoise=yes

Should nport generate noise. Possible values are yes and no.

isnoisy=yes

Should nport generate noise. Possible values are yes and no.

noisemodel

Use either the internal thermal noise model or the externally supplied noise data in the S-parameter data file. The default behavior is to use external data whenever it is available. When interp=bbspice, externally supplied noise data is ignored and broadbandspice rational fitting model is used to get the noise model. Possible values are internal and external.

noisecorr=complex

Setting noisecorr to real forces the nport noise correlation matrix to be real-valued. The parameter is used for backward compatibility only. Its value is determined automatically and   its use is not recommended because it can lead to an incorrect answer. The simulator generates a warning if the noise correlation matrix is complex while the value of noisecorr is set to real. Possible values are real and complex.

Matrixform state-space model parameter

porttypes=[...]

A vector of integers that defines the types of ports. Use 0 for input port, 1 for output port, and 2 for both input and output ports.

portquantities=[...]

A vector of integers that defines the quantities of ports. Use 0 for voltage and 1 for current.

matrixfile

Matrix entry data file name.

matrixA=[...]

Non-zero entries in coefficient matrix A. Its format is [ ... row_i col_j value_ij ... ].

matrixB=[...]

Non-zero entries in coefficient matrix B. Its format is [ ... row_i col_j value_ij ... ].

matrixC=[...]

Non-zero entries in coefficient matrix C. Its format is [ ... row_i col_j value_ij ... ].

matrixD=[...]

Non-zero entries in coefficient matrix D. Its format is [ ... row_i col_j value_ij ... ].

matrixE=[...]

Non-zero entries in coefficient matrix E. Its format is [ ... row_i col_j value_ij ... ].

matrixK=[...]

Non-zero entries in coefficient matrix K. Its format is [ ... row_i col_j value_ij ... ].

Related Topics

Linear N Port (nport)

Important note about spline and linear interpolation parameters

Circuit Components

Important note about spline and linear interpolation parameters

interp

To calculate impulse response, either linear or spline interpolation is used to sample data points in the frequency domain, based on the S-parameter data file. When the input data points are sufficient, linear and spline interpolation produce comparable model accuracy. However, when the input data points are scarce, linear interpolation is preferred to bound jumps between data points. Interpolation/extrapolation can be avoided all together if the S-parameter data is provided from zero frequency to fmax with uniform step fdelta, and number of samples is a power of 2.

fmax

The default value of fmax is three times the highest frequency in the S-parameter data file. Impulse response is calculated by sampling frequency points between DC and `fmax'. The purpose of this extrapolation is to preserve high-frequency model accuracy. However, if you have enough bandwidth in the S-parameter data file, `fmax' needs to be set to the original highest frequency in the S-parameter data file. In general, fmax must be larger than the expected signal bandwidth.

fdelta

Frequency sampling interval automatically calculated by the simulator. If causality=no, it is the default of fmax/4096. If causality=fmax/auto, it is adaptively optimized. This interval is also limited by fmax/maxn. If you specify the parameter explicitly, adaptive sampling is disabled.

fdelta can be further reduced so that fmax/fdelta is a power of 2. This is required by the FFT algorithm.

maxn

Maximal order of impulse response, or the maximum number of sampling points in the frequency domain. You should increase this value only when modeling a system with large average group delay, such as transmission line. Setting this parameter to an unnecessarily large value slows down the time-domain simulation. The absolute upper limit for maxn is 262144.

impnoiselevel

Noise level threshold for impulse responses used in causality enforcement.

imptrunc

Relative truncation threshold for impulse response. The head and tail of the impulse response with absolute values below imptrunc is removed to speed up the simulation.

datatrunc

S-parameter data truncation threshold relative to the maximum element in the same row. The S-parameter data below datatrunc is dropped. This improves the capability and performance for simulating large-scale nport systems. Set datatrunc=0 to keep all S-parameter data.

usewindow

Kaiser-Bessel window with smoothing parameter 1 is used to regulate the stability of S-parameter data. This parameter trades off model accuracy with model stability and is particularly useful for S-parameter data with insufficient bandwidth. Window must be used for all-pass type systems, where S-parameters are non-zero for frequencies beyond fmax.

dcextrap

For long delay, the DC extrapolation method can be set to constant, unwrap, or hpunwrap. The default is constant, where, without a dc point, the low-frequency magnitude is held at the lowest data point and the dc phase is set to the real axis near the lowest-frequency data point and interpolated elsewhere. If the parameter is set to unwrap and there is no dc point, the DC magnitude is set based on a regression of some low-frequency data, and the DC phase is set by unwrapping the phase and then setting it onto the real axis. If the dc point is specified, the magnitude is interpolated while the phase is still determined using the unwrapped estimate. hpunwrap is similar to unwrap for DC phase extrapolation but provides an alternative approach for DC magnitude extrapolation, which may be preferred for high-pass characteristics.

hfextrap

For an all-pass system or nearly all-pass system, the high frequency extrapolation method can be set to constant or linear. The default is constant, which causes the out-of-band frequency magnitude and phase to be held at the highest data point. For the 'linear' case, the out-of-band frequency magnitude is still held at the highest data point, but the phase is linearly extrapolated based on the phase of the in-band high frequency data.

passivity

Due to poor measurement accuracy, the S-parameter data may be non-passive. Non-passive S-parameter data may lead to non-converging or even unstable time domain simulations. . The passivity option controls the detection and enforcement of S-parameter simulation model passivity. The passivity option can be set to no, check, or enforce for interp=spline|linear. The default is check, which causes the simulator to check the S-parameter data at each frequency point and report non-passive data. If the parameter is set to enforce, the simulator corrects the data to ensure passivity, if the original data is non-passive. This can cause accuracy loss.

For interp=bbspice, passivity may be set to fit_weak_enforce or fit_enforce, The default value is fit_enforce. With passivity=fit_enforce, the simulator always attempts to create a passive simulation model and favors passivity over accuracy. With passivity=fit_weak_enforce, the simulator does not create a passive model if the passivity enforcement phase results in a significant accuracy loss.

For interp=bbspice, the simulator always checks if the S-parameter data is passive. Passivity options fit_weak_enforce and fit_enforce are only available for interp=bbspice and are interpreted as passivity=check for interp=linear|spline. Passivity options no, check, and enforce are only available for interp=linear|spline and are interpreted as passivity=fit_enforce for interp=bbspice.

pabstol

When checking or enforcing passivity, the default tolerance of the passivity criteria is -1.0e-6. If the parameter is set to a higher value, the passivity checking criteria loosens.

causality

For convolution-based time-domain simulation, causality is an important factor that affects the simulation accuracy. If causality=fmax, the simulator corrects the S-parameter causality up to fmax, as specified by the existing parameter. If causality=auto, the simulator corrects the S-parameter causality up to the automatically optimized fmax and ignores the existing parameter fmax. The parameters usewindow and hfextrap are ignored when causality=fmax or causality=auto.

It is recommended to use causality=fmax to obtain good simulation accuracy. For certain cases, if causality=fmax does not provide the expected accuracy, you can try causality=auto. However, it is slow to perform causality correction for large systems if causality=auto.

Important note about parameters for validation tool

An S-parameter time-domain validation tool is used to compare the original S-parameter data with the equivalent S-parameter data based on the corresponding time-domain model. The simulator uses the equivalent S-parameter data instead of the original S-parameter data in small signal analyses: sp, ac, and xf.

acmodel

This parameter alters the nport behavior in small signal analyses: sp, ac, and xf. The default value is freqdomain. When acmodel=freqdomain, the frequency domain data is used directly in small signal analysis after interpolation/extrapolation to a set of frequency sweep points. When acmodel=timedomain, frequency domain data is converted to a time-domain model in the same way it is done in the transient initialization step. Then, the time-domain model is converted back to the frequency domain, which is used in small signal analysis.

outfile

This parameter is used to specify the name of the file used for storing the equivalent S-parameter data based on the corresponding time-domain model. The file format is touchstone. The instance name is added as a suffix and the file extension is added automatically. If the corresponding impulse responses are not generated, this parameter is ignored.

You can run ac analysis with acmodel=timedomain and compare the results with acmodel=freqdomain to see if the time-domain model is accurate. In addition, you can plot the equivalent S-parameters (outfile) and compare the results with the original S-parameter data using VIVA.

If interp=bbspice, this file is the same as the fitted sp file in the cache directory.

Important note about impulse responses (IR) reuse feature

Spectre checks there is a corresponding IR file. If yes, it loads the data from the IR file. If an IR file is not found, Spectre computes it and saves the IR file to the directory specified by the global option nportirfiledir. If the directory name is not specified, the file is written to /home/<username>/.cadence/mmsim/. To store the file in a location other than the default, you must specify either an absolute or a relative path. If a relative path is specified, the path is relative to the current working directory.

The global option nportirreuse={yes|no} can be used to enable or disable the IR reuse feature for all nport instances.

nportirreuse and nportirfiledir also work for interp=bbspice. The stored file named with '_encrypt' is the encrypted rational fitting model (RFM) from bbspice. The stored file named with '_save' is the fitting error report, it is created only when large fitting errors show up.

With interp=bbspice, there are some output files from bbspice run, they are located in BBSpiceOutput directory. This directory is under the current working directory unless the -outdir command line option is specified.

Important note about parameters for state-space models

porttype and portquantities

Both parameters have the same number of entries as the number of ports, and each entry corresponds to a port. The entries are in the same order as the port order in the terminal specification of the instance. The porttype parameter specifies the type of each port of nport. A port can be of type input, output, or both. The portquantities parameter specifies whether each input/output is a voltage or current. Each entry in portquantities corresponds to one entry in porttypes. It specifies the quantity of input for input and both ports and the quantity of output for the output port. For both input and output ports, if the input quantity is set to voltage, the output quantity will be current and vice-versa.

matrixfile

Matrix entry data file name.

File format:

Any line beginning with ";", "#", or "%" is treated as a comment and discarded.

Remaining lines should have a first character as A, B, C, D, E, or K, two integers, and a floating-point number. Such a line denotes an entry in the appropriate matrix with given row column indexes and matrix element.

For example, a file may look like this:

;matrix A, 3x3
A 1 1 1234.5678
...
;
;matrix E, 3x3
E 1 1 1.0
...
;
;matrix B, 3x1
B 2 1 4.28
...
;
;matrix C, 2x3
C 2 1 3.14
...

If a matrix is not specified in the file, it is treated as a zero matrix for A, B, C, D, and K. Matrix E is treated as an identity matrix, if it is not specified in the file.

matrixA matrixB matrixC matrixD matrixE matrixK

Coefficient matrices of the state-space model. The syntax of the vector is in sparse form, that is:

[ Row_1, Column_1, Value_11,
  ...
  Row_i, Column_j, Value_ij,
  ... ]

If a matrix is not specified, it is treated as a zero matrix for A, B, C, D, and K. Matrix E is treated as an identity matrix, if it is not specified.

Related Topics

Model Syntax

Linear N Port (nport)

Circuit Components


Return to top
 ⠀
X