Languages

CommunityCategory: GLISTERSimulating the DC transfer characteristics of a circuit model

XMODEL GLISTER

Simulating the DC transfer characteristics of a circuit model

SA Support Team Staff 2021-01-31

Often, I need to measure a DC transfer curve of my circuit model. That is, I want to plot the DC response of a model for a range of DC input values. Normally, I would run a set of simulations each with a different input value and collect the results to plot the DC transfer curve. Is there a simpler way?

1 Answers
Best Answer
SA Support Team Staff 2021-01-31

The XMODEL 2021.01 release introduced the 'probe_dc' primitive, which offers a convenient way of measuring the DC transfer function of a circuit or system model in a single simulation run. Its usage is similar to the 'probe_ac' primitive, which measures the AC transfer function (see this link).

The 'probe_dc' primitive measures the DC transfer function of a circuit model by supplying a DC stimulus ('stim') and measuring the circuit's response ('resp'). That is, one can measure the DC transfer function by configuring a testbench that feeds the 'stim' output of this primitive to the model's input and connects the model's output to the 'resp' input of this primitive.

Let's take a small example for illustration. The following model named 'nlfunc' describes a nonlinear function with saturation limits. It is composed with a 'limit', 'poly_func', and 'scale' primitives (see this link) and its gain is made adjustable with a parameter named 'gain' which has a default value of 1.

Here is a testbench schematic named 'tb_dc' that measures the DC transfer characteristics of this 'nlfunc' model using the 'probe_dc' primitive. The 'stim' output of the 'probe_dc' primitive is connected to the input 'in' of the model and the output 'out' of the model is connected back to the 'resp' input of the 'probe_dc' primitive. The 'probe_dc' primitive is configured with a start value of -1.5, a stop value of 1.5 and a step increment of 0.2, implying that it will produce a set of DC input values ranging from -1.5 to 1.5 with an increment of 0.2. Its trigger period and initial delay are set at 2ns and 5ns, respectively, implying that the primitive will step through the input values at a 2ns interval after a 5ns initial delay. The 'dump' primitive on the testbench schematic is to record the waveforms of 'in' and 'out'.

Let's run the simulation with this testbench. The waveforms below show that the 'probe_dc' primitive indeed supplies the stimulus signal that changes over the specified range with the specified schedule. When the model under test produces a response to each of the input value, it is recorded by the 'probe_dc' primitive to construct the DC transfer function. Note that for desired results, the trigger period and initial delay must be long enough for the model under test to reach its final DC responses. By setting the trigger period to 0, you can use an external trigger signal to tell when the 'probe_dc' primitive should take the measurement on the response and move on to the next value.

The 'probe_dc' primitive records the measured results into a text file with a default name of "probe_dc.dat". The example content of this "probe_dc.dat" file is shown below.

#DATAFILE: probe_dc measurement data (tb_dc.XP0)
-1.50000000e+00 -2.00000000e+00
-1.30000000e+00 -2.00000000e+00
-1.10000000e+00 -2.00000000e+00
-9.00000000e-01 -1.97100000e+00
-7.00000000e-01 -1.75700000e+00
-5.00000000e-01 -1.37500000e+00
-3.00000000e-01 -8.73000000e-01
-1.00000000e-01 -2.99000000e-01
1.00000000e-01 2.99000000e-01
3.00000000e-01 8.73000000e-01
5.00000000e-01 1.37500000e+00
7.00000000e-01 1.75700000e+00
9.00000000e-01 1.97100000e+00
1.10000000e+00 2.00000000e+00
1.30000000e+00 2.00000000e+00
1.50000000e+00 2.00000000e+00

XMODEL offers a script named 'meas_dc' that can plot a DC transfer function from the measurement file. To plot a DC transfer function, run the following command from the simulation directory (where the 'probe_dc.dat' file is located):

meas_dc --plotwave

And here is the resulting plot:

By creating a testbench view, you can plot this DC transfer function directly from GLISTER. To create a new testbench view, open the XMODEL Testbench Editor by selecting the GLISTER->Open Testbench Editor pull-down menu from the schematic editor and click the first icon on the sidebar labeled as 'Create New Testbench'. Since we are not adding a testbench source file in this example, on the Design tab, delete the file item from the Dependent Cellviews and Files window and rename the top-level module to the cell name of the testbench schematic ('tb_dc'). Next, on the Commands tab, replace the default commands of 'xmodel' and 'xwave' with 'meas_dc' as shown below. Now you can run the simulation by clicking the 'play' icon and view the results by clicking the 'wave' icon on the Testbench Editor sidebar.

Once you have setup this testbench view, it is easy to perform additional parameter sweep for the DC transfer function measurement. For example, let's say we want to plot a set of DC transfer functions of this nonlinear model when its 'gain' parameter is at 0.5, 1.0, and 1.5. You can do this by adding a '--sweep' option to your testbench view. The example below shows how to sweep the parameter tb_dc.DUT.gain (it is the hierarchical name of the 'gain' parameter of our model under test) from 0.5 to 1.5 at an increment of 0.5. For more information on this '--sweep' option, please refer to this link.

Now, when you run the simulation by clicking the 'play' icon and view the results by clicking the 'wave' icon, you get the plot as shown below.

GLISTER XMODEL

회로모델의 DC 전달특성을 시뮬레이션하는 방법

