subcircuit2ssc
Convert SPICE subcircuit to custom Simscape components
Syntax
Description
subcircuit2ssc(
reads the SPICE netlist specified by filename
,target
)filename
and converts
every subcircuit into one or more Simscape™ files in the folder specified by target
.
The function lists SPICE commands not supported by the conversion process in the comments of the corresponding Simscape files. After conversion, review the generated Simscape files and make manual edits for any unsupported items. You can also obtain a list of unsupported commands by using an optional output argument, described below.
For a detailed explanation of supported conversions, see Converting a SPICE Netlist to Simscape Blocks.
subcircuit2ssc(___,
converts only the subcircuits with the specified names.subcircuit1,...,subcircuitN
)
returns an array of objects containing the subcircuit information.subcircuitArray
= subcircuit2ssc(___)
[
returns an array of objects containing the subcircuit information and a
subcircuitArray
,unsupportedCommands
] = subcircuit2ssc(___)struct
array containing the subcircuit names and SPICE
commands found in the converted subcircuits that are not supported by the conversion
process.
Examples
Input Arguments
Output Arguments
Limitations
The netlist must be written in Cadence® PSpice format and be syntactically correct. The conversion assistant does not check for proper PSpice syntax.
Only a subset of the PSpice netlist language is supported. However, unsupported PSpice commands are identified at the top of the corresponding Simscape component file to facilitate manual conversion.
To build generated Simscape components into Simscape blocks, parameter values must conform to Simscape constraints. For example, capacitance of a fundamental capacitor and inductance of a fundamental inductor must be nonzero.
The
subcircuit2ssc
function is useful only to convert circuits with a small number of R, L, C, and transistor devices. You should not use this function to simulate integrated circuits with hundreds of transistors. Large networks of semiconductor devices are more challenging to simulate and they only simulate reliably by using the SPICE simulation engine for which they were originally written. If you need to model application-specific integrated circuits (ASICs), create a behavioral representation of the device function instead. This results in a more useful model that simulates faster.If you are unable to start the simulation due to numerical issues, use the local solver option with a step size that is about ten times smaller than the fastest time constant of the circuit. The original subcircuit might consist of discontinuities in values or in the first or second derivatives where custom functions have been used. These discontinuities might cause poor numerical behavior.
Version History
Introduced in R2018b