generateSemiconductorSubcircuitROM
Generate reduced-order model of semiconductor switch by running SPICE
Since R2025a
Syntax
Description
The generateSemiconductorSwitchROM function converts a SPICE
subcircuit into a MOSFET (Ideal, Switching) or IGBT (Ideal,
Switching) block, which represents a reduced-order model (ROM). The SPICE
subcircuit can describe any n-type semiconductor device with an integral diode. The function
parameterizes the ROM with the on-state tabulated I-V curve and tabulated switching losses for
the transistor, and with the on-state tabulated I-V curve and tabulated reverse recovery loss
for the associated body diode.
Manufacturers often provide SPICE subcircuits that you can use to parameterize Simscape
blocks. One option is to generate a lookup table to parameterize a high-fidelity
N-Channel MOSFET or N-Channel
IGBT block from a SPICE netlist using the ee.spice.semiconductorSubcircuit2lookup function. ROMs are easier to interpret
and run faster than high-fidelity semiconductor switch subsystems. Use ROMs to quickly test
and analyze system-level scenarios where the semiconductor switch interacts with other
systems.
To use this function, you need a SPICE simulation engine. The function supports:
SIMetrix 8.4 and beyond — You must be able to run SIMetrix in non-GUI Mode. For more information, see Running in non-GUI Mode (SIMetrix Simulator Reference).
LTspice XVII and beyond.
generateSemiconductorSubcircuitROM(
generates a ROM from the SPICE subcircuit named libraryPath,subcircuitName)subcircuitName in the
SPICE subcircuit library file on the path libraryPath.
generateSemiconductorSubcircuitROM(
specifies options using one or more name-value arguments in addition to the input arguments
in the previous syntax. For example,
libraryPath,subcircuitName,Name=Value)generateSemiconductorSubcircuitROM(libraryPath,subcircuitName,OnStateGateSourceVoltage=20)
generates a ROM with an on-state gate-source voltage equal to 20 V.
Some of the name-value arguments are the test-circuit conditions. You can set these values based on your detailed circuit conditions or a datasheet. These values are optional, but accurate test-circuit conditions provide you with more accurate ROMs.
returns a structure that contains the lookup table data for the I-V curve and loss of the
semiconductor switch and the diode.ROMParameters = generateSemiconductorSubcircuitROM(libraryPath,subcircuitName,Name=Value)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Tips
If you set the value of the
SPICEToolargument to'SIMetrix', thegenerateSemiconductorSwitchROMfunction uses the value of theGateVoltageRiseFallTimeForLossargument to estimate a value for the interval at which SIMetrix prints output,tstep. Iftstepis too small, SIMetrix takes longer to write output and MATLAB takes longer to read it. Iftstepis too large, the temporal resolution is too low for the function to extract losses accurately. You can adjust the step time by modifying the value oftstepin the generated netlist. For example, this code block shows a generated netlist with a step time of 2 ns. To modify the step time, replace2.000000e-09with the value of the new step time in seconds.* SIMetrix syntax to perform a transient analysis * .tran tstep tstop * You can adjust 'tstep' to modify the output interval for tabulated results specified by the '.PRINT' statement .tran 2.000000e-09 1.000000e-04 sweep single param lossLoadCurrent list 10 20 30 40 50
After you make manual edits, save the generated netlist.
The
generateSemiconductorSwitchROMfunction uses the value of theGateVoltageRiseFallTimeForLossargument to estimate an appropriate stop time for the transient simulation of the loss extraction circuit. However, you can adjust the stop time by editing the generated netlist. In the SPICE directive for transient simulation, adjust the value assigned tostopTimeand the value of<Tstop>in the directive for transient simulation. For example, this code block shows a generated netlist with a stop time of 0.1 ms. To modify the stop time, replace both0.000100and1.000000e-04with the value of the new stop time, in seconds..param stopTime = 0.000100 *.........* .tran 2.000000e-09 1.000000e-04 *.TRAN <Tstep> <Tstop>
After you make manual edits, save the generated netlist.
![Figure contains an axes object. The axes object with title Semiconductor Switch I-V Characteristics by Temperature, xlabel Drain-Source Voltage Vds [V], ylabel Drain-Source Current Ids [A] contains 2 objects of type line. These objects represent Tj = 25 degC, Tj = 75 degC.](../../examples/simscapeelectrical/win64/GenerateMOSFETSubcircuitROMExample_01.png)
![Figure contains an axes object. The axes object with title Diode I-V Characteristics by Temperature, xlabel Diode forward voltage Vf [V], ylabel Diode forward current If [A] contains 2 objects of type line. These objects represent Tj = 25 degC, Tj = 75 degC.](../../examples/simscapeelectrical/win64/GenerateMOSFETSubcircuitROMExample_02.png)
![Figure Eon contains 2 axes objects. Axes object 1 with title Turn-On Switching Loss (Eon) at Tj = 25 [degC], xlabel On-State Current [A], ylabel Energy Loss (Eon) [J] contains 3 objects of type line. These objects represent On-State Voltage = 0 [V], On-State Voltage = 10 [V], On-State Voltage = 50 [V]. Axes object 2 with title Turn-On Switching Loss (Eon) at Tj = 75 [degC], xlabel On-State Current [A], ylabel Energy Loss (Eon) [J] contains 3 objects of type line. These objects represent On-State Voltage = 0 [V], On-State Voltage = 10 [V], On-State Voltage = 50 [V].](../../examples/simscapeelectrical/win64/GenerateMOSFETSubcircuitROMExample_03.png)
![Figure Eoff contains 2 axes objects. Axes object 1 with title Turn-Off Switching Loss (Eoff) at Tj = 25 [degC], xlabel Off-State Current [A], ylabel Energy Loss (Eoff) [J] contains 3 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 50 [V]. Axes object 2 with title Turn-Off Switching Loss (Eoff) at Tj = 75 [degC], xlabel Off-State Current [A], ylabel Energy Loss (Eoff) [J] contains 3 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 50 [V].](../../examples/simscapeelectrical/win64/GenerateMOSFETSubcircuitROMExample_04.png)
![Figure Erec contains 2 axes objects. Axes object 1 with title Reverse Recovery Loss (Erec) at Tj = 25 [degC], xlabel Complementary Switch Initial Current [A], ylabel Energy Loss (Erec) [J] contains 3 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 50 [V]. Axes object 2 with title Reverse Recovery Loss (Erec) at Tj = 75 [degC], xlabel Complementary Switch Initial Current [A], ylabel Energy Loss (Erec) [J] contains 3 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 50 [V].](../../examples/simscapeelectrical/win64/GenerateMOSFETSubcircuitROMExample_05.png)