SA Support Team Staff 2021-01-31

종종 회로 모델의 DC 전달특성을 측정해야 하는 경우가 있습니다. 즉, 입력의 DC 값이 어떤 범위에서 변할때 모델의 DC 반응값이 어떻게 변하는지를 그래프로 표현하고 싶은 것이죠. 제가 생각할 수 있는 방법은 먼저 입력값을 각각 다르게 설정한 복수의 시뮬레이션을 수행한 후, 그 얻어진 결과들을 수집해서 그래프를 그리는 것입니다. 혹시 좀더 간단한 방법이 있을까요?

1 Answers
Best Answer
SA Support Team Staff 2021-01-31

The XMODEL 2021.01 release introduced the 'probe_dc' primitive, which offers a convenient way of measuring the DC transfer function of a circuit or system model in a single simulation run. Its usage is similar to the 'probe_ac' primitive, which measures the AC transfer function (see this link).

The 'probe_dc' primitive measures the DC transfer function of a circuit model by supplying a DC stimulus ('stim') and measuring the circuit's response ('resp'). That is, one can measure the DC transfer function by configuring a testbench that feeds the 'stim' output of this primitive to the model's input and connects the model's output to the 'resp' input of this primitive.

Let's take a small example for illustration. The following model named 'nlfunc' describes a nonlinear function with saturation limits. It is composed with a 'limit', 'poly_func', and 'scale' primitives (see this link) and its gain is made adjustable with a parameter named 'gain' which has a default value of 1.

Here is a testbench schematic named 'tb_dc' that measures the DC transfer characteristics of this 'nlfunc' model using the 'probe_dc' primitive. The 'stim' output of the 'probe_dc' primitive is connected to the input 'in' of the model and the output 'out' of the model is connected back to the 'resp' input of the 'probe_dc' primitive. The 'probe_dc' primitive is configured with a start value of -1.5, a stop value of 1.5 and a step increment of 0.2, implying that it will produce a set of DC input values ranging from -1.5 to 1.5 with an increment of 0.2. Its trigger period and initial delay are set at 2ns and 5ns, respectively, implying that the primitive will step through the input values at a 2ns interval after a 5ns initial delay. The 'dump' primitive on the testbench schematic is to record the waveforms of 'in' and 'out'.

Let's run the simulation with this testbench. The waveforms below show that the 'probe_dc' primitive indeed supplies the stimulus signal that changes over the specified range with the specified schedule. When the model under test produces a response to each of the input value, it is recorded by the 'probe_dc' primitive to construct the DC transfer function. Note that for desired results, the trigger period and initial delay must be long enough for the model under test to reach its final DC responses. By setting the trigger period to 0, you can use an external trigger signal to tell when the 'probe_dc' primitive should take the measurement on the response and move on to the next value.

The 'probe_dc' primitive records the measured results into a text file with a default name of "probe_dc.dat". The example content of this "probe_dc.dat" file is shown below.

#DATAFILE: probe_dc measurement data (tb_dc.XP0)
-1.50000000e+00 -2.00000000e+00
-1.30000000e+00 -2.00000000e+00
-1.10000000e+00 -2.00000000e+00
-9.00000000e-01 -1.97100000e+00
-7.00000000e-01 -1.75700000e+00
-5.00000000e-01 -1.37500000e+00
-3.00000000e-01 -8.73000000e-01
-1.00000000e-01 -2.99000000e-01
1.00000000e-01 2.99000000e-01
3.00000000e-01 8.73000000e-01
5.00000000e-01 1.37500000e+00
7.00000000e-01 1.75700000e+00
9.00000000e-01 1.97100000e+00
1.10000000e+00 2.00000000e+00
1.30000000e+00 2.00000000e+00
1.50000000e+00 2.00000000e+00

XMODEL offers a script named 'meas_dc' that can plot a DC transfer function from the measurement file. To plot a DC transfer function, run the following command from the simulation directory (where the 'probe_dc.dat' file is located):

meas_dc --plotwave

And here is the resulting plot:

By creating a testbench view, you can plot this DC transfer function directly from GLISTER. To create a new testbench view, open the XMODEL Testbench Editor by selecting the GLISTER->Open Testbench Editor pull-down menu from the schematic editor and click the first icon on the sidebar labeled as 'Create New Testbench'. Since we are not adding a testbench source file in this example, on the Design tab, delete the file item from the Dependent Cellviews and Files window and rename the top-level module to the cell name of the testbench schematic ('tb_dc'). Next, on the Commands tab, replace the default commands of 'xmodel' and 'xwave' with 'meas_dc' as shown below. Now you can run the simulation by clicking the 'play' icon and view the results by clicking the 'wave' icon on the Testbench Editor sidebar.

Once you have setup this testbench view, it is easy to perform additional parameter sweep for the DC transfer function measurement. For example, let's say we want to plot a set of DC transfer functions of this nonlinear model when its 'gain' parameter is at 0.5, 1.0, and 1.5. You can do this by adding a '--sweep' option to your testbench view. The example below shows how to sweep the parameter tb_dc.DUT.gain (it is the hierarchical name of the 'gain' parameter of our model under test) from 0.5 to 1.5 at an increment of 0.5. For more information on this '--sweep' option, please refer to this link.

Now, when you run the simulation by clicking the 'play' icon and view the results by clicking the 'wave' icon, you get the plot as shown below.