## Hspice TUTORIAL

### Parameter sweep in hspice

Parameter sweeping is a powerful way of generating multiple simulation by varying the value of one particular parameter.

To understand it, let us assume that in the above example, we wish to know – how the waveforms look if the impedance vale is varied between 40 Ohms to 60 Ohms in steps of 5 Ohms. The code below does it.

* Example of parameter sweep .PARAM impedance = 50 .Tran 50ps 8ns sweep impedance 40 60 5 .OPTION Post Probe VIN 1 0 PWL 0 0v 50ps 0v 350ps 3.3v Rsource 1 2 50 Tfirst 2 0 3 0 ZO=impedance TD=1000ps C3 4 0 1.5p Tsecond 3 0 4 0 ZO=impedance TD=1000ps .Probe v(1) v(2)v(3)v(4) .End |

This is a simple hspice code with two sections of transmission line. Each transmission line has typical impedance. The value of this impedance has been assigned a value of 50 at the beginning of the code with the statement

.PARAM impedance = 50

If we need to change the value of the impedance of the transmission line, we need to make change only at one place, instead of two places.

If you are curious, what the above hspice code does, take a look at the waveforms below. It is a simple source termination reflected wave propagation scheme. The effect of the capacitor reflection is not visible as it gets absorbed at the source.

You can now run the Avanwaves and check the waveforms corresponding to the 5 values of the transmission line impedance 40 Ohms, 45 Ohms, 50 Ohms, 55 Ohms and 60 Ohms.

**Figure - Example of simulation with parametric sweep.**

In the next page we will learn about using hspice for 2D field solvers.