![Figure contains an axes object. The axes object with title Diode I-V Characteristics by Temperature, xlabel Diode forward voltage V indexOf f baseline [V], ylabel Diode forward current I indexOf f baseline [A] contains 2 objects of type line. These objects represent Tj = 25 degC, Tj = 30 degC.](../../examples/simscapeelectrical/win64/GenerateIGBTSubcircuitROMExample_02.png)
![Figure Eon contains 2 axes objects. Axes object 1 with title Turn-On Switching Loss (Eon) at Tj = 25 [degC], xlabel On-State Current [A], ylabel Energy Loss (Eon) [J] contains 5 objects of type line. These objects represent On-State Voltage = 0 [V], On-State Voltage = 10 [V], On-State Voltage = 210 [V], On-State Voltage = 410 [V], On-State Voltage = 610 [V]. Axes object 2 with title Turn-On Switching Loss (Eon) at Tj = 30 [degC], xlabel On-State Current [A], ylabel Energy Loss (Eon) [J] contains 5 objects of type line. These objects represent On-State Voltage = 0 [V], On-State Voltage = 10 [V], On-State Voltage = 210 [V], On-State Voltage = 410 [V], On-State Voltage = 610 [V].](../../examples/simscapeelectrical/win64/GenerateIGBTSubcircuitROMExample_03.png)
![Figure Eoff contains 2 axes objects. Axes object 1 with title Turn-Off Switching Loss (Eoff) at Tj = 25 [degC], xlabel Off-State Current [A], ylabel Energy Loss (Eoff) [J] contains 5 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 210 [V], Off-State Voltage = 410 [V], Off-State Voltage = 610 [V]. Axes object 2 with title Turn-Off Switching Loss (Eoff) at Tj = 30 [degC], xlabel Off-State Current [A], ylabel Energy Loss (Eoff) [J] contains 5 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 210 [V], Off-State Voltage = 410 [V], Off-State Voltage = 610 [V].](../../examples/simscapeelectrical/win64/GenerateIGBTSubcircuitROMExample_04.png)
![Figure Erec contains 2 axes objects. Axes object 1 with title Reverse Recovery Loss (Erec) at Tj = 25 [degC], xlabel Complementary Switch Initial Current [A], ylabel Energy Loss (Erec) [J] contains 5 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 210 [V], Off-State Voltage = 410 [V], Off-State Voltage = 610 [V]. Axes object 2 with title Reverse Recovery Loss (Erec) at Tj = 30 [degC], xlabel Complementary Switch Initial Current [A], ylabel Energy Loss (Erec) [J] contains 5 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 210 [V], Off-State Voltage = 410 [V], Off-State Voltage = 610 [V].](../../examples/simscapeelectrical/win64/GenerateIGBTSubcircuitROMExample_05.png)
